|
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(3D_CANVAS) |
|
24 |
|
25 #include "JSWebGLContextAttributes.h" |
|
26 |
|
27 #include "WebGLContextAttributes.h" |
|
28 #include <wtf/GetPtr.h> |
|
29 |
|
30 using namespace JSC; |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 ASSERT_CLASS_FITS_IN_CELL(JSWebGLContextAttributes); |
|
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 JSWebGLContextAttributesTableValues[6] = |
|
44 { |
|
45 { "alpha", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesAlpha), (intptr_t)setJSWebGLContextAttributesAlpha THUNK_GENERATOR(0) }, |
|
46 { "depth", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesDepth), (intptr_t)setJSWebGLContextAttributesDepth THUNK_GENERATOR(0) }, |
|
47 { "stencil", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesStencil), (intptr_t)setJSWebGLContextAttributesStencil THUNK_GENERATOR(0) }, |
|
48 { "antialias", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesAntialias), (intptr_t)setJSWebGLContextAttributesAntialias THUNK_GENERATOR(0) }, |
|
49 { "premultipliedAlpha", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesPremultipliedAlpha), (intptr_t)setJSWebGLContextAttributesPremultipliedAlpha THUNK_GENERATOR(0) }, |
|
50 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
51 }; |
|
52 |
|
53 #undef THUNK_GENERATOR |
|
54 static JSC_CONST_HASHTABLE HashTable JSWebGLContextAttributesTable = { 16, 15, JSWebGLContextAttributesTableValues, 0 }; |
|
55 /* Hash table for prototype */ |
|
56 #if ENABLE(JIT) |
|
57 #define THUNK_GENERATOR(generator) , generator |
|
58 #else |
|
59 #define THUNK_GENERATOR(generator) |
|
60 #endif |
|
61 |
|
62 static const HashTableValue JSWebGLContextAttributesPrototypeTableValues[1] = |
|
63 { |
|
64 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
65 }; |
|
66 |
|
67 #undef THUNK_GENERATOR |
|
68 static JSC_CONST_HASHTABLE HashTable JSWebGLContextAttributesPrototypeTable = { 1, 0, JSWebGLContextAttributesPrototypeTableValues, 0 }; |
|
69 const ClassInfo JSWebGLContextAttributesPrototype::s_info = { "WebGLContextAttributesPrototype", 0, &JSWebGLContextAttributesPrototypeTable, 0 }; |
|
70 |
|
71 JSObject* JSWebGLContextAttributesPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
72 { |
|
73 return getDOMPrototype<JSWebGLContextAttributes>(exec, globalObject); |
|
74 } |
|
75 |
|
76 const ClassInfo JSWebGLContextAttributes::s_info = { "WebGLContextAttributes", 0, &JSWebGLContextAttributesTable, 0 }; |
|
77 |
|
78 JSWebGLContextAttributes::JSWebGLContextAttributes(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebGLContextAttributes> impl) |
|
79 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
80 , m_impl(impl) |
|
81 { |
|
82 } |
|
83 |
|
84 JSWebGLContextAttributes::~JSWebGLContextAttributes() |
|
85 { |
|
86 forgetDOMObject(this, impl()); |
|
87 } |
|
88 |
|
89 JSObject* JSWebGLContextAttributes::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
90 { |
|
91 return new (exec) JSWebGLContextAttributesPrototype(globalObject, JSWebGLContextAttributesPrototype::createStructure(globalObject->objectPrototype())); |
|
92 } |
|
93 |
|
94 bool JSWebGLContextAttributes::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
95 { |
|
96 return getStaticValueSlot<JSWebGLContextAttributes, Base>(exec, &JSWebGLContextAttributesTable, this, propertyName, slot); |
|
97 } |
|
98 |
|
99 bool JSWebGLContextAttributes::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
100 { |
|
101 return getStaticValueDescriptor<JSWebGLContextAttributes, Base>(exec, &JSWebGLContextAttributesTable, this, propertyName, descriptor); |
|
102 } |
|
103 |
|
104 JSValue jsWebGLContextAttributesAlpha(ExecState* exec, JSValue slotBase, const Identifier&) |
|
105 { |
|
106 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); |
|
107 UNUSED_PARAM(exec); |
|
108 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
109 JSValue result = jsBoolean(imp->alpha()); |
|
110 return result; |
|
111 } |
|
112 |
|
113 JSValue jsWebGLContextAttributesDepth(ExecState* exec, JSValue slotBase, const Identifier&) |
|
114 { |
|
115 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); |
|
116 UNUSED_PARAM(exec); |
|
117 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
118 JSValue result = jsBoolean(imp->depth()); |
|
119 return result; |
|
120 } |
|
121 |
|
122 JSValue jsWebGLContextAttributesStencil(ExecState* exec, JSValue slotBase, const Identifier&) |
|
123 { |
|
124 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); |
|
125 UNUSED_PARAM(exec); |
|
126 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
127 JSValue result = jsBoolean(imp->stencil()); |
|
128 return result; |
|
129 } |
|
130 |
|
131 JSValue jsWebGLContextAttributesAntialias(ExecState* exec, JSValue slotBase, const Identifier&) |
|
132 { |
|
133 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); |
|
134 UNUSED_PARAM(exec); |
|
135 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
136 JSValue result = jsBoolean(imp->antialias()); |
|
137 return result; |
|
138 } |
|
139 |
|
140 JSValue jsWebGLContextAttributesPremultipliedAlpha(ExecState* exec, JSValue slotBase, const Identifier&) |
|
141 { |
|
142 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); |
|
143 UNUSED_PARAM(exec); |
|
144 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
145 JSValue result = jsBoolean(imp->premultipliedAlpha()); |
|
146 return result; |
|
147 } |
|
148 |
|
149 void JSWebGLContextAttributes::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
150 { |
|
151 lookupPut<JSWebGLContextAttributes, Base>(exec, propertyName, value, &JSWebGLContextAttributesTable, this, slot); |
|
152 } |
|
153 |
|
154 void setJSWebGLContextAttributesAlpha(ExecState* exec, JSObject* thisObject, JSValue value) |
|
155 { |
|
156 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); |
|
157 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
158 imp->setAlpha(value.toBoolean(exec)); |
|
159 } |
|
160 |
|
161 void setJSWebGLContextAttributesDepth(ExecState* exec, JSObject* thisObject, JSValue value) |
|
162 { |
|
163 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); |
|
164 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
165 imp->setDepth(value.toBoolean(exec)); |
|
166 } |
|
167 |
|
168 void setJSWebGLContextAttributesStencil(ExecState* exec, JSObject* thisObject, JSValue value) |
|
169 { |
|
170 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); |
|
171 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
172 imp->setStencil(value.toBoolean(exec)); |
|
173 } |
|
174 |
|
175 void setJSWebGLContextAttributesAntialias(ExecState* exec, JSObject* thisObject, JSValue value) |
|
176 { |
|
177 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); |
|
178 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
179 imp->setAntialias(value.toBoolean(exec)); |
|
180 } |
|
181 |
|
182 void setJSWebGLContextAttributesPremultipliedAlpha(ExecState* exec, JSObject* thisObject, JSValue value) |
|
183 { |
|
184 JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); |
|
185 WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); |
|
186 imp->setPremultipliedAlpha(value.toBoolean(exec)); |
|
187 } |
|
188 |
|
189 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebGLContextAttributes* object) |
|
190 { |
|
191 return getDOMObjectWrapper<JSWebGLContextAttributes>(exec, globalObject, object); |
|
192 } |
|
193 WebGLContextAttributes* toWebGLContextAttributes(JSC::JSValue value) |
|
194 { |
|
195 return value.inherits(&JSWebGLContextAttributes::s_info) ? static_cast<JSWebGLContextAttributes*>(asObject(value))->impl() : 0; |
|
196 } |
|
197 |
|
198 } |
|
199 |
|
200 #endif // ENABLE(3D_CANVAS) |