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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
use super::*;
/// The DOMQuad class.
/// [`DOMQuad`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct DOMQuad {
inner: Any,
}
impl FromVal for DOMQuad {
fn from_val(v: &Any) -> Self {
DOMQuad {
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 DOMQuad {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for DOMQuad {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for DOMQuad {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for DOMQuad {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<DOMQuad> for Any {
fn from(s: DOMQuad) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&DOMQuad> for Any {
fn from(s: &DOMQuad) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(DOMQuad);
impl DOMQuad {
/// Getter of the `p1` attribute.
/// [`DOMQuad.p1`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/p1)
pub fn p1(&self) -> DOMPoint {
self.inner.get("p1").as_::<DOMPoint>()
}
}
impl DOMQuad {
/// Getter of the `p2` attribute.
/// [`DOMQuad.p2`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/p2)
pub fn p2(&self) -> DOMPoint {
self.inner.get("p2").as_::<DOMPoint>()
}
}
impl DOMQuad {
/// Getter of the `p3` attribute.
/// [`DOMQuad.p3`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/p3)
pub fn p3(&self) -> DOMPoint {
self.inner.get("p3").as_::<DOMPoint>()
}
}
impl DOMQuad {
/// Getter of the `p4` attribute.
/// [`DOMQuad.p4`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/p4)
pub fn p4(&self) -> DOMPoint {
self.inner.get("p4").as_::<DOMPoint>()
}
}
impl DOMQuad {
/// The `new DOMQuad(..)` constructor, creating a new DOMQuad instance
pub fn new() -> DOMQuad {
Self {
inner: Any::global("DOMQuad").new(&[]).as_::<Any>(),
}
}
}
impl DOMQuad {
/// The `new DOMQuad(..)` constructor, creating a new DOMQuad instance
pub fn new_with_p1(p1: &DOMPointInit) -> DOMQuad {
Self {
inner: Any::global("DOMQuad").new(&[p1.into()]).as_::<Any>(),
}
}
}
impl DOMQuad {
/// The `new DOMQuad(..)` constructor, creating a new DOMQuad instance
pub fn new_with_p1_and_p2(p1: &DOMPointInit, p2: &DOMPointInit) -> DOMQuad {
Self {
inner: Any::global("DOMQuad")
.new(&[p1.into(), p2.into()])
.as_::<Any>(),
}
}
}
impl DOMQuad {
/// The `new DOMQuad(..)` constructor, creating a new DOMQuad instance
pub fn new_with_p1_and_p2_and_p3(
p1: &DOMPointInit,
p2: &DOMPointInit,
p3: &DOMPointInit,
) -> DOMQuad {
Self {
inner: Any::global("DOMQuad")
.new(&[p1.into(), p2.into(), p3.into()])
.as_::<Any>(),
}
}
}
impl DOMQuad {
/// The `new DOMQuad(..)` constructor, creating a new DOMQuad instance
pub fn new_with_p1_and_p2_and_p3_and_p4(
p1: &DOMPointInit,
p2: &DOMPointInit,
p3: &DOMPointInit,
p4: &DOMPointInit,
) -> DOMQuad {
Self {
inner: Any::global("DOMQuad")
.new(&[p1.into(), p2.into(), p3.into(), p4.into()])
.as_::<Any>(),
}
}
}
impl DOMQuad {
/// The fromRect method.
/// [`DOMQuad.fromRect`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/fromRect)
pub fn from_rect() -> DOMQuad {
Any::global("DOMQuad")
.call("fromRect", &[])
.as_::<DOMQuad>()
}
}
impl DOMQuad {
/// The fromRect method.
/// [`DOMQuad.fromRect`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/fromRect)
pub fn from_rect_with_other(other: &DOMRectInit) -> DOMQuad {
Any::global("DOMQuad")
.call("fromRect", &[other.into()])
.as_::<DOMQuad>()
}
}
impl DOMQuad {
/// The fromQuad method.
/// [`DOMQuad.fromQuad`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/fromQuad)
pub fn from_quad() -> DOMQuad {
Any::global("DOMQuad")
.call("fromQuad", &[])
.as_::<DOMQuad>()
}
}
impl DOMQuad {
/// The fromQuad method.
/// [`DOMQuad.fromQuad`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/fromQuad)
pub fn from_quad_with_other(other: &DOMQuadInit) -> DOMQuad {
Any::global("DOMQuad")
.call("fromQuad", &[other.into()])
.as_::<DOMQuad>()
}
}
impl DOMQuad {
/// The getBounds method.
/// [`DOMQuad.getBounds`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/getBounds)
pub fn get_bounds(&self) -> DOMRect {
self.inner.call("getBounds", &[]).as_::<DOMRect>()
}
}
impl DOMQuad {
/// The toJSON method.
/// [`DOMQuad.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad/toJSON)
pub fn to_json(&self) -> Object {
self.inner.call("toJSON", &[]).as_::<Object>()
}
}