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 "JSWebKitPoint.h"
23
24 #include "WebKitPoint.h"
25 #include <wtf/GetPtr.h>
26
27 using namespace JSC;
28
29 namespace WebCore {
30
31 ASSERT_CLASS_FITS_IN_CELL(JSWebKitPoint);
32
33 /* Hash table */
34 #if ENABLE(JIT)
35 #define THUNK_GENERATOR(generator) , generator
36 #else
37 #define THUNK_GENERATOR(generator)
38 #endif
39
40 static const HashTableValue JSWebKitPointTableValues[4] =
41 {
42 { "x", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointX), (intptr_t)setJSWebKitPointX THUNK_GENERATOR(0) },
43 { "y", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointY), (intptr_t)setJSWebKitPointY THUNK_GENERATOR(0) },
44 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
45 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
46 };
47
48 #undef THUNK_GENERATOR
49 static JSC_CONST_HASHTABLE HashTable JSWebKitPointTable = { 9, 7, JSWebKitPointTableValues, 0 };
50 /* Hash table for constructor */
51 #if ENABLE(JIT)
52 #define THUNK_GENERATOR(generator) , generator
53 #else
54 #define THUNK_GENERATOR(generator)
55 #endif
56
57 static const HashTableValue JSWebKitPointConstructorTableValues[1] =
58 {
59 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
60 };
61
62 #undef THUNK_GENERATOR
63 static JSC_CONST_HASHTABLE HashTable JSWebKitPointConstructorTable = { 1, 0, JSWebKitPointConstructorTableValues, 0 };
64 const ClassInfo JSWebKitPointConstructor::s_info = { "WebKitPointConstructor", &DOMConstructorObject::s_info, &JSWebKitPointConstructorTable, 0 };
65
JSWebKitPointConstructor(ExecState * exec,Structure * structure,JSDOMGlobalObject * globalObject)66 JSWebKitPointConstructor::JSWebKitPointConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
67 : DOMConstructorObject(structure, globalObject)
68 {
69 ASSERT(inherits(&s_info));
70 putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebKitPointPrototype::self(exec, globalObject), DontDelete | ReadOnly);
71 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(2), ReadOnly | DontDelete | DontEnum);
72 }
73
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)74 bool JSWebKitPointConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
75 {
76 return getStaticValueSlot<JSWebKitPointConstructor, JSDOMWrapper>(exec, &JSWebKitPointConstructorTable, this, propertyName, slot);
77 }
78
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)79 bool JSWebKitPointConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
80 {
81 return getStaticValueDescriptor<JSWebKitPointConstructor, JSDOMWrapper>(exec, &JSWebKitPointConstructorTable, this, propertyName, descriptor);
82 }
83
getConstructData(ConstructData & constructData)84 ConstructType JSWebKitPointConstructor::getConstructData(ConstructData& constructData)
85 {
86 constructData.native.function = constructJSWebKitPoint;
87 return ConstructTypeHost;
88 }
89
90 /* Hash table for prototype */
91 #if ENABLE(JIT)
92 #define THUNK_GENERATOR(generator) , generator
93 #else
94 #define THUNK_GENERATOR(generator)
95 #endif
96
97 static const HashTableValue JSWebKitPointPrototypeTableValues[1] =
98 {
99 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
100 };
101
102 #undef THUNK_GENERATOR
103 static JSC_CONST_HASHTABLE HashTable JSWebKitPointPrototypeTable = { 1, 0, JSWebKitPointPrototypeTableValues, 0 };
104 const ClassInfo JSWebKitPointPrototype::s_info = { "WebKitPointPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSWebKitPointPrototypeTable, 0 };
105
self(ExecState * exec,JSGlobalObject * globalObject)106 JSObject* JSWebKitPointPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
107 {
108 return getDOMPrototype<JSWebKitPoint>(exec, globalObject);
109 }
110
111 const ClassInfo JSWebKitPoint::s_info = { "WebKitPoint", &JSDOMWrapper::s_info, &JSWebKitPointTable, 0 };
112
JSWebKitPoint(Structure * structure,JSDOMGlobalObject * globalObject,PassRefPtr<WebKitPoint> impl)113 JSWebKitPoint::JSWebKitPoint(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitPoint> impl)
114 : JSDOMWrapper(structure, globalObject)
115 , m_impl(impl)
116 {
117 ASSERT(inherits(&s_info));
118 }
119
createPrototype(ExecState * exec,JSGlobalObject * globalObject)120 JSObject* JSWebKitPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
121 {
122 return new (exec) JSWebKitPointPrototype(exec->globalData(), globalObject, JSWebKitPointPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
123 }
124
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)125 bool JSWebKitPoint::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
126 {
127 return getStaticValueSlot<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, this, propertyName, slot);
128 }
129
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)130 bool JSWebKitPoint::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
131 {
132 return getStaticValueDescriptor<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, this, propertyName, descriptor);
133 }
134
jsWebKitPointX(ExecState * exec,JSValue slotBase,const Identifier &)135 JSValue jsWebKitPointX(ExecState* exec, JSValue slotBase, const Identifier&)
136 {
137 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
138 UNUSED_PARAM(exec);
139 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
140 JSValue result = jsNumber(imp->x());
141 return result;
142 }
143
144
jsWebKitPointY(ExecState * exec,JSValue slotBase,const Identifier &)145 JSValue jsWebKitPointY(ExecState* exec, JSValue slotBase, const Identifier&)
146 {
147 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
148 UNUSED_PARAM(exec);
149 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
150 JSValue result = jsNumber(imp->y());
151 return result;
152 }
153
154
jsWebKitPointConstructor(ExecState * exec,JSValue slotBase,const Identifier &)155 JSValue jsWebKitPointConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
156 {
157 JSWebKitPoint* domObject = static_cast<JSWebKitPoint*>(asObject(slotBase));
158 return JSWebKitPoint::getConstructor(exec, domObject->globalObject());
159 }
160
put(ExecState * exec,const Identifier & propertyName,JSValue value,PutPropertySlot & slot)161 void JSWebKitPoint::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
162 {
163 lookupPut<JSWebKitPoint, Base>(exec, propertyName, value, &JSWebKitPointTable, this, slot);
164 }
165
setJSWebKitPointX(ExecState * exec,JSObject * thisObject,JSValue value)166 void setJSWebKitPointX(ExecState* exec, JSObject* thisObject, JSValue value)
167 {
168 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
169 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
170 imp->setX(value.toFloat(exec));
171 }
172
173
setJSWebKitPointY(ExecState * exec,JSObject * thisObject,JSValue value)174 void setJSWebKitPointY(ExecState* exec, JSObject* thisObject, JSValue value)
175 {
176 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
177 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
178 imp->setY(value.toFloat(exec));
179 }
180
181
getConstructor(ExecState * exec,JSGlobalObject * globalObject)182 JSValue JSWebKitPoint::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
183 {
184 return getDOMConstructor<JSWebKitPointConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
185 }
186
toJS(JSC::ExecState * exec,JSDOMGlobalObject * globalObject,WebKitPoint * impl)187 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebKitPoint* impl)
188 {
189 return wrap<JSWebKitPoint>(exec, globalObject, impl);
190 }
191
toWebKitPoint(JSC::JSValue value)192 WebKitPoint* toWebKitPoint(JSC::JSValue value)
193 {
194 return value.inherits(&JSWebKitPoint::s_info) ? static_cast<JSWebKitPoint*>(asObject(value))->impl() : 0;
195 }
196
197 }
198