maxcountryman_web_sys/features/
gen_XrInputSourceEventInit.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRInputSourceEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `XrInputSourceEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type XrInputSourceEventInit;
16}
17#[cfg(web_sys_unstable_apis)]
18impl XrInputSourceEventInit {
19 #[cfg(all(feature = "XrFrame", feature = "XrInputSource",))]
20 #[doc = "Construct a new `XrInputSourceEventInit`."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrInputSource`, `XrInputSourceEventInit`*"]
23 #[doc = ""]
24 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
26 pub fn new(frame: &XrFrame, input_source: &XrInputSource) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.frame(frame);
30 ret.input_source(input_source);
31 ret
32 }
33 #[cfg(web_sys_unstable_apis)]
34 #[doc = "Change the `bubbles` field of this object."]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"]
37 #[doc = ""]
38 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
40 pub fn bubbles(&mut self, val: bool) -> &mut Self {
41 use wasm_bindgen::JsValue;
42 let r = ::js_sys::Reflect::set(
43 self.as_ref(),
44 &JsValue::from("bubbles"),
45 &JsValue::from(val),
46 );
47 debug_assert!(
48 r.is_ok(),
49 "setting properties should never fail on our dictionary objects"
50 );
51 let _ = r;
52 self
53 }
54 #[cfg(web_sys_unstable_apis)]
55 #[doc = "Change the `cancelable` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"]
58 #[doc = ""]
59 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
60 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
61 pub fn cancelable(&mut self, val: bool) -> &mut Self {
62 use wasm_bindgen::JsValue;
63 let r = ::js_sys::Reflect::set(
64 self.as_ref(),
65 &JsValue::from("cancelable"),
66 &JsValue::from(val),
67 );
68 debug_assert!(
69 r.is_ok(),
70 "setting properties should never fail on our dictionary objects"
71 );
72 let _ = r;
73 self
74 }
75 #[cfg(web_sys_unstable_apis)]
76 #[doc = "Change the `composed` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"]
79 #[doc = ""]
80 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 pub fn composed(&mut self, val: bool) -> &mut Self {
83 use wasm_bindgen::JsValue;
84 let r = ::js_sys::Reflect::set(
85 self.as_ref(),
86 &JsValue::from("composed"),
87 &JsValue::from(val),
88 );
89 debug_assert!(
90 r.is_ok(),
91 "setting properties should never fail on our dictionary objects"
92 );
93 let _ = r;
94 self
95 }
96 #[cfg(web_sys_unstable_apis)]
97 #[cfg(feature = "XrFrame")]
98 #[doc = "Change the `frame` field of this object."]
99 #[doc = ""]
100 #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrInputSourceEventInit`*"]
101 #[doc = ""]
102 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
103 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
104 pub fn frame(&mut self, val: &XrFrame) -> &mut Self {
105 use wasm_bindgen::JsValue;
106 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("frame"), &JsValue::from(val));
107 debug_assert!(
108 r.is_ok(),
109 "setting properties should never fail on our dictionary objects"
110 );
111 let _ = r;
112 self
113 }
114 #[cfg(web_sys_unstable_apis)]
115 #[cfg(feature = "XrInputSource")]
116 #[doc = "Change the `inputSource` field of this object."]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `XrInputSource`, `XrInputSourceEventInit`*"]
119 #[doc = ""]
120 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122 pub fn input_source(&mut self, val: &XrInputSource) -> &mut Self {
123 use wasm_bindgen::JsValue;
124 let r = ::js_sys::Reflect::set(
125 self.as_ref(),
126 &JsValue::from("inputSource"),
127 &JsValue::from(val),
128 );
129 debug_assert!(
130 r.is_ok(),
131 "setting properties should never fail on our dictionary objects"
132 );
133 let _ = r;
134 self
135 }
136}