web_sys/features/
gen_XrRenderStateInit.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRRenderStateInit)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `XrRenderStateInit` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type XrRenderStateInit;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "XrWebGlLayer")]
19    #[doc = "Get the `baseLayer` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`, `XrWebGlLayer`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "baseLayer")]
26    pub fn get_base_layer(this: &XrRenderStateInit) -> Option<XrWebGlLayer>;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "XrWebGlLayer")]
29    #[doc = "Change the `baseLayer` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`, `XrWebGlLayer`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "baseLayer")]
36    pub fn set_base_layer(this: &XrRenderStateInit, val: Option<&XrWebGlLayer>);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `depthFar` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "depthFar")]
45    pub fn get_depth_far(this: &XrRenderStateInit) -> Option<f64>;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `depthFar` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "depthFar")]
54    pub fn set_depth_far(this: &XrRenderStateInit, val: f64);
55    #[cfg(web_sys_unstable_apis)]
56    #[doc = "Get the `depthNear` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, getter = "depthNear")]
63    pub fn get_depth_near(this: &XrRenderStateInit) -> Option<f64>;
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Change the `depthNear` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "depthNear")]
72    pub fn set_depth_near(this: &XrRenderStateInit, val: f64);
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Get the `inlineVerticalFieldOfView` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, getter = "inlineVerticalFieldOfView")]
81    pub fn get_inline_vertical_field_of_view(this: &XrRenderStateInit) -> Option<f64>;
82    #[cfg(web_sys_unstable_apis)]
83    #[doc = "Change the `inlineVerticalFieldOfView` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    #[wasm_bindgen(method, setter = "inlineVerticalFieldOfView")]
90    pub fn set_inline_vertical_field_of_view(this: &XrRenderStateInit, val: f64);
91    #[cfg(web_sys_unstable_apis)]
92    #[doc = "Get the `layers` field of this object."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
95    #[doc = ""]
96    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98    #[wasm_bindgen(method, getter = "layers")]
99    pub fn get_layers(this: &XrRenderStateInit) -> Option<::js_sys::Array>;
100    #[cfg(web_sys_unstable_apis)]
101    #[doc = "Change the `layers` field of this object."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
104    #[doc = ""]
105    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107    #[wasm_bindgen(method, setter = "layers")]
108    pub fn set_layers(this: &XrRenderStateInit, val: &::wasm_bindgen::JsValue);
109}
110#[cfg(web_sys_unstable_apis)]
111impl XrRenderStateInit {
112    #[doc = "Construct a new `XrRenderStateInit`."]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
115    #[doc = ""]
116    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
117    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
118    pub fn new() -> Self {
119        #[allow(unused_mut)]
120        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
121        ret
122    }
123    #[cfg(web_sys_unstable_apis)]
124    #[cfg(feature = "XrWebGlLayer")]
125    #[deprecated = "Use `set_base_layer()` instead."]
126    pub fn base_layer(&mut self, val: Option<&XrWebGlLayer>) -> &mut Self {
127        self.set_base_layer(val);
128        self
129    }
130    #[cfg(web_sys_unstable_apis)]
131    #[deprecated = "Use `set_depth_far()` instead."]
132    pub fn depth_far(&mut self, val: f64) -> &mut Self {
133        self.set_depth_far(val);
134        self
135    }
136    #[cfg(web_sys_unstable_apis)]
137    #[deprecated = "Use `set_depth_near()` instead."]
138    pub fn depth_near(&mut self, val: f64) -> &mut Self {
139        self.set_depth_near(val);
140        self
141    }
142    #[cfg(web_sys_unstable_apis)]
143    #[deprecated = "Use `set_inline_vertical_field_of_view()` instead."]
144    pub fn inline_vertical_field_of_view(&mut self, val: f64) -> &mut Self {
145        self.set_inline_vertical_field_of_view(val);
146        self
147    }
148    #[cfg(web_sys_unstable_apis)]
149    #[deprecated = "Use `set_layers()` instead."]
150    pub fn layers(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self {
151        self.set_layers(val.unwrap_or(&::wasm_bindgen::JsValue::NULL));
152        self
153    }
154}
155#[cfg(web_sys_unstable_apis)]
156impl Default for XrRenderStateInit {
157    fn default() -> Self {
158        Self::new()
159    }
160}