Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM WebGL2RenderingContext.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_WebGL2RenderingContextBinding_h
4 : #define mozilla_dom_WebGL2RenderingContextBinding_h
5 :
6 : #include "js/RootingAPI.h"
7 : #include "jsfriendapi.h"
8 : #include "jspubtd.h"
9 : #include "mozilla/ErrorResult.h"
10 : #include "mozilla/dom/BindingDeclarations.h"
11 : #include "mozilla/dom/FakeString.h"
12 : #include "mozilla/dom/Nullable.h"
13 : #include "mozilla/dom/TypedArray.h"
14 : #include "mozilla/dom/UnionMember.h"
15 :
16 : namespace mozilla {
17 :
18 : class WebGL2Context;
19 : struct WebGL2ContextAtoms;
20 : class WebGLExtensionEXTColorBufferFloat;
21 : struct WebGLExtensionEXTColorBufferFloatAtoms;
22 : class WebGLSampler;
23 : struct WebGLSamplerAtoms;
24 : class WebGLSync;
25 : struct WebGLSyncAtoms;
26 : class WebGLTransformFeedback;
27 : struct WebGLTransformFeedbackAtoms;
28 :
29 : namespace dom {
30 :
31 : struct NativePropertyHooks;
32 : class ProtoAndIfaceCache;
33 :
34 : } // namespace dom
35 :
36 : } // namespace mozilla
37 :
38 : namespace mozilla {
39 : namespace dom {
40 :
41 : class Uint32ArrayOrUnsignedLongSequence
42 : {
43 : friend class Uint32ArrayOrUnsignedLongSequenceArgument;
44 : enum Type
45 : {
46 : eUninitialized,
47 : eUint32Array,
48 : eUnsignedLongSequence
49 : };
50 :
51 0 : union Value
52 : {
53 : UnionMember<RootedTypedArray<Uint32Array> > mUint32Array;
54 : UnionMember<binding_detail::AutoSequence<uint32_t> > mUnsignedLongSequence;
55 :
56 : };
57 :
58 : Type mType;
59 : Value mValue;
60 :
61 : Uint32ArrayOrUnsignedLongSequence(const Uint32ArrayOrUnsignedLongSequence&) = delete;
62 : Uint32ArrayOrUnsignedLongSequence& operator=(const Uint32ArrayOrUnsignedLongSequence&) = delete;
63 : public:
64 0 : explicit inline Uint32ArrayOrUnsignedLongSequence()
65 0 : : mType(eUninitialized)
66 : {
67 0 : }
68 :
69 0 : inline ~Uint32ArrayOrUnsignedLongSequence()
70 0 : {
71 0 : Uninit();
72 0 : }
73 :
74 : inline RootedTypedArray<Uint32Array>&
75 : RawSetAsUint32Array(JSContext* cx)
76 : {
77 : if (mType == eUint32Array) {
78 : return mValue.mUint32Array.Value();
79 : }
80 : MOZ_ASSERT(mType == eUninitialized);
81 : mType = eUint32Array;
82 : return mValue.mUint32Array.SetValue(cx);
83 : }
84 :
85 : inline RootedTypedArray<Uint32Array>&
86 : SetAsUint32Array(JSContext* cx)
87 : {
88 : if (mType == eUint32Array) {
89 : return mValue.mUint32Array.Value();
90 : }
91 : Uninit();
92 : mType = eUint32Array;
93 : return mValue.mUint32Array.SetValue(cx);
94 : }
95 :
96 : inline bool
97 0 : IsUint32Array() const
98 : {
99 0 : return mType == eUint32Array;
100 : }
101 :
102 : inline RootedTypedArray<Uint32Array>&
103 : GetAsUint32Array()
104 : {
105 : MOZ_ASSERT(IsUint32Array(), "Wrong type!");
106 : return mValue.mUint32Array.Value();
107 : }
108 :
109 : inline Uint32Array const &
110 0 : GetAsUint32Array() const
111 : {
112 0 : MOZ_ASSERT(IsUint32Array(), "Wrong type!");
113 0 : return mValue.mUint32Array.Value();
114 : }
115 :
116 : inline binding_detail::AutoSequence<uint32_t>&
117 : RawSetAsUnsignedLongSequence()
118 : {
119 : if (mType == eUnsignedLongSequence) {
120 : return mValue.mUnsignedLongSequence.Value();
121 : }
122 : MOZ_ASSERT(mType == eUninitialized);
123 : mType = eUnsignedLongSequence;
124 : return mValue.mUnsignedLongSequence.SetValue();
125 : }
126 :
127 : inline binding_detail::AutoSequence<uint32_t>&
128 : SetAsUnsignedLongSequence()
129 : {
130 : if (mType == eUnsignedLongSequence) {
131 : return mValue.mUnsignedLongSequence.Value();
132 : }
133 : Uninit();
134 : mType = eUnsignedLongSequence;
135 : return mValue.mUnsignedLongSequence.SetValue();
136 : }
137 :
138 : inline bool
139 0 : IsUnsignedLongSequence() const
140 : {
141 0 : return mType == eUnsignedLongSequence;
142 : }
143 :
144 : inline binding_detail::AutoSequence<uint32_t>&
145 : GetAsUnsignedLongSequence()
146 : {
147 : MOZ_ASSERT(IsUnsignedLongSequence(), "Wrong type!");
148 : return mValue.mUnsignedLongSequence.Value();
149 : }
150 :
151 : inline const Sequence<uint32_t>&
152 0 : GetAsUnsignedLongSequence() const
153 : {
154 0 : MOZ_ASSERT(IsUnsignedLongSequence(), "Wrong type!");
155 0 : return mValue.mUnsignedLongSequence.Value();
156 : }
157 :
158 : inline void
159 0 : Uninit()
160 : {
161 0 : switch (mType) {
162 : case eUninitialized: {
163 0 : break;
164 : }
165 : case eUint32Array: {
166 0 : DestroyUint32Array();
167 0 : break;
168 : }
169 : case eUnsignedLongSequence: {
170 0 : DestroyUnsignedLongSequence();
171 0 : break;
172 : }
173 : }
174 0 : }
175 :
176 : bool
177 : ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
178 :
179 : private:
180 : inline void
181 0 : DestroyUint32Array()
182 : {
183 0 : MOZ_ASSERT(IsUint32Array(), "Wrong type!");
184 0 : mValue.mUint32Array.Destroy();
185 0 : mType = eUninitialized;
186 0 : }
187 :
188 : inline void
189 0 : DestroyUnsignedLongSequence()
190 : {
191 0 : MOZ_ASSERT(IsUnsignedLongSequence(), "Wrong type!");
192 0 : mValue.mUnsignedLongSequence.Destroy();
193 0 : mType = eUninitialized;
194 0 : }
195 : };
196 :
197 :
198 : class OwningUint32ArrayOrUnsignedLongSequence : public AllOwningUnionBase
199 : {
200 : friend void ImplCycleCollectionUnlink(OwningUint32ArrayOrUnsignedLongSequence& aUnion);
201 : enum Type
202 : {
203 : eUninitialized,
204 : eUint32Array,
205 : eUnsignedLongSequence
206 : };
207 :
208 : union Value
209 : {
210 : UnionMember<Uint32Array > mUint32Array;
211 : UnionMember<Sequence<uint32_t> > mUnsignedLongSequence;
212 :
213 : };
214 :
215 : Type mType;
216 : Value mValue;
217 :
218 : OwningUint32ArrayOrUnsignedLongSequence(const OwningUint32ArrayOrUnsignedLongSequence&) = delete;
219 : OwningUint32ArrayOrUnsignedLongSequence& operator=(const OwningUint32ArrayOrUnsignedLongSequence&) = delete;
220 : public:
221 : explicit inline OwningUint32ArrayOrUnsignedLongSequence()
222 : : mType(eUninitialized)
223 : {
224 : }
225 :
226 : inline ~OwningUint32ArrayOrUnsignedLongSequence()
227 : {
228 : Uninit();
229 : }
230 :
231 : Uint32Array&
232 : RawSetAsUint32Array();
233 :
234 : Uint32Array&
235 : SetAsUint32Array();
236 :
237 : bool
238 : TrySetToUint32Array(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
239 :
240 : inline bool
241 0 : IsUint32Array() const
242 : {
243 0 : return mType == eUint32Array;
244 : }
245 :
246 : inline Uint32Array&
247 : GetAsUint32Array()
248 : {
249 : MOZ_ASSERT(IsUint32Array(), "Wrong type!");
250 : return mValue.mUint32Array.Value();
251 : }
252 :
253 : inline Uint32Array const &
254 : GetAsUint32Array() const
255 : {
256 : MOZ_ASSERT(IsUint32Array(), "Wrong type!");
257 : return mValue.mUint32Array.Value();
258 : }
259 :
260 : Sequence<uint32_t>&
261 : RawSetAsUnsignedLongSequence();
262 :
263 : Sequence<uint32_t>&
264 : SetAsUnsignedLongSequence();
265 :
266 : bool
267 : TrySetToUnsignedLongSequence(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
268 :
269 : inline bool
270 0 : IsUnsignedLongSequence() const
271 : {
272 0 : return mType == eUnsignedLongSequence;
273 : }
274 :
275 : inline Sequence<uint32_t>&
276 : GetAsUnsignedLongSequence()
277 : {
278 : MOZ_ASSERT(IsUnsignedLongSequence(), "Wrong type!");
279 : return mValue.mUnsignedLongSequence.Value();
280 : }
281 :
282 : inline Sequence<uint32_t> const &
283 : GetAsUnsignedLongSequence() const
284 : {
285 : MOZ_ASSERT(IsUnsignedLongSequence(), "Wrong type!");
286 : return mValue.mUnsignedLongSequence.Value();
287 : }
288 :
289 : void
290 : Uninit();
291 :
292 : bool
293 : ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
294 :
295 : void
296 : TraceUnion(JSTracer* trc);
297 :
298 : private:
299 : void
300 : DestroyUint32Array();
301 :
302 : void
303 : DestroyUnsignedLongSequence();
304 : };
305 :
306 :
307 : namespace EXT_color_buffer_floatBinding {
308 :
309 : typedef mozilla::WebGLExtensionEXTColorBufferFloat NativeType;
310 :
311 : const JSClass*
312 : GetJSClass();
313 :
314 : bool
315 : Wrap(JSContext* aCx, mozilla::WebGLExtensionEXTColorBufferFloat* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
316 :
317 : template <class T>
318 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
319 : {
320 0 : JS::Rooted<JSObject*> reflector(aCx);
321 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
322 : }
323 :
324 : // We declare this as an array so that retrieving a pointer to this
325 : // binding's property hooks only requires compile/link-time resolvable
326 : // address arithmetic. Declaring it as a pointer instead would require
327 : // doing a run-time load to fetch a pointer to this binding's property
328 : // hooks. And then structures which embedded a pointer to this structure
329 : // would require a run-time load for proper initialization, which would
330 : // then induce static constructors. Lots of static constructors.
331 : extern const NativePropertyHooks sNativePropertyHooks[];
332 :
333 : void
334 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
335 :
336 : JS::Handle<JSObject*>
337 : GetProtoObjectHandle(JSContext* aCx);
338 :
339 : } // namespace EXT_color_buffer_floatBinding
340 :
341 :
342 :
343 : namespace WebGL2RenderingContextBinding {
344 :
345 : typedef mozilla::WebGL2Context NativeType;
346 :
347 : bool
348 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
349 :
350 : JSObject*
351 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
352 :
353 : const JSClass*
354 : GetJSClass();
355 :
356 : bool
357 : Wrap(JSContext* aCx, mozilla::WebGL2Context* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
358 :
359 : template <class T>
360 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
361 : {
362 0 : JS::Rooted<JSObject*> reflector(aCx);
363 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
364 : }
365 :
366 : // We declare this as an array so that retrieving a pointer to this
367 : // binding's property hooks only requires compile/link-time resolvable
368 : // address arithmetic. Declaring it as a pointer instead would require
369 : // doing a run-time load to fetch a pointer to this binding's property
370 : // hooks. And then structures which embedded a pointer to this structure
371 : // would require a run-time load for proper initialization, which would
372 : // then induce static constructors. Lots of static constructors.
373 : extern const NativePropertyHooks sNativePropertyHooks[];
374 :
375 : void
376 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
377 :
378 : JS::Handle<JSObject*>
379 : GetProtoObjectHandle(JSContext* aCx);
380 :
381 : JS::Handle<JSObject*>
382 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
383 :
384 : JSObject*
385 : GetConstructorObject(JSContext* aCx);
386 :
387 : } // namespace WebGL2RenderingContextBinding
388 :
389 :
390 :
391 : namespace WebGLSamplerBinding {
392 :
393 : typedef mozilla::WebGLSampler NativeType;
394 :
395 : bool
396 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
397 :
398 : JSObject*
399 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
400 :
401 : const JSClass*
402 : GetJSClass();
403 :
404 : bool
405 : Wrap(JSContext* aCx, mozilla::WebGLSampler* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
406 :
407 : template <class T>
408 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
409 : {
410 0 : JS::Rooted<JSObject*> reflector(aCx);
411 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
412 : }
413 :
414 : // We declare this as an array so that retrieving a pointer to this
415 : // binding's property hooks only requires compile/link-time resolvable
416 : // address arithmetic. Declaring it as a pointer instead would require
417 : // doing a run-time load to fetch a pointer to this binding's property
418 : // hooks. And then structures which embedded a pointer to this structure
419 : // would require a run-time load for proper initialization, which would
420 : // then induce static constructors. Lots of static constructors.
421 : extern const NativePropertyHooks sNativePropertyHooks[];
422 :
423 : void
424 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
425 :
426 : JS::Handle<JSObject*>
427 : GetProtoObjectHandle(JSContext* aCx);
428 :
429 : JS::Handle<JSObject*>
430 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
431 :
432 : JSObject*
433 : GetConstructorObject(JSContext* aCx);
434 :
435 : } // namespace WebGLSamplerBinding
436 :
437 :
438 :
439 : namespace WebGLSyncBinding {
440 :
441 : typedef mozilla::WebGLSync NativeType;
442 :
443 : bool
444 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
445 :
446 : JSObject*
447 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
448 :
449 : const JSClass*
450 : GetJSClass();
451 :
452 : bool
453 : Wrap(JSContext* aCx, mozilla::WebGLSync* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
454 :
455 : template <class T>
456 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
457 : {
458 0 : JS::Rooted<JSObject*> reflector(aCx);
459 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
460 : }
461 :
462 : // We declare this as an array so that retrieving a pointer to this
463 : // binding's property hooks only requires compile/link-time resolvable
464 : // address arithmetic. Declaring it as a pointer instead would require
465 : // doing a run-time load to fetch a pointer to this binding's property
466 : // hooks. And then structures which embedded a pointer to this structure
467 : // would require a run-time load for proper initialization, which would
468 : // then induce static constructors. Lots of static constructors.
469 : extern const NativePropertyHooks sNativePropertyHooks[];
470 :
471 : void
472 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
473 :
474 : JS::Handle<JSObject*>
475 : GetProtoObjectHandle(JSContext* aCx);
476 :
477 : JS::Handle<JSObject*>
478 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
479 :
480 : JSObject*
481 : GetConstructorObject(JSContext* aCx);
482 :
483 : } // namespace WebGLSyncBinding
484 :
485 :
486 :
487 : namespace WebGLTransformFeedbackBinding {
488 :
489 : typedef mozilla::WebGLTransformFeedback NativeType;
490 :
491 : bool
492 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
493 :
494 : JSObject*
495 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
496 :
497 : const JSClass*
498 : GetJSClass();
499 :
500 : bool
501 : Wrap(JSContext* aCx, mozilla::WebGLTransformFeedback* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
502 :
503 : template <class T>
504 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
505 : {
506 0 : JS::Rooted<JSObject*> reflector(aCx);
507 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
508 : }
509 :
510 : // We declare this as an array so that retrieving a pointer to this
511 : // binding's property hooks only requires compile/link-time resolvable
512 : // address arithmetic. Declaring it as a pointer instead would require
513 : // doing a run-time load to fetch a pointer to this binding's property
514 : // hooks. And then structures which embedded a pointer to this structure
515 : // would require a run-time load for proper initialization, which would
516 : // then induce static constructors. Lots of static constructors.
517 : extern const NativePropertyHooks sNativePropertyHooks[];
518 :
519 : void
520 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
521 :
522 : JS::Handle<JSObject*>
523 : GetProtoObjectHandle(JSContext* aCx);
524 :
525 : JS::Handle<JSObject*>
526 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
527 :
528 : JSObject*
529 : GetConstructorObject(JSContext* aCx);
530 :
531 : } // namespace WebGLTransformFeedbackBinding
532 :
533 :
534 :
535 : } // namespace dom
536 : } // namespace mozilla
537 :
538 : #endif // mozilla_dom_WebGL2RenderingContextBinding_h
|