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.
24 #include "CSSPrimitiveValue.h"
25 #include "JSCSSPrimitiveValue.h"
27 #include <wtf/GetPtr.h>
33 ASSERT_CLASS_FITS_IN_CELL(JSRect);
37 #define THUNK_GENERATOR(generator) , generator
39 #define THUNK_GENERATOR(generator)
42 #define INTRINSIC(intrinsic) , intrinsic
44 #define INTRINSIC(intrinsic)
47 static const HashTableValue JSRectTableValues[] =
49 { "top", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectTop), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50 { "right", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectRight), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "bottom", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectBottom), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { "left", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectLeft), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
57 #undef THUNK_GENERATOR
58 static const HashTable JSRectTable = { 16, 15, JSRectTableValues, 0 };
59 /* Hash table for constructor */
61 #define THUNK_GENERATOR(generator) , generator
63 #define THUNK_GENERATOR(generator)
66 #define INTRINSIC(intrinsic) , intrinsic
68 #define INTRINSIC(intrinsic)
71 static const HashTableValue JSRectConstructorTableValues[] =
73 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
76 #undef THUNK_GENERATOR
77 static const HashTable JSRectConstructorTable = { 1, 0, JSRectConstructorTableValues, 0 };
78 const ClassInfo JSRectConstructor::s_info = { "RectConstructor", &DOMConstructorObject::s_info, &JSRectConstructorTable, 0, CREATE_METHOD_TABLE(JSRectConstructor) };
80 JSRectConstructor::JSRectConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
81 : DOMConstructorObject(structure, globalObject)
85 void JSRectConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
87 Base::finishCreation(exec->globalData());
88 ASSERT(inherits(&s_info));
89 putDirect(exec->globalData(), exec->propertyNames().prototype, JSRectPrototype::self(exec, globalObject), DontDelete | ReadOnly);
92 bool JSRectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
94 return getStaticValueSlot<JSRectConstructor, JSDOMWrapper>(exec, &JSRectConstructorTable, static_cast<JSRectConstructor*>(cell), propertyName, slot);
97 bool JSRectConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
99 return getStaticValueDescriptor<JSRectConstructor, JSDOMWrapper>(exec, &JSRectConstructorTable, static_cast<JSRectConstructor*>(object), propertyName, descriptor);
102 /* Hash table for prototype */
104 #define THUNK_GENERATOR(generator) , generator
106 #define THUNK_GENERATOR(generator)
109 #define INTRINSIC(intrinsic) , intrinsic
111 #define INTRINSIC(intrinsic)
114 static const HashTableValue JSRectPrototypeTableValues[] =
116 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
119 #undef THUNK_GENERATOR
120 static const HashTable JSRectPrototypeTable = { 1, 0, JSRectPrototypeTableValues, 0 };
121 const ClassInfo JSRectPrototype::s_info = { "RectPrototype", &JSC::JSNonFinalObject::s_info, &JSRectPrototypeTable, 0, CREATE_METHOD_TABLE(JSRectPrototype) };
123 JSObject* JSRectPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
125 return getDOMPrototype<JSRect>(exec, globalObject);
128 const ClassInfo JSRect::s_info = { "Rect", &JSDOMWrapper::s_info, &JSRectTable, 0 , CREATE_METHOD_TABLE(JSRect) };
130 JSRect::JSRect(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Rect> impl)
131 : JSDOMWrapper(structure, globalObject)
132 , m_impl(impl.leakRef())
136 void JSRect::finishCreation(JSGlobalData& globalData)
138 Base::finishCreation(globalData);
139 ASSERT(inherits(&s_info));
142 JSObject* JSRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
144 return JSRectPrototype::create(exec->globalData(), globalObject, JSRectPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
147 bool JSRect::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
149 JSRect* thisObject = jsCast<JSRect*>(cell);
150 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
151 return getStaticValueSlot<JSRect, Base>(exec, &JSRectTable, thisObject, propertyName, slot);
154 bool JSRect::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
156 JSRect* thisObject = jsCast<JSRect*>(object);
157 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
158 return getStaticValueDescriptor<JSRect, Base>(exec, &JSRectTable, thisObject, propertyName, descriptor);
161 JSValue jsRectTop(ExecState* exec, JSValue slotBase, const Identifier&)
163 JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
165 Rect* imp = static_cast<Rect*>(castedThis->impl());
166 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->top()));
171 JSValue jsRectRight(ExecState* exec, JSValue slotBase, const Identifier&)
173 JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
175 Rect* imp = static_cast<Rect*>(castedThis->impl());
176 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->right()));
181 JSValue jsRectBottom(ExecState* exec, JSValue slotBase, const Identifier&)
183 JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
185 Rect* imp = static_cast<Rect*>(castedThis->impl());
186 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->bottom()));
191 JSValue jsRectLeft(ExecState* exec, JSValue slotBase, const Identifier&)
193 JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
195 Rect* imp = static_cast<Rect*>(castedThis->impl());
196 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->left()));
201 JSValue jsRectConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
203 JSRect* domObject = static_cast<JSRect*>(asObject(slotBase));
204 return JSRect::getConstructor(exec, domObject->globalObject());
207 JSValue JSRect::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
209 return getDOMConstructor<JSRectConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
212 static inline bool isObservable(JSRect* jsRect)
214 if (jsRect->hasCustomProperties())
219 bool JSRectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
221 JSRect* jsRect = static_cast<JSRect*>(handle.get().asCell());
222 if (!isObservable(jsRect))
224 UNUSED_PARAM(visitor);
228 void JSRectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
230 JSRect* jsRect = static_cast<JSRect*>(handle.get().asCell());
231 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
232 uncacheWrapper(world, jsRect->impl(), jsRect);
233 jsRect->releaseImpl();
236 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Rect* impl)
238 return wrap<JSRect>(exec, globalObject, impl);
241 Rect* toRect(JSC::JSValue value)
243 return value.inherits(&JSRect::s_info) ? static_cast<JSRect*>(asObject(value))->impl() : 0;