|
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 "JSCompositionEvent.h" |
|
23 |
|
24 #include "CompositionEvent.h" |
|
25 #include "JSDOMWindow.h" |
|
26 #include "KURL.h" |
|
27 #include <runtime/Error.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(JSCompositionEvent); |
|
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 JSCompositionEventTableValues[3] = |
|
45 { |
|
46 { "data", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCompositionEventData), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCompositionEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
49 }; |
|
50 |
|
51 #undef THUNK_GENERATOR |
|
52 static JSC_CONST_HASHTABLE HashTable JSCompositionEventTable = { 4, 3, JSCompositionEventTableValues, 0 }; |
|
53 /* Hash table for constructor */ |
|
54 #if ENABLE(JIT) |
|
55 #define THUNK_GENERATOR(generator) , generator |
|
56 #else |
|
57 #define THUNK_GENERATOR(generator) |
|
58 #endif |
|
59 |
|
60 static const HashTableValue JSCompositionEventConstructorTableValues[1] = |
|
61 { |
|
62 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
63 }; |
|
64 |
|
65 #undef THUNK_GENERATOR |
|
66 static JSC_CONST_HASHTABLE HashTable JSCompositionEventConstructorTable = { 1, 0, JSCompositionEventConstructorTableValues, 0 }; |
|
67 class JSCompositionEventConstructor : public DOMConstructorObject { |
|
68 public: |
|
69 JSCompositionEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
70 |
|
71 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
72 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
73 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
74 static const JSC::ClassInfo s_info; |
|
75 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
76 { |
|
77 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
78 } |
|
79 protected: |
|
80 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
81 }; |
|
82 |
|
83 const ClassInfo JSCompositionEventConstructor::s_info = { "CompositionEventConstructor", 0, &JSCompositionEventConstructorTable, 0 }; |
|
84 |
|
85 JSCompositionEventConstructor::JSCompositionEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
86 : DOMConstructorObject(JSCompositionEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
87 { |
|
88 putDirect(exec->propertyNames().prototype, JSCompositionEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
89 } |
|
90 |
|
91 bool JSCompositionEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
92 { |
|
93 return getStaticValueSlot<JSCompositionEventConstructor, DOMObject>(exec, &JSCompositionEventConstructorTable, this, propertyName, slot); |
|
94 } |
|
95 |
|
96 bool JSCompositionEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
97 { |
|
98 return getStaticValueDescriptor<JSCompositionEventConstructor, DOMObject>(exec, &JSCompositionEventConstructorTable, this, propertyName, descriptor); |
|
99 } |
|
100 |
|
101 /* Hash table for prototype */ |
|
102 #if ENABLE(JIT) |
|
103 #define THUNK_GENERATOR(generator) , generator |
|
104 #else |
|
105 #define THUNK_GENERATOR(generator) |
|
106 #endif |
|
107 |
|
108 static const HashTableValue JSCompositionEventPrototypeTableValues[2] = |
|
109 { |
|
110 { "initCompositionEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCompositionEventPrototypeFunctionInitCompositionEvent), (intptr_t)5 THUNK_GENERATOR(0) }, |
|
111 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
112 }; |
|
113 |
|
114 #undef THUNK_GENERATOR |
|
115 static JSC_CONST_HASHTABLE HashTable JSCompositionEventPrototypeTable = { 2, 1, JSCompositionEventPrototypeTableValues, 0 }; |
|
116 const ClassInfo JSCompositionEventPrototype::s_info = { "CompositionEventPrototype", 0, &JSCompositionEventPrototypeTable, 0 }; |
|
117 |
|
118 JSObject* JSCompositionEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
119 { |
|
120 return getDOMPrototype<JSCompositionEvent>(exec, globalObject); |
|
121 } |
|
122 |
|
123 bool JSCompositionEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
124 { |
|
125 return getStaticFunctionSlot<JSObject>(exec, &JSCompositionEventPrototypeTable, this, propertyName, slot); |
|
126 } |
|
127 |
|
128 bool JSCompositionEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
129 { |
|
130 return getStaticFunctionDescriptor<JSObject>(exec, &JSCompositionEventPrototypeTable, this, propertyName, descriptor); |
|
131 } |
|
132 |
|
133 const ClassInfo JSCompositionEvent::s_info = { "CompositionEvent", &JSUIEvent::s_info, &JSCompositionEventTable, 0 }; |
|
134 |
|
135 JSCompositionEvent::JSCompositionEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<CompositionEvent> impl) |
|
136 : JSUIEvent(structure, globalObject, impl) |
|
137 { |
|
138 } |
|
139 |
|
140 JSObject* JSCompositionEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
141 { |
|
142 return new (exec) JSCompositionEventPrototype(globalObject, JSCompositionEventPrototype::createStructure(JSUIEventPrototype::self(exec, globalObject))); |
|
143 } |
|
144 |
|
145 bool JSCompositionEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
146 { |
|
147 return getStaticValueSlot<JSCompositionEvent, Base>(exec, &JSCompositionEventTable, this, propertyName, slot); |
|
148 } |
|
149 |
|
150 bool JSCompositionEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
151 { |
|
152 return getStaticValueDescriptor<JSCompositionEvent, Base>(exec, &JSCompositionEventTable, this, propertyName, descriptor); |
|
153 } |
|
154 |
|
155 JSValue jsCompositionEventData(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSCompositionEvent* castedThis = static_cast<JSCompositionEvent*>(asObject(slotBase)); |
|
158 UNUSED_PARAM(exec); |
|
159 CompositionEvent* imp = static_cast<CompositionEvent*>(castedThis->impl()); |
|
160 JSValue result = jsString(exec, imp->data()); |
|
161 return result; |
|
162 } |
|
163 |
|
164 JSValue jsCompositionEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
165 { |
|
166 JSCompositionEvent* domObject = static_cast<JSCompositionEvent*>(asObject(slotBase)); |
|
167 return JSCompositionEvent::getConstructor(exec, domObject->globalObject()); |
|
168 } |
|
169 JSValue JSCompositionEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
170 { |
|
171 return getDOMConstructor<JSCompositionEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
172 } |
|
173 |
|
174 EncodedJSValue JSC_HOST_CALL jsCompositionEventPrototypeFunctionInitCompositionEvent(ExecState* exec) |
|
175 { |
|
176 JSValue thisValue = exec->hostThisValue(); |
|
177 if (!thisValue.inherits(&JSCompositionEvent::s_info)) |
|
178 return throwVMTypeError(exec); |
|
179 JSCompositionEvent* castedThis = static_cast<JSCompositionEvent*>(asObject(thisValue)); |
|
180 CompositionEvent* imp = static_cast<CompositionEvent*>(castedThis->impl()); |
|
181 const String& typeArg = ustringToString(exec->argument(0).toString(exec)); |
|
182 bool canBubbleArg = exec->argument(1).toBoolean(exec); |
|
183 bool cancelableArg = exec->argument(2).toBoolean(exec); |
|
184 DOMWindow* viewArg = toDOMWindow(exec->argument(3)); |
|
185 const String& dataArg = ustringToString(exec->argument(4).toString(exec)); |
|
186 |
|
187 imp->initCompositionEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg); |
|
188 return JSValue::encode(jsUndefined()); |
|
189 } |
|
190 |
|
191 |
|
192 } |