script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
OESTextureHalfFloatBinding.rs

1/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
2
3#![allow(non_camel_case_types,non_upper_case_globals,unsafe_op_in_unsafe_fn,unused_imports,unused_variables,unused_assignments,unused_mut,clippy::approx_constant,clippy::enum_variant_names,clippy::let_unit_value,clippy::needless_return,clippy::too_many_arguments,clippy::unnecessary_cast,clippy::upper_case_acronyms)]
4
5use crate::import::base::*;
6
7pub use self::OESTextureHalfFloat_Binding::{OESTextureHalfFloatConstants, Wrap, GetProtoObject};
8pub mod OESTextureHalfFloat_Binding {
9use crate::import::module::*;
10
11unsafe extern "C" fn _finalize<D: DomTypes>
12(_cx: *mut GCContext, obj: *mut JSObject){
13    wrap_panic(&mut || {
14
15        let this = native_from_object_static::<D::OESTextureHalfFloat>(obj).unwrap();
16        finalize_common(this);
17    })
18}
19
20unsafe extern "C" fn _trace<D: DomTypes>
21(trc: *mut JSTracer, obj: *mut JSObject){
22    wrap_panic(&mut || {
23
24        let this = native_from_object_static::<D::OESTextureHalfFloat>(obj).unwrap();
25        if this.is_null() { return; } // GC during obj creation
26        (*this).trace(trc);
27    })
28}
29
30pub mod OESTextureHalfFloatConstants {
31    pub const HALF_FLOAT_OES: u32 = 36193;
32} // mod OESTextureHalfFloatConstants
33
34static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
35
36pub(crate) fn init_class_ops<D: DomTypes>() {
37    CLASS_OPS.set(JSClassOps {
38        addProperty: None,
39        delProperty: None,
40        enumerate: None,
41        newEnumerate: None,
42        resolve: None,
43        mayResolve: None,
44        finalize: Some(_finalize::<D>),
45        call: None,
46        construct: None,
47        trace: Some(_trace::<D>),
48    });
49}
50
51pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
52
53pub(crate) fn init_domjs_class<D: DomTypes>() {
54    init_class_ops::<D>();
55    Class.set(DOMJSClass {
56        base: JSClass {
57            name: c"OESTextureHalfFloat".as_ptr(),
58            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
59                   (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
60                   /* JSCLASS_HAS_RESERVED_SLOTS(1) */,
61            cOps: unsafe { CLASS_OPS.get() },
62            spec: ptr::null(),
63            ext: ptr::null(),
64            oOps: ptr::null(),
65        },
66        dom_class:
67DOMClass {
68    interface_chain: [ PrototypeList::ID::OESTextureHalfFloat, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
69    depth: 0,
70    type_id: crate::codegen::InheritTypes::TopTypeId { alone: () },
71    malloc_size_of: malloc_size_of_including_raw_self::<D::OESTextureHalfFloat> as unsafe fn(&mut _, _) -> _,
72    global: Globals::EMPTY,
73},
74    });
75}
76
77#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
78(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::OESTextureHalfFloat>, _can_gc: CanGc) -> DomRoot<D::OESTextureHalfFloat>{
79
80    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
81
82    let scope = scope.reflector().get_jsobject();
83    assert!(!scope.get().is_null());
84    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
85    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
86
87    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
88    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
89    assert!(!canonical_proto.is_null());
90
91
92    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
93    if let Some(given) = given_proto {
94        proto.set(*given);
95        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
96            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
97        }
98    } else {
99        proto.set(*canonical_proto);
100    }
101    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
102        cx.raw_cx(),
103        &Class.get().base,
104        proto.handle(),
105    ));
106    assert!(!obj.is_null());
107    JS_SetReservedSlot(
108        obj.get(),
109        DOM_OBJECT_SLOT,
110        &PrivateValue(raw.as_ptr() as *const libc::c_void),
111    );
112
113    let root = raw.reflect_with(obj.get());
114
115
116
117    DomRoot::from_ref(&*root)
118}
119
120pub trait OESTextureHalfFloatMethods<D: DomTypes> {
121}
122static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
123
124pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
125    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
126    JSPropertySpec {
127                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
128                    attributes_: (JSPROP_READONLY),
129                    kind_: (JSPropertySpec_Kind::Value),
130                    u: JSPropertySpec_AccessorsOrValue {
131                        value: JSPropertySpec_ValueWrapper {
132                            type_: JSPropertySpec_ValueWrapper_Type::String,
133                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
134                                string: c"OESTextureHalfFloat".as_ptr(),
135                            }
136                        }
137                    }
138                }
139,
140    JSPropertySpec::ZERO]))[..]
141])));
142}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
143
144pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
145    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[0])])));
146}static sConstants_specs: ThreadUnsafeOnceLock<&[&[ConstantSpec]]> = ThreadUnsafeOnceLock::new();
147
148pub(crate) fn init_sConstants_specs<D: DomTypes>() {
149    sConstants_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
150    ConstantSpec { name: c"HALF_FLOAT_OES", value: ConstantVal::Uint(36193) }]))[..]
151])));
152}static sConstants: ThreadUnsafeOnceLock<&[Guard<&[ConstantSpec]>]> = ThreadUnsafeOnceLock::new();
153
154pub(crate) fn init_sConstants_prefs<D: DomTypes>() {
155    sConstants.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sConstants_specs.get() })[0])])));
156}
157pub fn GetProtoObject<D: DomTypes>
158(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
159    /* Get the interface prototype object for this class.  This will create the
160       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::OESTextureHalfFloat), CreateInterfaceObjects::<D>, rval)
161}
162
163
164static PrototypeClass: JSClass = JSClass {
165    name: c"OESTextureHalfFloatPrototype".as_ptr(),
166    flags:
167        // JSCLASS_HAS_RESERVED_SLOTS()
168        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
169    cOps: ptr::null(),
170    spec: ptr::null(),
171    ext: ptr::null(),
172    oOps: ptr::null(),
173};
174
175unsafe fn CreateInterfaceObjects<D: DomTypes>
176(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
177
178    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
179    prototype_proto.set(GetRealmObjectPrototype(cx.raw_cx()));
180    assert!(!prototype_proto.is_null());
181
182    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
183    create_interface_prototype_object::<D>(cx,
184                                      global,
185                                      prototype_proto.handle(),
186                                      &PrototypeClass,
187                                      &[],
188                                      sAttributes.get(),
189                                      sConstants.get(),
190                                      &[],
191                                      prototype.handle_mut());
192    assert!(!prototype.is_null());
193    assert!((*cache)[PrototypeList::ID::OESTextureHalfFloat as usize].is_null());
194    (*cache)[PrototypeList::ID::OESTextureHalfFloat as usize] = prototype.get();
195    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::OESTextureHalfFloat as isize),
196                                  ptr::null_mut(),
197                                  prototype.get());
198
199}
200
201
202        pub(crate) fn init_statics<D: DomTypes>() {
203
204            init_domjs_class::<D>();
205
206
207
208
209            init_sAttributes_specs::<D>();
210init_sAttributes_prefs::<D>();
211init_sConstants_specs::<D>();
212init_sConstants_prefs::<D>();
213        }
214        } // mod OESTextureHalfFloat_Binding
215
216