tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSWebKitPoint.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 "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 #if ENABLE(DFG_JIT)
40 #define INTRINSIC(intrinsic) , intrinsic
41 #else
42 #define INTRINSIC(intrinsic)
43 #endif
44
45 static const HashTableValue JSWebKitPointTableValues[] =
46 {
47     { "x", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointX), (intptr_t)setJSWebKitPointX THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
48     { "y", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointY), (intptr_t)setJSWebKitPointY THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
49     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
51 };
52
53 #undef THUNK_GENERATOR
54 static const HashTable JSWebKitPointTable = { 9, 7, JSWebKitPointTableValues, 0 };
55 /* Hash table for constructor */
56 #if ENABLE(JIT)
57 #define THUNK_GENERATOR(generator) , generator
58 #else
59 #define THUNK_GENERATOR(generator)
60 #endif
61 #if ENABLE(DFG_JIT)
62 #define INTRINSIC(intrinsic) , intrinsic
63 #else
64 #define INTRINSIC(intrinsic)
65 #endif
66
67 static const HashTableValue JSWebKitPointConstructorTableValues[] =
68 {
69     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
70 };
71
72 #undef THUNK_GENERATOR
73 static const HashTable JSWebKitPointConstructorTable = { 1, 0, JSWebKitPointConstructorTableValues, 0 };
74 const ClassInfo JSWebKitPointConstructor::s_info = { "WebKitPointConstructor", &DOMConstructorObject::s_info, &JSWebKitPointConstructorTable, 0, CREATE_METHOD_TABLE(JSWebKitPointConstructor) };
75
76 JSWebKitPointConstructor::JSWebKitPointConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
77     : DOMConstructorObject(structure, globalObject)
78 {
79 }
80
81 void JSWebKitPointConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
82 {
83     Base::finishCreation(exec->globalData());
84     ASSERT(inherits(&s_info));
85     putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebKitPointPrototype::self(exec, globalObject), DontDelete | ReadOnly);
86     putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(2), ReadOnly | DontDelete | DontEnum);
87 }
88
89 bool JSWebKitPointConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
90 {
91     return getStaticValueSlot<JSWebKitPointConstructor, JSDOMWrapper>(exec, &JSWebKitPointConstructorTable, static_cast<JSWebKitPointConstructor*>(cell), propertyName, slot);
92 }
93
94 bool JSWebKitPointConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
95 {
96     return getStaticValueDescriptor<JSWebKitPointConstructor, JSDOMWrapper>(exec, &JSWebKitPointConstructorTable, static_cast<JSWebKitPointConstructor*>(object), propertyName, descriptor);
97 }
98
99 ConstructType JSWebKitPointConstructor::getConstructData(JSCell*, ConstructData& constructData)
100 {
101     constructData.native.function = constructJSWebKitPoint;
102     return ConstructTypeHost;
103 }
104
105 /* Hash table for prototype */
106 #if ENABLE(JIT)
107 #define THUNK_GENERATOR(generator) , generator
108 #else
109 #define THUNK_GENERATOR(generator)
110 #endif
111 #if ENABLE(DFG_JIT)
112 #define INTRINSIC(intrinsic) , intrinsic
113 #else
114 #define INTRINSIC(intrinsic)
115 #endif
116
117 static const HashTableValue JSWebKitPointPrototypeTableValues[] =
118 {
119     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
120 };
121
122 #undef THUNK_GENERATOR
123 static const HashTable JSWebKitPointPrototypeTable = { 1, 0, JSWebKitPointPrototypeTableValues, 0 };
124 const ClassInfo JSWebKitPointPrototype::s_info = { "WebKitPointPrototype", &JSC::JSNonFinalObject::s_info, &JSWebKitPointPrototypeTable, 0, CREATE_METHOD_TABLE(JSWebKitPointPrototype) };
125
126 JSObject* JSWebKitPointPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
127 {
128     return getDOMPrototype<JSWebKitPoint>(exec, globalObject);
129 }
130
131 const ClassInfo JSWebKitPoint::s_info = { "WebKitPoint", &JSDOMWrapper::s_info, &JSWebKitPointTable, 0 , CREATE_METHOD_TABLE(JSWebKitPoint) };
132
133 JSWebKitPoint::JSWebKitPoint(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitPoint> impl)
134     : JSDOMWrapper(structure, globalObject)
135     , m_impl(impl.leakRef())
136 {
137 }
138
139 void JSWebKitPoint::finishCreation(JSGlobalData& globalData)
140 {
141     Base::finishCreation(globalData);
142     ASSERT(inherits(&s_info));
143 }
144
145 JSObject* JSWebKitPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
146 {
147     return JSWebKitPointPrototype::create(exec->globalData(), globalObject, JSWebKitPointPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
148 }
149
150 bool JSWebKitPoint::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
151 {
152     JSWebKitPoint* thisObject = jsCast<JSWebKitPoint*>(cell);
153     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
154     return getStaticValueSlot<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, thisObject, propertyName, slot);
155 }
156
157 bool JSWebKitPoint::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
158 {
159     JSWebKitPoint* thisObject = jsCast<JSWebKitPoint*>(object);
160     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
161     return getStaticValueDescriptor<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, thisObject, propertyName, descriptor);
162 }
163
164 JSValue jsWebKitPointX(ExecState* exec, JSValue slotBase, const Identifier&)
165 {
166     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
167     UNUSED_PARAM(exec);
168     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
169     JSValue result = jsNumber(imp->x());
170     return result;
171 }
172
173
174 JSValue jsWebKitPointY(ExecState* exec, JSValue slotBase, const Identifier&)
175 {
176     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
177     UNUSED_PARAM(exec);
178     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
179     JSValue result = jsNumber(imp->y());
180     return result;
181 }
182
183
184 JSValue jsWebKitPointConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
185 {
186     JSWebKitPoint* domObject = static_cast<JSWebKitPoint*>(asObject(slotBase));
187     return JSWebKitPoint::getConstructor(exec, domObject->globalObject());
188 }
189
190 void JSWebKitPoint::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
191 {
192     JSWebKitPoint* thisObject = jsCast<JSWebKitPoint*>(cell);
193     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
194     lookupPut<JSWebKitPoint, Base>(exec, propertyName, value, &JSWebKitPointTable, thisObject, slot);
195 }
196
197 void setJSWebKitPointX(ExecState* exec, JSObject* thisObject, JSValue value)
198 {
199     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
200     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
201     imp->setX(value.toFloat(exec));
202 }
203
204
205 void setJSWebKitPointY(ExecState* exec, JSObject* thisObject, JSValue value)
206 {
207     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
208     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
209     imp->setY(value.toFloat(exec));
210 }
211
212
213 JSValue JSWebKitPoint::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
214 {
215     return getDOMConstructor<JSWebKitPointConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
216 }
217
218 static inline bool isObservable(JSWebKitPoint* jsWebKitPoint)
219 {
220     if (jsWebKitPoint->hasCustomProperties())
221         return true;
222     return false;
223 }
224
225 bool JSWebKitPointOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
226 {
227     JSWebKitPoint* jsWebKitPoint = static_cast<JSWebKitPoint*>(handle.get().asCell());
228     if (!isObservable(jsWebKitPoint))
229         return false;
230     UNUSED_PARAM(visitor);
231     return false;
232 }
233
234 void JSWebKitPointOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
235 {
236     JSWebKitPoint* jsWebKitPoint = static_cast<JSWebKitPoint*>(handle.get().asCell());
237     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
238     uncacheWrapper(world, jsWebKitPoint->impl(), jsWebKitPoint);
239     jsWebKitPoint->releaseImpl();
240 }
241
242 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebKitPoint* impl)
243 {
244     return wrap<JSWebKitPoint>(exec, globalObject, impl);
245 }
246
247 WebKitPoint* toWebKitPoint(JSC::JSValue value)
248 {
249     return value.inherits(&JSWebKitPoint::s_info) ? static_cast<JSWebKitPoint*>(asObject(value))->impl() : 0;
250 }
251
252 }