1 module libwasm.bindings.XULPopupElement; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 import libwasm.bindings.DOMRect; 7 import libwasm.bindings.Element; 8 import libwasm.bindings.Event; 9 import libwasm.bindings.Node; 10 import libwasm.bindings.XULElement; 11 12 @safe: 13 nothrow: 14 15 struct OpenPopupOptions { 16 nothrow: 17 JsHandle handle; 18 alias handle this; 19 this(Handle h) { 20 this.handle = JsHandle(h); 21 } 22 static auto create() { 23 return OpenPopupOptions(libwasm_add__object()); 24 } 25 void position()(string position) { 26 Object_Call_string__void(this.handle, "position", position); 27 } 28 string position()() { 29 return Object_Getter__string(this.handle, "position"); 30 } 31 void x()(int x) { 32 Object_Call_int__void(this.handle, "x", x); 33 } 34 int x()() { 35 return Object_Getter__int(this.handle, "x"); 36 } 37 void y()(int y) { 38 Object_Call_int__void(this.handle, "y", y); 39 } 40 int y()() { 41 return Object_Getter__int(this.handle, "y"); 42 } 43 void isContextMenu()(bool isContextMenu) { 44 Object_Call_bool__void(this.handle, "isContextMenu", isContextMenu); 45 } 46 bool isContextMenu()() { 47 return Object_Getter__bool(this.handle, "isContextMenu"); 48 } 49 void attributesOverride()(bool attributesOverride) { 50 Object_Call_bool__void(this.handle, "attributesOverride", attributesOverride); 51 } 52 bool attributesOverride()() { 53 return Object_Getter__bool(this.handle, "attributesOverride"); 54 } 55 void triggerEvent(T0)(scope auto ref Optional!(T0) triggerEvent) if (isTOrPointer!(T0, Event)) { 56 Serialize_Object_VarArgCall!void(this.handle, "triggerEvent", "Optional!Handle", tuple(!triggerEvent.empty, cast(Handle)triggerEvent.front.handle)); 57 } 58 auto triggerEvent()() { 59 return recastOpt!(Event)(Object_Getter__OptionalHandle(this.handle, "triggerEvent")); 60 } 61 } 62 alias StringOrOpenPopupOptions = SumType!(string, OpenPopupOptions); 63 struct XULPopupElement { 64 nothrow: 65 libwasm.bindings.XULElement.XULElement _parent; 66 alias _parent this; 67 this(Handle h) { 68 _parent = .XULElement(h); 69 } 70 void autoPosition()(bool autoPosition) { 71 Object_Call_bool__void(this._parent, "autoPosition", autoPosition); 72 } 73 bool autoPosition()() { 74 return Object_Getter__bool(this._parent, "autoPosition"); 75 } 76 void openPopup(T0, T6)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, scope ref StringOrOpenPopupOptions options, int x /* = 0 */, int y /* = 0 */, bool isContextMenu /* = false */, bool attributesOverride /* = false */, scope auto ref Optional!(T6) triggerEvent /* = no!(Event) */) if (isTOrPointer!(T0, Element) && isTOrPointer!(T6, Event)) { 77 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle;SumType!(string,Handle);int;int;bool;bool;Optional!Handle", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, libwasm.sumtype.match!(((string v) => 0),((ref options.Types[1] v) => 1))(options),tuple(libwasm.sumtype.match!(((string v) => v),((ref options.Types[1] v) => string.init))(options),libwasm.sumtype.match!(((string v) => Handle.init),((ref options.Types[1] v) => cast(Handle)v.handle))(options)), x, y, isContextMenu, attributesOverride, !triggerEvent.empty, cast(Handle)triggerEvent.front.handle)); 78 } 79 void openPopup(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, scope ref StringOrOpenPopupOptions options, int x /* = 0 */, int y /* = 0 */, bool isContextMenu /* = false */, bool attributesOverride /* = false */) if (isTOrPointer!(T0, Element)) { 80 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle;SumType!(string,Handle);int;int;bool;bool", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, libwasm.sumtype.match!(((string v) => 0),((ref options.Types[1] v) => 1))(options),tuple(libwasm.sumtype.match!(((string v) => v),((ref options.Types[1] v) => string.init))(options),libwasm.sumtype.match!(((string v) => Handle.init),((ref options.Types[1] v) => cast(Handle)v.handle))(options)), x, y, isContextMenu, attributesOverride)); 81 } 82 void openPopup(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, scope ref StringOrOpenPopupOptions options, int x /* = 0 */, int y /* = 0 */, bool isContextMenu /* = false */) if (isTOrPointer!(T0, Element)) { 83 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle;SumType!(string,Handle);int;int;bool", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, libwasm.sumtype.match!(((string v) => 0),((ref options.Types[1] v) => 1))(options),tuple(libwasm.sumtype.match!(((string v) => v),((ref options.Types[1] v) => string.init))(options),libwasm.sumtype.match!(((string v) => Handle.init),((ref options.Types[1] v) => cast(Handle)v.handle))(options)), x, y, isContextMenu)); 84 } 85 void openPopup(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, scope ref StringOrOpenPopupOptions options, int x /* = 0 */, int y /* = 0 */) if (isTOrPointer!(T0, Element)) { 86 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle;SumType!(string,Handle);int;int", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, libwasm.sumtype.match!(((string v) => 0),((ref options.Types[1] v) => 1))(options),tuple(libwasm.sumtype.match!(((string v) => v),((ref options.Types[1] v) => string.init))(options),libwasm.sumtype.match!(((string v) => Handle.init),((ref options.Types[1] v) => cast(Handle)v.handle))(options)), x, y)); 87 } 88 void openPopup(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, scope ref StringOrOpenPopupOptions options, int x /* = 0 */) if (isTOrPointer!(T0, Element)) { 89 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle;SumType!(string,Handle);int", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, libwasm.sumtype.match!(((string v) => 0),((ref options.Types[1] v) => 1))(options),tuple(libwasm.sumtype.match!(((string v) => v),((ref options.Types[1] v) => string.init))(options),libwasm.sumtype.match!(((string v) => Handle.init),((ref options.Types[1] v) => cast(Handle)v.handle))(options)), x)); 90 } 91 void openPopup(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, scope ref StringOrOpenPopupOptions options) if (isTOrPointer!(T0, Element)) { 92 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle;SumType!(string,Handle)", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, libwasm.sumtype.match!(((string v) => 0),((ref options.Types[1] v) => 1))(options),tuple(libwasm.sumtype.match!(((string v) => v),((ref options.Types[1] v) => string.init))(options),libwasm.sumtype.match!(((string v) => Handle.init),((ref options.Types[1] v) => cast(Handle)v.handle))(options)))); 93 } 94 void openPopup(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */) if (isTOrPointer!(T0, Element)) { 95 Serialize_Object_VarArgCall!void(this._parent, "openPopup", "Optional!Handle", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent)); 96 } 97 void openPopup()() { 98 Object_Call__void(this._parent, "openPopup"); 99 } 100 void openPopupAtScreen(T3)(int x /* = 0 */, int y /* = 0 */, bool isContextMenu /* = false */, scope auto ref Optional!(T3) triggerEvent /* = no!(Event) */) if (isTOrPointer!(T3, Event)) { 101 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreen", "int;int;bool;Optional!Handle", tuple(x, y, isContextMenu, !triggerEvent.empty, cast(Handle)triggerEvent.front.handle)); 102 } 103 void openPopupAtScreen()(int x /* = 0 */, int y /* = 0 */, bool isContextMenu /* = false */) { 104 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreen", "int;int;bool", tuple(x, y, isContextMenu)); 105 } 106 void openPopupAtScreen()(int x /* = 0 */, int y /* = 0 */) { 107 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreen", "int;int", tuple(x, y)); 108 } 109 void openPopupAtScreen()(int x /* = 0 */) { 110 Object_Call_int__void(this._parent, "openPopupAtScreen", x); 111 } 112 void openPopupAtScreen()() { 113 Object_Call__void(this._parent, "openPopupAtScreen"); 114 } 115 void openPopupAtScreenRect(T7)(string position /* = "" */, int x /* = 0 */, int y /* = 0 */, int width /* = 0 */, int height /* = 0 */, bool isContextMenu /* = false */, bool attributesOverride /* = false */, scope auto ref Optional!(T7) triggerEvent /* = no!(Event) */) if (isTOrPointer!(T7, Event)) { 116 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int;int;int;int;bool;bool;Optional!Handle", tuple(position, x, y, width, height, isContextMenu, attributesOverride, !triggerEvent.empty, cast(Handle)triggerEvent.front.handle)); 117 } 118 void openPopupAtScreenRect()(string position /* = "" */, int x /* = 0 */, int y /* = 0 */, int width /* = 0 */, int height /* = 0 */, bool isContextMenu /* = false */, bool attributesOverride /* = false */) { 119 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int;int;int;int;bool;bool", tuple(position, x, y, width, height, isContextMenu, attributesOverride)); 120 } 121 void openPopupAtScreenRect()(string position /* = "" */, int x /* = 0 */, int y /* = 0 */, int width /* = 0 */, int height /* = 0 */, bool isContextMenu /* = false */) { 122 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int;int;int;int;bool", tuple(position, x, y, width, height, isContextMenu)); 123 } 124 void openPopupAtScreenRect()(string position /* = "" */, int x /* = 0 */, int y /* = 0 */, int width /* = 0 */, int height /* = 0 */) { 125 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int;int;int;int", tuple(position, x, y, width, height)); 126 } 127 void openPopupAtScreenRect()(string position /* = "" */, int x /* = 0 */, int y /* = 0 */, int width /* = 0 */) { 128 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int;int;int", tuple(position, x, y, width)); 129 } 130 void openPopupAtScreenRect()(string position /* = "" */, int x /* = 0 */, int y /* = 0 */) { 131 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int;int", tuple(position, x, y)); 132 } 133 void openPopupAtScreenRect()(string position /* = "" */, int x /* = 0 */) { 134 Serialize_Object_VarArgCall!void(this._parent, "openPopupAtScreenRect", "string;int", tuple(position, x)); 135 } 136 void openPopupAtScreenRect()(string position /* = "" */) { 137 Object_Call_string__void(this._parent, "openPopupAtScreenRect", position); 138 } 139 void openPopupAtScreenRect()() { 140 Object_Call__void(this._parent, "openPopupAtScreenRect"); 141 } 142 void hidePopup()(bool cancel /* = false */) { 143 Object_Call_bool__void(this._parent, "hidePopup", cancel); 144 } 145 void hidePopup()() { 146 Object_Call__void(this._parent, "hidePopup"); 147 } 148 void label()(string label) { 149 Object_Call_string__void(this._parent, "label", label); 150 } 151 string label()() { 152 return Object_Getter__string(this._parent, "label"); 153 } 154 void position()(string position) { 155 Object_Call_string__void(this._parent, "position", position); 156 } 157 string position()() { 158 return Object_Getter__string(this._parent, "position"); 159 } 160 string state()() { 161 return Object_Getter__string(this._parent, "state"); 162 } 163 auto triggerNode()() { 164 return recastOpt!(Node)(Object_Getter__OptionalHandle(this._parent, "triggerNode")); 165 } 166 auto anchorNode()() { 167 return recastOpt!(Element)(Object_Getter__OptionalHandle(this._parent, "anchorNode")); 168 } 169 auto getOuterScreenRect()() { 170 return DOMRect(Object_Getter__Handle(this._parent, "getOuterScreenRect")); 171 } 172 void moveTo()(int left, int top) { 173 Serialize_Object_VarArgCall!void(this._parent, "moveTo", "int;int", tuple(left, top)); 174 } 175 void moveToAnchor(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, string position /* = "" */, int x /* = 0 */, int y /* = 0 */, bool attributesOverride /* = false */) if (isTOrPointer!(T0, Element)) { 176 Serialize_Object_VarArgCall!void(this._parent, "moveToAnchor", "Optional!Handle;string;int;int;bool", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, position, x, y, attributesOverride)); 177 } 178 void moveToAnchor(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, string position /* = "" */, int x /* = 0 */, int y /* = 0 */) if (isTOrPointer!(T0, Element)) { 179 Serialize_Object_VarArgCall!void(this._parent, "moveToAnchor", "Optional!Handle;string;int;int", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, position, x, y)); 180 } 181 void moveToAnchor(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, string position /* = "" */, int x /* = 0 */) if (isTOrPointer!(T0, Element)) { 182 Serialize_Object_VarArgCall!void(this._parent, "moveToAnchor", "Optional!Handle;string;int", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, position, x)); 183 } 184 void moveToAnchor(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */, string position /* = "" */) if (isTOrPointer!(T0, Element)) { 185 Serialize_Object_VarArgCall!void(this._parent, "moveToAnchor", "Optional!Handle;string", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent, position)); 186 } 187 void moveToAnchor(T0)(scope auto ref Optional!(T0) anchorElement /* = no!(Element) */) if (isTOrPointer!(T0, Element)) { 188 Serialize_Object_VarArgCall!void(this._parent, "moveToAnchor", "Optional!Handle", tuple(!anchorElement.empty, cast(Handle)anchorElement.front._parent)); 189 } 190 void moveToAnchor()() { 191 Object_Call__void(this._parent, "moveToAnchor"); 192 } 193 void sizeTo()(int width, int height) { 194 Serialize_Object_VarArgCall!void(this._parent, "sizeTo", "int;int", tuple(width, height)); 195 } 196 string alignmentPosition()() { 197 return Object_Getter__string(this._parent, "alignmentPosition"); 198 } 199 int alignmentOffset()() { 200 return Object_Getter__int(this._parent, "alignmentOffset"); 201 } 202 void setConstraintRect()(scope ref DOMRectReadOnly rect) { 203 Object_Call_Handle__void(this._parent, "setConstraintRect", rect.handle); 204 } 205 } 206 207