1 module libwasm.bindings.TouchEvent; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 import libwasm.bindings.Touch; 7 import libwasm.bindings.TouchList; 8 import libwasm.bindings.UIEvent; 9 import libwasm.bindings.Window; 10 11 @safe: 12 nothrow: 13 14 struct TouchEvent { 15 nothrow: 16 libwasm.bindings.UIEvent.UIEvent _parent; 17 alias _parent this; 18 this(Handle h) { 19 _parent = .UIEvent(h); 20 } 21 auto touches()() { 22 return TouchList(Object_Getter__Handle(this._parent, "touches")); 23 } 24 auto targetTouches()() { 25 return TouchList(Object_Getter__Handle(this._parent, "targetTouches")); 26 } 27 auto changedTouches()() { 28 return TouchList(Object_Getter__Handle(this._parent, "changedTouches")); 29 } 30 bool altKey()() { 31 return Object_Getter__bool(this._parent, "altKey"); 32 } 33 bool metaKey()() { 34 return Object_Getter__bool(this._parent, "metaKey"); 35 } 36 bool ctrlKey()() { 37 return Object_Getter__bool(this._parent, "ctrlKey"); 38 } 39 bool shiftKey()() { 40 return Object_Getter__bool(this._parent, "shiftKey"); 41 } 42 void initTouchEvent(T3, T9, T10, T11)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */, bool altKey /* = false */, bool shiftKey /* = false */, bool metaKey /* = false */, scope auto ref Optional!(T9) touches /* = no!(TouchList) */, scope auto ref Optional!(T10) targetTouches /* = no!(TouchList) */, scope auto ref Optional!(T11) changedTouches /* = no!(TouchList) */) if (isTOrPointer!(T3, Window) && isTOrPointer!(T9, TouchList) && isTOrPointer!(T10, TouchList) && isTOrPointer!(T11, TouchList)) { 43 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool;bool;bool;bool;Optional!Handle;Optional!Handle;Optional!Handle", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey, altKey, shiftKey, metaKey, !touches.empty, cast(Handle)touches.front.handle, !targetTouches.empty, cast(Handle)targetTouches.front.handle, !changedTouches.empty, cast(Handle)changedTouches.front.handle)); 44 } 45 void initTouchEvent(T3, T9, T10)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */, bool altKey /* = false */, bool shiftKey /* = false */, bool metaKey /* = false */, scope auto ref Optional!(T9) touches /* = no!(TouchList) */, scope auto ref Optional!(T10) targetTouches /* = no!(TouchList) */) if (isTOrPointer!(T3, Window) && isTOrPointer!(T9, TouchList) && isTOrPointer!(T10, TouchList)) { 46 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool;bool;bool;bool;Optional!Handle;Optional!Handle", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey, altKey, shiftKey, metaKey, !touches.empty, cast(Handle)touches.front.handle, !targetTouches.empty, cast(Handle)targetTouches.front.handle)); 47 } 48 void initTouchEvent(T3, T9)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */, bool altKey /* = false */, bool shiftKey /* = false */, bool metaKey /* = false */, scope auto ref Optional!(T9) touches /* = no!(TouchList) */) if (isTOrPointer!(T3, Window) && isTOrPointer!(T9, TouchList)) { 49 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool;bool;bool;bool;Optional!Handle", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey, altKey, shiftKey, metaKey, !touches.empty, cast(Handle)touches.front.handle)); 50 } 51 void initTouchEvent(T3)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */, bool altKey /* = false */, bool shiftKey /* = false */, bool metaKey /* = false */) if (isTOrPointer!(T3, Window)) { 52 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool;bool;bool;bool", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey, altKey, shiftKey, metaKey)); 53 } 54 void initTouchEvent(T3)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */, bool altKey /* = false */, bool shiftKey /* = false */) if (isTOrPointer!(T3, Window)) { 55 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool;bool;bool", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey, altKey, shiftKey)); 56 } 57 void initTouchEvent(T3)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */, bool altKey /* = false */) if (isTOrPointer!(T3, Window)) { 58 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool;bool", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey, altKey)); 59 } 60 void initTouchEvent(T3)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */, bool ctrlKey /* = false */) if (isTOrPointer!(T3, Window)) { 61 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int;bool", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail, ctrlKey)); 62 } 63 void initTouchEvent(T3)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */, int detail /* = 0 */) if (isTOrPointer!(T3, Window)) { 64 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle;int", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent, detail)); 65 } 66 void initTouchEvent(T3)(string type, bool canBubble /* = false */, bool cancelable /* = false */, scope auto ref Optional!(T3) view /* = no!(Window) */) if (isTOrPointer!(T3, Window)) { 67 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool;Optional!Handle", tuple(type, canBubble, cancelable, !view.empty, cast(Handle)view.front._parent)); 68 } 69 void initTouchEvent()(string type, bool canBubble /* = false */, bool cancelable /* = false */) { 70 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool;bool", tuple(type, canBubble, cancelable)); 71 } 72 void initTouchEvent()(string type, bool canBubble /* = false */) { 73 Serialize_Object_VarArgCall!void(this._parent, "initTouchEvent", "string;bool", tuple(type, canBubble)); 74 } 75 void initTouchEvent()(string type) { 76 Object_Call_string__void(this._parent, "initTouchEvent", type); 77 } 78 } 79 struct TouchEventInit { 80 nothrow: 81 libwasm.bindings.UIEvent.EventModifierInit _parent; 82 alias _parent this; 83 this(Handle h) { 84 _parent = .EventModifierInit(h); 85 } 86 static auto create() { 87 return TouchEventInit(libwasm_add__object()); 88 } 89 void touches()(scope ref Sequence!(Touch) touches) { 90 Object_Call_Handle__void(this._parent, "touches", touches.handle); 91 } 92 auto touches()() { 93 return Sequence!(Touch)(Object_Getter__Handle(this._parent, "touches")); 94 } 95 void targetTouches()(scope ref Sequence!(Touch) targetTouches) { 96 Object_Call_Handle__void(this._parent, "targetTouches", targetTouches.handle); 97 } 98 auto targetTouches()() { 99 return Sequence!(Touch)(Object_Getter__Handle(this._parent, "targetTouches")); 100 } 101 void changedTouches()(scope ref Sequence!(Touch) changedTouches) { 102 Object_Call_Handle__void(this._parent, "changedTouches", changedTouches.handle); 103 } 104 auto changedTouches()() { 105 return Sequence!(Touch)(Object_Getter__Handle(this._parent, "changedTouches")); 106 } 107 } 108 109