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.
25 #include <wtf/GetPtr.h>
31 ASSERT_CLASS_FITS_IN_CELL(JSScreen);
35 #define THUNK_GENERATOR(generator) , generator
37 #define THUNK_GENERATOR(generator)
40 #define INTRINSIC(intrinsic) , intrinsic
42 #define INTRINSIC(intrinsic)
45 static const HashTableValue JSScreenTableValues[] =
47 { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenHeight), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
48 { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenWidth), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
49 { "colorDepth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenColorDepth), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50 { "pixelDepth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenPixelDepth), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "availLeft", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailLeft), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { "availTop", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailTop), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "availHeight", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailHeight), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "availWidth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailWidth), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
58 #undef THUNK_GENERATOR
59 static const HashTable JSScreenTable = { 18, 15, JSScreenTableValues, 0 };
60 /* Hash table for prototype */
62 #define THUNK_GENERATOR(generator) , generator
64 #define THUNK_GENERATOR(generator)
67 #define INTRINSIC(intrinsic) , intrinsic
69 #define INTRINSIC(intrinsic)
72 static const HashTableValue JSScreenPrototypeTableValues[] =
74 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
77 #undef THUNK_GENERATOR
78 static const HashTable JSScreenPrototypeTable = { 1, 0, JSScreenPrototypeTableValues, 0 };
79 const ClassInfo JSScreenPrototype::s_info = { "ScreenPrototype", &JSC::JSNonFinalObject::s_info, &JSScreenPrototypeTable, 0, CREATE_METHOD_TABLE(JSScreenPrototype) };
81 JSObject* JSScreenPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
83 return getDOMPrototype<JSScreen>(exec, globalObject);
86 const ClassInfo JSScreen::s_info = { "Screen", &JSDOMWrapper::s_info, &JSScreenTable, 0 , CREATE_METHOD_TABLE(JSScreen) };
88 JSScreen::JSScreen(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Screen> impl)
89 : JSDOMWrapper(structure, globalObject)
90 , m_impl(impl.leakRef())
94 void JSScreen::finishCreation(JSGlobalData& globalData)
96 Base::finishCreation(globalData);
97 ASSERT(inherits(&s_info));
100 JSObject* JSScreen::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
102 return JSScreenPrototype::create(exec->globalData(), globalObject, JSScreenPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
105 bool JSScreen::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
107 JSScreen* thisObject = jsCast<JSScreen*>(cell);
108 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
109 return getStaticValueSlot<JSScreen, Base>(exec, &JSScreenTable, thisObject, propertyName, slot);
112 bool JSScreen::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
114 JSScreen* thisObject = jsCast<JSScreen*>(object);
115 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
116 return getStaticValueDescriptor<JSScreen, Base>(exec, &JSScreenTable, thisObject, propertyName, descriptor);
119 JSValue jsScreenHeight(ExecState* exec, JSValue slotBase, const Identifier&)
121 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
123 Screen* imp = static_cast<Screen*>(castedThis->impl());
124 JSValue result = jsNumber(imp->height());
129 JSValue jsScreenWidth(ExecState* exec, JSValue slotBase, const Identifier&)
131 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
133 Screen* imp = static_cast<Screen*>(castedThis->impl());
134 JSValue result = jsNumber(imp->width());
139 JSValue jsScreenColorDepth(ExecState* exec, JSValue slotBase, const Identifier&)
141 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
143 Screen* imp = static_cast<Screen*>(castedThis->impl());
144 JSValue result = jsNumber(imp->colorDepth());
149 JSValue jsScreenPixelDepth(ExecState* exec, JSValue slotBase, const Identifier&)
151 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
153 Screen* imp = static_cast<Screen*>(castedThis->impl());
154 JSValue result = jsNumber(imp->pixelDepth());
159 JSValue jsScreenAvailLeft(ExecState* exec, JSValue slotBase, const Identifier&)
161 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
163 Screen* imp = static_cast<Screen*>(castedThis->impl());
164 JSValue result = jsNumber(imp->availLeft());
169 JSValue jsScreenAvailTop(ExecState* exec, JSValue slotBase, const Identifier&)
171 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
173 Screen* imp = static_cast<Screen*>(castedThis->impl());
174 JSValue result = jsNumber(imp->availTop());
179 JSValue jsScreenAvailHeight(ExecState* exec, JSValue slotBase, const Identifier&)
181 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
183 Screen* imp = static_cast<Screen*>(castedThis->impl());
184 JSValue result = jsNumber(imp->availHeight());
189 JSValue jsScreenAvailWidth(ExecState* exec, JSValue slotBase, const Identifier&)
191 JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
193 Screen* imp = static_cast<Screen*>(castedThis->impl());
194 JSValue result = jsNumber(imp->availWidth());
199 static inline bool isObservable(JSScreen* jsScreen)
201 if (jsScreen->hasCustomProperties())
206 bool JSScreenOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
208 JSScreen* jsScreen = static_cast<JSScreen*>(handle.get().asCell());
209 if (!isObservable(jsScreen))
211 Frame* root = jsScreen->impl()->frame();
214 return visitor.containsOpaqueRoot(root);
217 void JSScreenOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
219 JSScreen* jsScreen = static_cast<JSScreen*>(handle.get().asCell());
220 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
221 uncacheWrapper(world, jsScreen->impl(), jsScreen);
222 jsScreen->releaseImpl();
225 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Screen* impl)
227 return wrap<JSScreen>(exec, globalObject, impl);
230 Screen* toScreen(JSC::JSValue value)
232 return value.inherits(&JSScreen::s_info) ? static_cast<JSScreen*>(asObject(value))->impl() : 0;