24ad9246eee467231931c8c84d9ade399a7141d3
[vuplus_webkit] / Source / WebCore / bindings / scripts / test / JS / JSTestMediaQueryListListener.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 "JSTestMediaQueryListListener.h"
23
24 #include "ExceptionCode.h"
25 #include "JSDOMBinding.h"
26 #include "MediaQueryListListener.h"
27 #include "TestMediaQueryListListener.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(JSTestMediaQueryListListener);
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 JSTestMediaQueryListListenerTableValues[] =
50 {
51     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMediaQueryListListenerConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
53 };
54
55 #undef THUNK_GENERATOR
56 static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerTable = { 2, 1, JSTestMediaQueryListListenerTableValues, 0 };
57 /* Hash table for constructor */
58 #if ENABLE(JIT)
59 #define THUNK_GENERATOR(generator) , generator
60 #else
61 #define THUNK_GENERATOR(generator)
62 #endif
63 #if ENABLE(DFG_JIT)
64 #define INTRINSIC(intrinsic) , intrinsic
65 #else
66 #define INTRINSIC(intrinsic)
67 #endif
68
69 static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[] =
70 {
71     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
72 };
73
74 #undef THUNK_GENERATOR
75 static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerConstructorTable = { 1, 0, JSTestMediaQueryListListenerConstructorTableValues, 0 };
76 class JSTestMediaQueryListListenerConstructor : public DOMConstructorObject {
77 private:
78     JSTestMediaQueryListListenerConstructor(JSC::Structure*, JSDOMGlobalObject*);
79     void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
80
81 public:
82     typedef DOMConstructorObject Base;
83     static JSTestMediaQueryListListenerConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
84     {
85         JSTestMediaQueryListListenerConstructor* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(structure, globalObject);
86         ptr->finishCreation(exec, globalObject);
87         return ptr;
88     }
89
90     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
91     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
92     static const JSC::ClassInfo s_info;
93     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
94     {
95         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
96     }
97 protected:
98     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
99 };
100
101 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 };
102
103 JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
104     : DOMConstructorObject(structure, globalObject)
105 {
106 }
107
108 void JSTestMediaQueryListListenerConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
109 {
110     Base::finishCreation(exec->globalData());
111     ASSERT(inherits(&s_info));
112     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
113 }
114
115 bool JSTestMediaQueryListListenerConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
116 {
117     return getStaticValueSlot<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, slot);
118 }
119
120 bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
121 {
122     return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, descriptor);
123 }
124
125 /* Hash table for prototype */
126 #if ENABLE(JIT)
127 #define THUNK_GENERATOR(generator) , generator
128 #else
129 #define THUNK_GENERATOR(generator)
130 #endif
131 #if ENABLE(DFG_JIT)
132 #define INTRINSIC(intrinsic) , intrinsic
133 #else
134 #define INTRINSIC(intrinsic)
135 #endif
136
137 static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[] =
138 {
139     { "method", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestMediaQueryListListenerPrototypeFunctionMethod), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
140     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
141 };
142
143 #undef THUNK_GENERATOR
144 static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
145 const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSNonFinalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0 };
146
147 JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
148 {
149     return getDOMPrototype<JSTestMediaQueryListListener>(exec, globalObject);
150 }
151
152 bool JSTestMediaQueryListListenerPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
153 {
154     return getStaticFunctionSlot<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, slot);
155 }
156
157 bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
158 {
159     return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, descriptor);
160 }
161
162 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &JSDOMWrapper::s_info, &JSTestMediaQueryListListenerTable, 0 };
163
164 JSTestMediaQueryListListener::JSTestMediaQueryListListener(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
165     : JSDOMWrapper(structure, globalObject)
166     , m_impl(impl)
167 {
168 }
169
170 void JSTestMediaQueryListListener::finishCreation(JSGlobalData& globalData)
171 {
172     Base::finishCreation(globalData);
173     ASSERT(inherits(&s_info));
174 }
175
176 JSObject* JSTestMediaQueryListListener::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
177 {
178     return JSTestMediaQueryListListenerPrototype::create(exec->globalData(), globalObject, JSTestMediaQueryListListenerPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
179 }
180
181 bool JSTestMediaQueryListListener::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
182 {
183     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
184     return getStaticValueSlot<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, slot);
185 }
186
187 bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
188 {
189     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
190     return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, descriptor);
191 }
192
193 JSValue jsTestMediaQueryListListenerConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
194 {
195     JSTestMediaQueryListListener* domObject = static_cast<JSTestMediaQueryListListener*>(asObject(slotBase));
196     return JSTestMediaQueryListListener::getConstructor(exec, domObject->globalObject());
197 }
198
199 JSValue JSTestMediaQueryListListener::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
200 {
201     return getDOMConstructor<JSTestMediaQueryListListenerConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
202 }
203
204 EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod(ExecState* exec)
205 {
206     JSValue thisValue = exec->hostThisValue();
207     if (!thisValue.inherits(&JSTestMediaQueryListListener::s_info))
208         return throwVMTypeError(exec);
209     JSTestMediaQueryListListener* castedThis = static_cast<JSTestMediaQueryListListener*>(asObject(thisValue));
210     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestMediaQueryListListener::s_info);
211     TestMediaQueryListListener* imp = static_cast<TestMediaQueryListListener*>(castedThis->impl());
212     RefPtr<MediaQueryListListener> listener(MediaQueryListListener::create(ScriptValue(exec->globalData(), exec->argument(0))));
213     if (exec->hadException())
214         return JSValue::encode(jsUndefined());
215
216     imp->method(listener);
217     return JSValue::encode(jsUndefined());
218 }
219
220 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* impl)
221 {
222     return wrap<JSTestMediaQueryListListener>(exec, globalObject, impl);
223 }
224
225 TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue value)
226 {
227     return value.inherits(&JSTestMediaQueryListListener::s_info) ? static_cast<JSTestMediaQueryListListener*>(asObject(value))->impl() : 0;
228 }
229
230 }