2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSWebKitPoint.h"
24 #include "WebKitPoint.h"
25 #include <wtf/GetPtr.h>
31 ASSERT_CLASS_FITS_IN_CELL(JSWebKitPoint);
35 #define THUNK_GENERATOR(generator) , generator
37 #define THUNK_GENERATOR(generator)
40 #define INTRINSIC(intrinsic) , intrinsic
42 #define INTRINSIC(intrinsic)
45 static const HashTableValue JSWebKitPointTableValues[] =
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) }
53 #undef THUNK_GENERATOR
54 static const HashTable JSWebKitPointTable = { 9, 7, JSWebKitPointTableValues, 0 };
55 /* Hash table for constructor */
57 #define THUNK_GENERATOR(generator) , generator
59 #define THUNK_GENERATOR(generator)
62 #define INTRINSIC(intrinsic) , intrinsic
64 #define INTRINSIC(intrinsic)
67 static const HashTableValue JSWebKitPointConstructorTableValues[] =
69 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
76 JSWebKitPointConstructor::JSWebKitPointConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
77 : DOMConstructorObject(structure, globalObject)
81 void JSWebKitPointConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
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);
89 bool JSWebKitPointConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
91 return getStaticValueSlot<JSWebKitPointConstructor, JSDOMWrapper>(exec, &JSWebKitPointConstructorTable, static_cast<JSWebKitPointConstructor*>(cell), propertyName, slot);
94 bool JSWebKitPointConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
96 return getStaticValueDescriptor<JSWebKitPointConstructor, JSDOMWrapper>(exec, &JSWebKitPointConstructorTable, static_cast<JSWebKitPointConstructor*>(object), propertyName, descriptor);
99 ConstructType JSWebKitPointConstructor::getConstructData(JSCell*, ConstructData& constructData)
101 constructData.native.function = constructJSWebKitPoint;
102 return ConstructTypeHost;
105 /* Hash table for prototype */
107 #define THUNK_GENERATOR(generator) , generator
109 #define THUNK_GENERATOR(generator)
112 #define INTRINSIC(intrinsic) , intrinsic
114 #define INTRINSIC(intrinsic)
117 static const HashTableValue JSWebKitPointPrototypeTableValues[] =
119 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
126 JSObject* JSWebKitPointPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
128 return getDOMPrototype<JSWebKitPoint>(exec, globalObject);
131 const ClassInfo JSWebKitPoint::s_info = { "WebKitPoint", &JSDOMWrapper::s_info, &JSWebKitPointTable, 0 , CREATE_METHOD_TABLE(JSWebKitPoint) };
133 JSWebKitPoint::JSWebKitPoint(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitPoint> impl)
134 : JSDOMWrapper(structure, globalObject)
135 , m_impl(impl.leakRef())
139 void JSWebKitPoint::finishCreation(JSGlobalData& globalData)
141 Base::finishCreation(globalData);
142 ASSERT(inherits(&s_info));
145 JSObject* JSWebKitPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
147 return JSWebKitPointPrototype::create(exec->globalData(), globalObject, JSWebKitPointPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
150 bool JSWebKitPoint::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
152 JSWebKitPoint* thisObject = jsCast<JSWebKitPoint*>(cell);
153 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
154 return getStaticValueSlot<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, thisObject, propertyName, slot);
157 bool JSWebKitPoint::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
159 JSWebKitPoint* thisObject = jsCast<JSWebKitPoint*>(object);
160 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
161 return getStaticValueDescriptor<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, thisObject, propertyName, descriptor);
164 JSValue jsWebKitPointX(ExecState* exec, JSValue slotBase, const Identifier&)
166 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
168 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
169 JSValue result = jsNumber(imp->x());
174 JSValue jsWebKitPointY(ExecState* exec, JSValue slotBase, const Identifier&)
176 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
178 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
179 JSValue result = jsNumber(imp->y());
184 JSValue jsWebKitPointConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
186 JSWebKitPoint* domObject = static_cast<JSWebKitPoint*>(asObject(slotBase));
187 return JSWebKitPoint::getConstructor(exec, domObject->globalObject());
190 void JSWebKitPoint::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
192 JSWebKitPoint* thisObject = jsCast<JSWebKitPoint*>(cell);
193 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
194 lookupPut<JSWebKitPoint, Base>(exec, propertyName, value, &JSWebKitPointTable, thisObject, slot);
197 void setJSWebKitPointX(ExecState* exec, JSObject* thisObject, JSValue value)
199 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
200 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
201 imp->setX(value.toFloat(exec));
205 void setJSWebKitPointY(ExecState* exec, JSObject* thisObject, JSValue value)
207 JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
208 WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
209 imp->setY(value.toFloat(exec));
213 JSValue JSWebKitPoint::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
215 return getDOMConstructor<JSWebKitPointConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
218 static inline bool isObservable(JSWebKitPoint* jsWebKitPoint)
220 if (jsWebKitPoint->hasCustomProperties())
225 bool JSWebKitPointOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
227 JSWebKitPoint* jsWebKitPoint = static_cast<JSWebKitPoint*>(handle.get().asCell());
228 if (!isObservable(jsWebKitPoint))
230 UNUSED_PARAM(visitor);
234 void JSWebKitPointOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
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();
242 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebKitPoint* impl)
244 return wrap<JSWebKitPoint>(exec, globalObject, impl);
247 WebKitPoint* toWebKitPoint(JSC::JSValue value)
249 return value.inherits(&JSWebKitPoint::s_info) ? static_cast<JSWebKitPoint*>(asObject(value))->impl() : 0;