1 module libwasm.bindings.DeviceMotionEvent;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.Event;
7 
8 @safe:
9 nothrow:
10 
11 struct DeviceAcceleration {
12   nothrow:
13   JsHandle handle;
14   alias handle this;
15   this(Handle h) {
16     this.handle = JsHandle(h);
17   }
18   Optional!(double) x()() {
19     return Object_Getter__OptionalDouble(this.handle, "x");
20   }
21   Optional!(double) y()() {
22     return Object_Getter__OptionalDouble(this.handle, "y");
23   }
24   Optional!(double) z()() {
25     return Object_Getter__OptionalDouble(this.handle, "z");
26   }
27 }
28 struct DeviceAccelerationInit {
29   nothrow:
30   JsHandle handle;
31   alias handle this;
32   this(Handle h) {
33     this.handle = JsHandle(h);
34   }
35   static auto create() {
36     return DeviceAccelerationInit(libwasm_add__object());
37   }
38   void x(T0)(scope auto ref Optional!(T0) x) if (isTOrPointer!(T0, double)) {
39     Serialize_Object_VarArgCall!void(this.handle, "x", "Optional!(double)", tuple(!x.empty, x.front));
40   }
41   Optional!(double) x()() {
42     return Object_Getter__OptionalDouble(this.handle, "x");
43   }
44   void y(T0)(scope auto ref Optional!(T0) y) if (isTOrPointer!(T0, double)) {
45     Serialize_Object_VarArgCall!void(this.handle, "y", "Optional!(double)", tuple(!y.empty, y.front));
46   }
47   Optional!(double) y()() {
48     return Object_Getter__OptionalDouble(this.handle, "y");
49   }
50   void z(T0)(scope auto ref Optional!(T0) z) if (isTOrPointer!(T0, double)) {
51     Serialize_Object_VarArgCall!void(this.handle, "z", "Optional!(double)", tuple(!z.empty, z.front));
52   }
53   Optional!(double) z()() {
54     return Object_Getter__OptionalDouble(this.handle, "z");
55   }
56 }
57 struct DeviceMotionEvent {
58   nothrow:
59   libwasm.bindings.Event.Event _parent;
60   alias _parent this;
61   this(Handle h) {
62     _parent = .Event(h);
63   }
64   auto acceleration()() {
65     return recastOpt!(DeviceAcceleration)(Object_Getter__OptionalHandle(this._parent, "acceleration"));
66   }
67   auto accelerationIncludingGravity()() {
68     return recastOpt!(DeviceAcceleration)(Object_Getter__OptionalHandle(this._parent, "accelerationIncludingGravity"));
69   }
70   auto rotationRate()() {
71     return recastOpt!(DeviceRotationRate)(Object_Getter__OptionalHandle(this._parent, "rotationRate"));
72   }
73   Optional!(double) interval()() {
74     return Object_Getter__OptionalDouble(this._parent, "interval");
75   }
76   void initDeviceMotionEvent(T6)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope ref DeviceAccelerationInit acceleration, scope ref DeviceAccelerationInit accelerationIncludingGravity, scope ref DeviceRotationRateInit rotationRate, scope auto ref Optional!(T6) interval /* = no!(double) */) if (isTOrPointer!(T6, double)) {
77     Serialize_Object_VarArgCall!void(this._parent, "initDeviceMotionEvent", "string;bool;bool;Handle;Handle;Handle;Optional!(double)", tuple(type, canBubble, cancelable, cast(Handle)acceleration.handle, cast(Handle)accelerationIncludingGravity.handle, cast(Handle)rotationRate.handle, !interval.empty, interval.front));
78   }
79   void initDeviceMotionEvent()(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope ref DeviceAccelerationInit acceleration, scope ref DeviceAccelerationInit accelerationIncludingGravity, scope ref DeviceRotationRateInit rotationRate) {
80     Serialize_Object_VarArgCall!void(this._parent, "initDeviceMotionEvent", "string;bool;bool;Handle;Handle;Handle", tuple(type, canBubble, cancelable, cast(Handle)acceleration.handle, cast(Handle)accelerationIncludingGravity.handle, cast(Handle)rotationRate.handle));
81   }
82   void initDeviceMotionEvent()(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope ref DeviceAccelerationInit acceleration, scope ref DeviceAccelerationInit accelerationIncludingGravity) {
83     Serialize_Object_VarArgCall!void(this._parent, "initDeviceMotionEvent", "string;bool;bool;Handle;Handle", tuple(type, canBubble, cancelable, cast(Handle)acceleration.handle, cast(Handle)accelerationIncludingGravity.handle));
84   }
85   void initDeviceMotionEvent()(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope ref DeviceAccelerationInit acceleration) {
86     Serialize_Object_VarArgCall!void(this._parent, "initDeviceMotionEvent", "string;bool;bool;Handle", tuple(type, canBubble, cancelable, cast(Handle)acceleration.handle));
87   }
88   void initDeviceMotionEvent()(string type, bool canBubble /* = false */, bool cancelable /* = false */) {
89     Serialize_Object_VarArgCall!void(this._parent, "initDeviceMotionEvent", "string;bool;bool", tuple(type, canBubble, cancelable));
90   }
91   void initDeviceMotionEvent()(string type, bool canBubble /* = false */) {
92     Serialize_Object_VarArgCall!void(this._parent, "initDeviceMotionEvent", "string;bool", tuple(type, canBubble));
93   }
94   void initDeviceMotionEvent()(string type) {
95     Object_Call_string__void(this._parent, "initDeviceMotionEvent", type);
96   }
97 }
98 struct DeviceMotionEventInit {
99   nothrow:
100   libwasm.bindings.Event.EventInit _parent;
101   alias _parent this;
102   this(Handle h) {
103     _parent = .EventInit(h);
104   }
105   static auto create() {
106     return DeviceMotionEventInit(libwasm_add__object());
107   }
108   void acceleration()(scope ref DeviceAccelerationInit acceleration) {
109     Object_Call_Handle__void(this._parent, "acceleration", acceleration.handle);
110   }
111   auto acceleration()() {
112     return DeviceAccelerationInit(Object_Getter__Handle(this._parent, "acceleration"));
113   }
114   void accelerationIncludingGravity()(scope ref DeviceAccelerationInit accelerationIncludingGravity) {
115     Object_Call_Handle__void(this._parent, "accelerationIncludingGravity", accelerationIncludingGravity.handle);
116   }
117   auto accelerationIncludingGravity()() {
118     return DeviceAccelerationInit(Object_Getter__Handle(this._parent, "accelerationIncludingGravity"));
119   }
120   void rotationRate()(scope ref DeviceRotationRateInit rotationRate) {
121     Object_Call_Handle__void(this._parent, "rotationRate", rotationRate.handle);
122   }
123   auto rotationRate()() {
124     return DeviceRotationRateInit(Object_Getter__Handle(this._parent, "rotationRate"));
125   }
126   void interval(T0)(scope auto ref Optional!(T0) interval) if (isTOrPointer!(T0, double)) {
127     Serialize_Object_VarArgCall!void(this._parent, "interval", "Optional!(double)", tuple(!interval.empty, interval.front));
128   }
129   Optional!(double) interval()() {
130     return Object_Getter__OptionalDouble(this._parent, "interval");
131   }
132 }
133 struct DeviceRotationRate {
134   nothrow:
135   JsHandle handle;
136   alias handle this;
137   this(Handle h) {
138     this.handle = JsHandle(h);
139   }
140   Optional!(double) alpha()() {
141     return Object_Getter__OptionalDouble(this.handle, "alpha");
142   }
143   Optional!(double) beta()() {
144     return Object_Getter__OptionalDouble(this.handle, "beta");
145   }
146   Optional!(double) gamma()() {
147     return Object_Getter__OptionalDouble(this.handle, "gamma");
148   }
149 }
150 struct DeviceRotationRateInit {
151   nothrow:
152   JsHandle handle;
153   alias handle this;
154   this(Handle h) {
155     this.handle = JsHandle(h);
156   }
157   static auto create() {
158     return DeviceRotationRateInit(libwasm_add__object());
159   }
160   void alpha(T0)(scope auto ref Optional!(T0) alpha) if (isTOrPointer!(T0, double)) {
161     Serialize_Object_VarArgCall!void(this.handle, "alpha", "Optional!(double)", tuple(!alpha.empty, alpha.front));
162   }
163   Optional!(double) alpha()() {
164     return Object_Getter__OptionalDouble(this.handle, "alpha");
165   }
166   void beta(T0)(scope auto ref Optional!(T0) beta) if (isTOrPointer!(T0, double)) {
167     Serialize_Object_VarArgCall!void(this.handle, "beta", "Optional!(double)", tuple(!beta.empty, beta.front));
168   }
169   Optional!(double) beta()() {
170     return Object_Getter__OptionalDouble(this.handle, "beta");
171   }
172   void gamma(T0)(scope auto ref Optional!(T0) gamma) if (isTOrPointer!(T0, double)) {
173     Serialize_Object_VarArgCall!void(this.handle, "gamma", "Optional!(double)", tuple(!gamma.empty, gamma.front));
174   }
175   Optional!(double) gamma()() {
176     return Object_Getter__OptionalDouble(this.handle, "gamma");
177   }
178 }
179 
180