|
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 "JSTextEvent.h" |
|
23 |
|
24 #include "JSDOMWindow.h" |
|
25 #include "KURL.h" |
|
26 #include "TextEvent.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(JSTextEvent); |
|
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 JSTextEventTableValues[3] = |
|
45 { |
|
46 { "data", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTextEventData), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTextEventConstructor), (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 JSTextEventTable = { 4, 3, JSTextEventTableValues, 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 JSTextEventConstructorTableValues[1] = |
|
61 { |
|
62 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
63 }; |
|
64 |
|
65 #undef THUNK_GENERATOR |
|
66 static JSC_CONST_HASHTABLE HashTable JSTextEventConstructorTable = { 1, 0, JSTextEventConstructorTableValues, 0 }; |
|
67 class JSTextEventConstructor : public DOMConstructorObject { |
|
68 public: |
|
69 JSTextEventConstructor(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 JSTextEventConstructor::s_info = { "TextEventConstructor", 0, &JSTextEventConstructorTable, 0 }; |
|
84 |
|
85 JSTextEventConstructor::JSTextEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
86 : DOMConstructorObject(JSTextEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
87 { |
|
88 putDirect(exec->propertyNames().prototype, JSTextEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
89 } |
|
90 |
|
91 bool JSTextEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
92 { |
|
93 return getStaticValueSlot<JSTextEventConstructor, DOMObject>(exec, &JSTextEventConstructorTable, this, propertyName, slot); |
|
94 } |
|
95 |
|
96 bool JSTextEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
97 { |
|
98 return getStaticValueDescriptor<JSTextEventConstructor, DOMObject>(exec, &JSTextEventConstructorTable, 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 JSTextEventPrototypeTableValues[2] = |
|
109 { |
|
110 { "initTextEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTextEventPrototypeFunctionInitTextEvent), (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 JSTextEventPrototypeTable = { 2, 1, JSTextEventPrototypeTableValues, 0 }; |
|
116 const ClassInfo JSTextEventPrototype::s_info = { "TextEventPrototype", 0, &JSTextEventPrototypeTable, 0 }; |
|
117 |
|
118 JSObject* JSTextEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
119 { |
|
120 return getDOMPrototype<JSTextEvent>(exec, globalObject); |
|
121 } |
|
122 |
|
123 bool JSTextEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
124 { |
|
125 return getStaticFunctionSlot<JSObject>(exec, &JSTextEventPrototypeTable, this, propertyName, slot); |
|
126 } |
|
127 |
|
128 bool JSTextEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
129 { |
|
130 return getStaticFunctionDescriptor<JSObject>(exec, &JSTextEventPrototypeTable, this, propertyName, descriptor); |
|
131 } |
|
132 |
|
133 const ClassInfo JSTextEvent::s_info = { "TextEvent", &JSUIEvent::s_info, &JSTextEventTable, 0 }; |
|
134 |
|
135 JSTextEvent::JSTextEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TextEvent> impl) |
|
136 : JSUIEvent(structure, globalObject, impl) |
|
137 { |
|
138 } |
|
139 |
|
140 JSObject* JSTextEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
141 { |
|
142 return new (exec) JSTextEventPrototype(globalObject, JSTextEventPrototype::createStructure(JSUIEventPrototype::self(exec, globalObject))); |
|
143 } |
|
144 |
|
145 bool JSTextEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
146 { |
|
147 return getStaticValueSlot<JSTextEvent, Base>(exec, &JSTextEventTable, this, propertyName, slot); |
|
148 } |
|
149 |
|
150 bool JSTextEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
151 { |
|
152 return getStaticValueDescriptor<JSTextEvent, Base>(exec, &JSTextEventTable, this, propertyName, descriptor); |
|
153 } |
|
154 |
|
155 JSValue jsTextEventData(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSTextEvent* castedThis = static_cast<JSTextEvent*>(asObject(slotBase)); |
|
158 UNUSED_PARAM(exec); |
|
159 TextEvent* imp = static_cast<TextEvent*>(castedThis->impl()); |
|
160 JSValue result = jsString(exec, imp->data()); |
|
161 return result; |
|
162 } |
|
163 |
|
164 JSValue jsTextEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
165 { |
|
166 JSTextEvent* domObject = static_cast<JSTextEvent*>(asObject(slotBase)); |
|
167 return JSTextEvent::getConstructor(exec, domObject->globalObject()); |
|
168 } |
|
169 JSValue JSTextEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
170 { |
|
171 return getDOMConstructor<JSTextEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
172 } |
|
173 |
|
174 EncodedJSValue JSC_HOST_CALL jsTextEventPrototypeFunctionInitTextEvent(ExecState* exec) |
|
175 { |
|
176 JSValue thisValue = exec->hostThisValue(); |
|
177 if (!thisValue.inherits(&JSTextEvent::s_info)) |
|
178 return throwVMTypeError(exec); |
|
179 JSTextEvent* castedThis = static_cast<JSTextEvent*>(asObject(thisValue)); |
|
180 TextEvent* imp = static_cast<TextEvent*>(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->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg); |
|
188 return JSValue::encode(jsUndefined()); |
|
189 } |
|
190 |
|
191 |
|
192 } |