1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
use super::*;
/// The VTTRegion class.
/// [`VTTRegion`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct VTTRegion {
inner: Any,
}
impl FromVal for VTTRegion {
fn from_val(v: &Any) -> Self {
VTTRegion {
inner: Any::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for VTTRegion {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for VTTRegion {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for VTTRegion {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for VTTRegion {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<VTTRegion> for Any {
fn from(s: VTTRegion) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&VTTRegion> for Any {
fn from(s: &VTTRegion) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(VTTRegion);
impl VTTRegion {
/// Getter of the `id` attribute.
/// [`VTTRegion.id`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/id)
pub fn id(&self) -> JsString {
self.inner.get("id").as_::<JsString>()
}
/// Setter of the `id` attribute.
/// [`VTTRegion.id`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/id)
pub fn set_id(&mut self, value: &JsString) {
self.inner.set("id", value);
}
}
impl VTTRegion {
/// Getter of the `width` attribute.
/// [`VTTRegion.width`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/width)
pub fn width(&self) -> f64 {
self.inner.get("width").as_::<f64>()
}
/// Setter of the `width` attribute.
/// [`VTTRegion.width`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/width)
pub fn set_width(&mut self, value: f64) {
self.inner.set("width", value);
}
}
impl VTTRegion {
/// Getter of the `lines` attribute.
/// [`VTTRegion.lines`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/lines)
pub fn lines(&self) -> u32 {
self.inner.get("lines").as_::<u32>()
}
/// Setter of the `lines` attribute.
/// [`VTTRegion.lines`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/lines)
pub fn set_lines(&mut self, value: u32) {
self.inner.set("lines", value);
}
}
impl VTTRegion {
/// Getter of the `regionAnchorX` attribute.
/// [`VTTRegion.regionAnchorX`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/regionAnchorX)
pub fn region_anchor_x(&self) -> f64 {
self.inner.get("regionAnchorX").as_::<f64>()
}
/// Setter of the `regionAnchorX` attribute.
/// [`VTTRegion.regionAnchorX`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/regionAnchorX)
pub fn set_region_anchor_x(&mut self, value: f64) {
self.inner.set("regionAnchorX", value);
}
}
impl VTTRegion {
/// Getter of the `regionAnchorY` attribute.
/// [`VTTRegion.regionAnchorY`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/regionAnchorY)
pub fn region_anchor_y(&self) -> f64 {
self.inner.get("regionAnchorY").as_::<f64>()
}
/// Setter of the `regionAnchorY` attribute.
/// [`VTTRegion.regionAnchorY`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/regionAnchorY)
pub fn set_region_anchor_y(&mut self, value: f64) {
self.inner.set("regionAnchorY", value);
}
}
impl VTTRegion {
/// Getter of the `viewportAnchorX` attribute.
/// [`VTTRegion.viewportAnchorX`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/viewportAnchorX)
pub fn viewport_anchor_x(&self) -> f64 {
self.inner.get("viewportAnchorX").as_::<f64>()
}
/// Setter of the `viewportAnchorX` attribute.
/// [`VTTRegion.viewportAnchorX`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/viewportAnchorX)
pub fn set_viewport_anchor_x(&mut self, value: f64) {
self.inner.set("viewportAnchorX", value);
}
}
impl VTTRegion {
/// Getter of the `viewportAnchorY` attribute.
/// [`VTTRegion.viewportAnchorY`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/viewportAnchorY)
pub fn viewport_anchor_y(&self) -> f64 {
self.inner.get("viewportAnchorY").as_::<f64>()
}
/// Setter of the `viewportAnchorY` attribute.
/// [`VTTRegion.viewportAnchorY`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/viewportAnchorY)
pub fn set_viewport_anchor_y(&mut self, value: f64) {
self.inner.set("viewportAnchorY", value);
}
}
impl VTTRegion {
/// Getter of the `scroll` attribute.
/// [`VTTRegion.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/scroll)
pub fn scroll(&self) -> ScrollSetting {
self.inner.get("scroll").as_::<ScrollSetting>()
}
/// Setter of the `scroll` attribute.
/// [`VTTRegion.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/scroll)
pub fn set_scroll(&mut self, value: &ScrollSetting) {
self.inner.set("scroll", value);
}
}
impl VTTRegion {
/// The `new VTTRegion(..)` constructor, creating a new VTTRegion instance
pub fn new() -> VTTRegion {
Self {
inner: Any::global("VTTRegion").new(&[]).as_::<Any>(),
}
}
}