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