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
23 #if ENABLE(WEBGL)
24
25 #include "JSWebGLProgram.h"
26
27 #include "WebGLProgram.h"
28 #include <wtf/GetPtr.h>
29
30 using namespace JSC;
31
32 namespace WebCore {
33
34 ASSERT_CLASS_FITS_IN_CELL(JSWebGLProgram);
35
36 /* Hash table */
37 #if ENABLE(JIT)
38 #define THUNK_GENERATOR(generator) , generator
39 #else
40 #define THUNK_GENERATOR(generator)
41 #endif
42
43 static const HashTableValue JSWebGLProgramTableValues[2] =
44 {
45 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLProgramConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
46 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
47 };
48
49 #undef THUNK_GENERATOR
50 static JSC_CONST_HASHTABLE HashTable JSWebGLProgramTable = { 2, 1, JSWebGLProgramTableValues, 0 };
51 /* Hash table for constructor */
52 #if ENABLE(JIT)
53 #define THUNK_GENERATOR(generator) , generator
54 #else
55 #define THUNK_GENERATOR(generator)
56 #endif
57
58 static const HashTableValue JSWebGLProgramConstructorTableValues[1] =
59 {
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
61 };
62
63 #undef THUNK_GENERATOR
64 static JSC_CONST_HASHTABLE HashTable JSWebGLProgramConstructorTable = { 1, 0, JSWebGLProgramConstructorTableValues, 0 };
65 class JSWebGLProgramConstructor : public DOMConstructorObject {
66 public:
67 JSWebGLProgramConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
68
69 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
70 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
71 static const JSC::ClassInfo s_info;
createStructure(JSC::JSGlobalData & globalData,JSC::JSValue prototype)72 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
73 {
74 return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
75 }
76 protected:
77 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
78 };
79
80 const ClassInfo JSWebGLProgramConstructor::s_info = { "WebGLProgramConstructor", &DOMConstructorObject::s_info, &JSWebGLProgramConstructorTable, 0 };
81
JSWebGLProgramConstructor(ExecState * exec,Structure * structure,JSDOMGlobalObject * globalObject)82 JSWebGLProgramConstructor::JSWebGLProgramConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
83 : DOMConstructorObject(structure, globalObject)
84 {
85 ASSERT(inherits(&s_info));
86 putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebGLProgramPrototype::self(exec, globalObject), DontDelete | ReadOnly);
87 }
88
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)89 bool JSWebGLProgramConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
90 {
91 return getStaticValueSlot<JSWebGLProgramConstructor, JSDOMWrapper>(exec, &JSWebGLProgramConstructorTable, this, propertyName, slot);
92 }
93
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)94 bool JSWebGLProgramConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
95 {
96 return getStaticValueDescriptor<JSWebGLProgramConstructor, JSDOMWrapper>(exec, &JSWebGLProgramConstructorTable, this, propertyName, descriptor);
97 }
98
99 /* Hash table for prototype */
100 #if ENABLE(JIT)
101 #define THUNK_GENERATOR(generator) , generator
102 #else
103 #define THUNK_GENERATOR(generator)
104 #endif
105
106 static const HashTableValue JSWebGLProgramPrototypeTableValues[1] =
107 {
108 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
109 };
110
111 #undef THUNK_GENERATOR
112 static JSC_CONST_HASHTABLE HashTable JSWebGLProgramPrototypeTable = { 1, 0, JSWebGLProgramPrototypeTableValues, 0 };
113 const ClassInfo JSWebGLProgramPrototype::s_info = { "WebGLProgramPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSWebGLProgramPrototypeTable, 0 };
114
self(ExecState * exec,JSGlobalObject * globalObject)115 JSObject* JSWebGLProgramPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
116 {
117 return getDOMPrototype<JSWebGLProgram>(exec, globalObject);
118 }
119
120 const ClassInfo JSWebGLProgram::s_info = { "WebGLProgram", &JSDOMWrapper::s_info, &JSWebGLProgramTable, 0 };
121
JSWebGLProgram(Structure * structure,JSDOMGlobalObject * globalObject,PassRefPtr<WebGLProgram> impl)122 JSWebGLProgram::JSWebGLProgram(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebGLProgram> impl)
123 : JSDOMWrapper(structure, globalObject)
124 , m_impl(impl)
125 {
126 ASSERT(inherits(&s_info));
127 }
128
createPrototype(ExecState * exec,JSGlobalObject * globalObject)129 JSObject* JSWebGLProgram::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
130 {
131 return new (exec) JSWebGLProgramPrototype(exec->globalData(), globalObject, JSWebGLProgramPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
132 }
133
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)134 bool JSWebGLProgram::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
135 {
136 return getStaticValueSlot<JSWebGLProgram, Base>(exec, &JSWebGLProgramTable, this, propertyName, slot);
137 }
138
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)139 bool JSWebGLProgram::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
140 {
141 return getStaticValueDescriptor<JSWebGLProgram, Base>(exec, &JSWebGLProgramTable, this, propertyName, descriptor);
142 }
143
jsWebGLProgramConstructor(ExecState * exec,JSValue slotBase,const Identifier &)144 JSValue jsWebGLProgramConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
145 {
146 JSWebGLProgram* domObject = static_cast<JSWebGLProgram*>(asObject(slotBase));
147 return JSWebGLProgram::getConstructor(exec, domObject->globalObject());
148 }
149
getConstructor(ExecState * exec,JSGlobalObject * globalObject)150 JSValue JSWebGLProgram::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
151 {
152 return getDOMConstructor<JSWebGLProgramConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
153 }
154
toJS(JSC::ExecState * exec,JSDOMGlobalObject * globalObject,WebGLProgram * impl)155 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebGLProgram* impl)
156 {
157 return wrap<JSWebGLProgram>(exec, globalObject, impl);
158 }
159
toWebGLProgram(JSC::JSValue value)160 WebGLProgram* toWebGLProgram(JSC::JSValue value)
161 {
162 return value.inherits(&JSWebGLProgram::s_info) ? static_cast<JSWebGLProgram*>(asObject(value))->impl() : 0;
163 }
164
165 }
166
167 #endif // ENABLE(WEBGL)
168