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 "JSWebGLProgram.h"
27 #include "WebGLProgram.h"
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSWebGLProgram);
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 #define INTRINSIC(intrinsic) , intrinsic
45 #define INTRINSIC(intrinsic)
48 static const HashTableValue JSWebGLProgramTableValues[] =
50 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLProgramConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
54 #undef THUNK_GENERATOR
55 static const HashTable JSWebGLProgramTable = { 2, 1, JSWebGLProgramTableValues, 0 };
56 /* Hash table for constructor */
58 #define THUNK_GENERATOR(generator) , generator
60 #define THUNK_GENERATOR(generator)
63 #define INTRINSIC(intrinsic) , intrinsic
65 #define INTRINSIC(intrinsic)
68 static const HashTableValue JSWebGLProgramConstructorTableValues[] =
70 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
73 #undef THUNK_GENERATOR
74 static const HashTable JSWebGLProgramConstructorTable = { 1, 0, JSWebGLProgramConstructorTableValues, 0 };
75 const ClassInfo JSWebGLProgramConstructor::s_info = { "WebGLProgramConstructor", &DOMConstructorObject::s_info, &JSWebGLProgramConstructorTable, 0, CREATE_METHOD_TABLE(JSWebGLProgramConstructor) };
77 JSWebGLProgramConstructor::JSWebGLProgramConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
78 : DOMConstructorObject(structure, globalObject)
82 void JSWebGLProgramConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
84 Base::finishCreation(exec->globalData());
85 ASSERT(inherits(&s_info));
86 putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebGLProgramPrototype::self(exec, globalObject), DontDelete | ReadOnly);
89 bool JSWebGLProgramConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
91 return getStaticValueSlot<JSWebGLProgramConstructor, JSDOMWrapper>(exec, &JSWebGLProgramConstructorTable, static_cast<JSWebGLProgramConstructor*>(cell), propertyName, slot);
94 bool JSWebGLProgramConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
96 return getStaticValueDescriptor<JSWebGLProgramConstructor, JSDOMWrapper>(exec, &JSWebGLProgramConstructorTable, static_cast<JSWebGLProgramConstructor*>(object), propertyName, descriptor);
99 /* Hash table for prototype */
101 #define THUNK_GENERATOR(generator) , generator
103 #define THUNK_GENERATOR(generator)
106 #define INTRINSIC(intrinsic) , intrinsic
108 #define INTRINSIC(intrinsic)
111 static const HashTableValue JSWebGLProgramPrototypeTableValues[] =
113 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
116 #undef THUNK_GENERATOR
117 static const HashTable JSWebGLProgramPrototypeTable = { 1, 0, JSWebGLProgramPrototypeTableValues, 0 };
118 const ClassInfo JSWebGLProgramPrototype::s_info = { "WebGLProgramPrototype", &JSC::JSNonFinalObject::s_info, &JSWebGLProgramPrototypeTable, 0, CREATE_METHOD_TABLE(JSWebGLProgramPrototype) };
120 JSObject* JSWebGLProgramPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
122 return getDOMPrototype<JSWebGLProgram>(exec, globalObject);
125 const ClassInfo JSWebGLProgram::s_info = { "WebGLProgram", &JSDOMWrapper::s_info, &JSWebGLProgramTable, 0 , CREATE_METHOD_TABLE(JSWebGLProgram) };
127 JSWebGLProgram::JSWebGLProgram(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebGLProgram> impl)
128 : JSDOMWrapper(structure, globalObject)
129 , m_impl(impl.leakRef())
133 void JSWebGLProgram::finishCreation(JSGlobalData& globalData)
135 Base::finishCreation(globalData);
136 ASSERT(inherits(&s_info));
139 JSObject* JSWebGLProgram::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
141 return JSWebGLProgramPrototype::create(exec->globalData(), globalObject, JSWebGLProgramPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
144 bool JSWebGLProgram::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
146 JSWebGLProgram* thisObject = jsCast<JSWebGLProgram*>(cell);
147 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
148 return getStaticValueSlot<JSWebGLProgram, Base>(exec, &JSWebGLProgramTable, thisObject, propertyName, slot);
151 bool JSWebGLProgram::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
153 JSWebGLProgram* thisObject = jsCast<JSWebGLProgram*>(object);
154 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
155 return getStaticValueDescriptor<JSWebGLProgram, Base>(exec, &JSWebGLProgramTable, thisObject, propertyName, descriptor);
158 JSValue jsWebGLProgramConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
160 JSWebGLProgram* domObject = static_cast<JSWebGLProgram*>(asObject(slotBase));
161 return JSWebGLProgram::getConstructor(exec, domObject->globalObject());
164 JSValue JSWebGLProgram::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
166 return getDOMConstructor<JSWebGLProgramConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
169 static inline bool isObservable(JSWebGLProgram* jsWebGLProgram)
171 if (jsWebGLProgram->hasCustomProperties())
176 bool JSWebGLProgramOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
178 JSWebGLProgram* jsWebGLProgram = static_cast<JSWebGLProgram*>(handle.get().asCell());
179 if (!isObservable(jsWebGLProgram))
181 UNUSED_PARAM(visitor);
185 void JSWebGLProgramOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
187 JSWebGLProgram* jsWebGLProgram = static_cast<JSWebGLProgram*>(handle.get().asCell());
188 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
189 uncacheWrapper(world, jsWebGLProgram->impl(), jsWebGLProgram);
190 jsWebGLProgram->releaseImpl();
193 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebGLProgram* impl)
195 return wrap<JSWebGLProgram>(exec, globalObject, impl);
198 WebGLProgram* toWebGLProgram(JSC::JSValue value)
200 return value.inherits(&JSWebGLProgram::s_info) ? static_cast<JSWebGLProgram*>(asObject(value))->impl() : 0;
205 #endif // ENABLE(WEBGL)