github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/chromeos/events/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package events 5 6 import ( 7 "github.com/primecitizens/pcz/std/core/abi" 8 "github.com/primecitizens/pcz/std/core/mark" 9 "github.com/primecitizens/pcz/std/ffi/js" 10 "github.com/primecitizens/pcz/std/plat/js/webext/chromeos/events/bindings" 11 ) 12 13 type AudioJackDeviceType uint32 14 15 const ( 16 _ AudioJackDeviceType = iota 17 18 AudioJackDeviceType_HEADPHONE 19 AudioJackDeviceType_MICROPHONE 20 ) 21 22 func (AudioJackDeviceType) FromRef(str js.Ref) AudioJackDeviceType { 23 return AudioJackDeviceType(bindings.ConstOfAudioJackDeviceType(str)) 24 } 25 26 func (x AudioJackDeviceType) String() (string, bool) { 27 switch x { 28 case AudioJackDeviceType_HEADPHONE: 29 return "headphone", true 30 case AudioJackDeviceType_MICROPHONE: 31 return "microphone", true 32 default: 33 return "", false 34 } 35 } 36 37 type AudioJackEvent uint32 38 39 const ( 40 _ AudioJackEvent = iota 41 42 AudioJackEvent_CONNECTED 43 AudioJackEvent_DISCONNECTED 44 ) 45 46 func (AudioJackEvent) FromRef(str js.Ref) AudioJackEvent { 47 return AudioJackEvent(bindings.ConstOfAudioJackEvent(str)) 48 } 49 50 func (x AudioJackEvent) String() (string, bool) { 51 switch x { 52 case AudioJackEvent_CONNECTED: 53 return "connected", true 54 case AudioJackEvent_DISCONNECTED: 55 return "disconnected", true 56 default: 57 return "", false 58 } 59 } 60 61 type AudioJackEventInfo struct { 62 // Event is "AudioJackEventInfo.event" 63 // 64 // Optional 65 Event AudioJackEvent 66 // DeviceType is "AudioJackEventInfo.deviceType" 67 // 68 // Optional 69 DeviceType AudioJackDeviceType 70 71 FFI_USE bool 72 } 73 74 // FromRef calls UpdateFrom and returns a AudioJackEventInfo with all fields set. 75 func (p AudioJackEventInfo) FromRef(ref js.Ref) AudioJackEventInfo { 76 p.UpdateFrom(ref) 77 return p 78 } 79 80 // New creates a new AudioJackEventInfo in the application heap. 81 func (p AudioJackEventInfo) New() js.Ref { 82 return bindings.AudioJackEventInfoJSLoad( 83 js.Pointer(&p), js.True, 0, 84 ) 85 } 86 87 // UpdateFrom copies value of all fields of the heap object to p. 88 func (p *AudioJackEventInfo) UpdateFrom(ref js.Ref) { 89 bindings.AudioJackEventInfoJSStore( 90 js.Pointer(p), ref, 91 ) 92 } 93 94 // Update writes all fields of the p to the heap object referenced by ref. 95 func (p *AudioJackEventInfo) Update(ref js.Ref) { 96 bindings.AudioJackEventInfoJSLoad( 97 js.Pointer(p), js.False, ref, 98 ) 99 } 100 101 // FreeMembers frees fields with heap reference, if recursive is true 102 // free all heap references reachable from p. 103 func (p *AudioJackEventInfo) FreeMembers(recursive bool) { 104 } 105 106 type DisplayInputType uint32 107 108 const ( 109 _ DisplayInputType = iota 110 111 DisplayInputType_UNKNOWN 112 DisplayInputType_DIGITAL 113 DisplayInputType_ANALOG 114 ) 115 116 func (DisplayInputType) FromRef(str js.Ref) DisplayInputType { 117 return DisplayInputType(bindings.ConstOfDisplayInputType(str)) 118 } 119 120 func (x DisplayInputType) String() (string, bool) { 121 switch x { 122 case DisplayInputType_UNKNOWN: 123 return "unknown", true 124 case DisplayInputType_DIGITAL: 125 return "digital", true 126 case DisplayInputType_ANALOG: 127 return "analog", true 128 default: 129 return "", false 130 } 131 } 132 133 type EOFFunc func(this js.Ref) js.Ref 134 135 func (fn EOFFunc) Register() js.Func[func()] { 136 return js.RegisterCallback[func()]( 137 fn, abi.FuncPCABIInternal(fn), 138 ) 139 } 140 141 func (fn EOFFunc) DispatchCallback( 142 targetPC uintptr, ctx *js.CallbackContext, 143 ) { 144 args := ctx.Args() 145 if len(args) != 0+1 /* js this */ || 146 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 147 js.ThrowInvalidCallbackInvocation() 148 } 149 150 if ctx.Return(fn( 151 args[0], 152 )) { 153 return 154 } 155 156 js.ThrowCallbackValueNotReturned() 157 } 158 159 type EOF[T any] struct { 160 Fn func(arg T, this js.Ref) js.Ref 161 Arg T 162 } 163 164 func (cb *EOF[T]) Register() js.Func[func()] { 165 return js.RegisterCallback[func()]( 166 cb, abi.FuncPCABIInternal(cb.Fn), 167 ) 168 } 169 170 func (cb *EOF[T]) DispatchCallback( 171 targetPC uintptr, ctx *js.CallbackContext, 172 ) { 173 args := ctx.Args() 174 if len(args) != 0+1 /* js this */ || 175 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 176 js.ThrowInvalidCallbackInvocation() 177 } 178 179 if ctx.Return(cb.Fn( 180 cb.Arg, 181 args[0], 182 )) { 183 return 184 } 185 186 js.ThrowCallbackValueNotReturned() 187 } 188 189 type EventCategory uint32 190 191 const ( 192 _ EventCategory = iota 193 194 EventCategory_AUDIO_JACK 195 EventCategory_LID 196 EventCategory_USB 197 EventCategory_SD_CARD 198 EventCategory_POWER 199 EventCategory_KEYBOARD_DIAGNOSTIC 200 EventCategory_STYLUS_GARAGE 201 EventCategory_TOUCHPAD_BUTTON 202 EventCategory_TOUCHPAD_TOUCH 203 EventCategory_TOUCHPAD_CONNECTED 204 EventCategory_TOUCHSCREEN_TOUCH 205 EventCategory_TOUCHSCREEN_CONNECTED 206 EventCategory_EXTERNAL_DISPLAY 207 EventCategory_STYLUS_TOUCH 208 EventCategory_STYLUS_CONNECTED 209 ) 210 211 func (EventCategory) FromRef(str js.Ref) EventCategory { 212 return EventCategory(bindings.ConstOfEventCategory(str)) 213 } 214 215 func (x EventCategory) String() (string, bool) { 216 switch x { 217 case EventCategory_AUDIO_JACK: 218 return "audio_jack", true 219 case EventCategory_LID: 220 return "lid", true 221 case EventCategory_USB: 222 return "usb", true 223 case EventCategory_SD_CARD: 224 return "sd_card", true 225 case EventCategory_POWER: 226 return "power", true 227 case EventCategory_KEYBOARD_DIAGNOSTIC: 228 return "keyboard_diagnostic", true 229 case EventCategory_STYLUS_GARAGE: 230 return "stylus_garage", true 231 case EventCategory_TOUCHPAD_BUTTON: 232 return "touchpad_button", true 233 case EventCategory_TOUCHPAD_TOUCH: 234 return "touchpad_touch", true 235 case EventCategory_TOUCHPAD_CONNECTED: 236 return "touchpad_connected", true 237 case EventCategory_TOUCHSCREEN_TOUCH: 238 return "touchscreen_touch", true 239 case EventCategory_TOUCHSCREEN_CONNECTED: 240 return "touchscreen_connected", true 241 case EventCategory_EXTERNAL_DISPLAY: 242 return "external_display", true 243 case EventCategory_STYLUS_TOUCH: 244 return "stylus_touch", true 245 case EventCategory_STYLUS_CONNECTED: 246 return "stylus_connected", true 247 default: 248 return "", false 249 } 250 } 251 252 type EventSupportStatus uint32 253 254 const ( 255 _ EventSupportStatus = iota 256 257 EventSupportStatus_SUPPORTED 258 EventSupportStatus_UNSUPPORTED 259 ) 260 261 func (EventSupportStatus) FromRef(str js.Ref) EventSupportStatus { 262 return EventSupportStatus(bindings.ConstOfEventSupportStatus(str)) 263 } 264 265 func (x EventSupportStatus) String() (string, bool) { 266 switch x { 267 case EventSupportStatus_SUPPORTED: 268 return "supported", true 269 case EventSupportStatus_UNSUPPORTED: 270 return "unsupported", true 271 default: 272 return "", false 273 } 274 } 275 276 type EventSupportStatusInfo struct { 277 // Status is "EventSupportStatusInfo.status" 278 // 279 // Optional 280 Status EventSupportStatus 281 282 FFI_USE bool 283 } 284 285 // FromRef calls UpdateFrom and returns a EventSupportStatusInfo with all fields set. 286 func (p EventSupportStatusInfo) FromRef(ref js.Ref) EventSupportStatusInfo { 287 p.UpdateFrom(ref) 288 return p 289 } 290 291 // New creates a new EventSupportStatusInfo in the application heap. 292 func (p EventSupportStatusInfo) New() js.Ref { 293 return bindings.EventSupportStatusInfoJSLoad( 294 js.Pointer(&p), js.True, 0, 295 ) 296 } 297 298 // UpdateFrom copies value of all fields of the heap object to p. 299 func (p *EventSupportStatusInfo) UpdateFrom(ref js.Ref) { 300 bindings.EventSupportStatusInfoJSStore( 301 js.Pointer(p), ref, 302 ) 303 } 304 305 // Update writes all fields of the p to the heap object referenced by ref. 306 func (p *EventSupportStatusInfo) Update(ref js.Ref) { 307 bindings.EventSupportStatusInfoJSLoad( 308 js.Pointer(p), js.False, ref, 309 ) 310 } 311 312 // FreeMembers frees fields with heap reference, if recursive is true 313 // free all heap references reachable from p. 314 func (p *EventSupportStatusInfo) FreeMembers(recursive bool) { 315 } 316 317 type EventSupportStatusInfoCallbackFunc func(this js.Ref, info *EventSupportStatusInfo) js.Ref 318 319 func (fn EventSupportStatusInfoCallbackFunc) Register() js.Func[func(info *EventSupportStatusInfo)] { 320 return js.RegisterCallback[func(info *EventSupportStatusInfo)]( 321 fn, abi.FuncPCABIInternal(fn), 322 ) 323 } 324 325 func (fn EventSupportStatusInfoCallbackFunc) DispatchCallback( 326 targetPC uintptr, ctx *js.CallbackContext, 327 ) { 328 args := ctx.Args() 329 if len(args) != 1+1 /* js this */ || 330 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 331 js.ThrowInvalidCallbackInvocation() 332 } 333 var arg0 EventSupportStatusInfo 334 arg0.UpdateFrom(args[0+1]) 335 defer arg0.FreeMembers(true) 336 337 if ctx.Return(fn( 338 args[0], 339 340 mark.NoEscape(&arg0), 341 )) { 342 return 343 } 344 345 js.ThrowCallbackValueNotReturned() 346 } 347 348 type EventSupportStatusInfoCallback[T any] struct { 349 Fn func(arg T, this js.Ref, info *EventSupportStatusInfo) js.Ref 350 Arg T 351 } 352 353 func (cb *EventSupportStatusInfoCallback[T]) Register() js.Func[func(info *EventSupportStatusInfo)] { 354 return js.RegisterCallback[func(info *EventSupportStatusInfo)]( 355 cb, abi.FuncPCABIInternal(cb.Fn), 356 ) 357 } 358 359 func (cb *EventSupportStatusInfoCallback[T]) DispatchCallback( 360 targetPC uintptr, ctx *js.CallbackContext, 361 ) { 362 args := ctx.Args() 363 if len(args) != 1+1 /* js this */ || 364 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 365 js.ThrowInvalidCallbackInvocation() 366 } 367 var arg0 EventSupportStatusInfo 368 arg0.UpdateFrom(args[0+1]) 369 defer arg0.FreeMembers(true) 370 371 if ctx.Return(cb.Fn( 372 cb.Arg, 373 args[0], 374 375 mark.NoEscape(&arg0), 376 )) { 377 return 378 } 379 380 js.ThrowCallbackValueNotReturned() 381 } 382 383 type ExternalDisplayEvent uint32 384 385 const ( 386 _ ExternalDisplayEvent = iota 387 388 ExternalDisplayEvent_CONNECTED 389 ExternalDisplayEvent_DISCONNECTED 390 ) 391 392 func (ExternalDisplayEvent) FromRef(str js.Ref) ExternalDisplayEvent { 393 return ExternalDisplayEvent(bindings.ConstOfExternalDisplayEvent(str)) 394 } 395 396 func (x ExternalDisplayEvent) String() (string, bool) { 397 switch x { 398 case ExternalDisplayEvent_CONNECTED: 399 return "connected", true 400 case ExternalDisplayEvent_DISCONNECTED: 401 return "disconnected", true 402 default: 403 return "", false 404 } 405 } 406 407 type ExternalDisplayInfo struct { 408 // DisplayWidth is "ExternalDisplayInfo.displayWidth" 409 // 410 // Optional 411 // 412 // NOTE: FFI_USE_DisplayWidth MUST be set to true to make this field effective. 413 DisplayWidth int32 414 // DisplayHeight is "ExternalDisplayInfo.displayHeight" 415 // 416 // Optional 417 // 418 // NOTE: FFI_USE_DisplayHeight MUST be set to true to make this field effective. 419 DisplayHeight int32 420 // ResolutionHorizontal is "ExternalDisplayInfo.resolutionHorizontal" 421 // 422 // Optional 423 // 424 // NOTE: FFI_USE_ResolutionHorizontal MUST be set to true to make this field effective. 425 ResolutionHorizontal int32 426 // ResolutionVertical is "ExternalDisplayInfo.resolutionVertical" 427 // 428 // Optional 429 // 430 // NOTE: FFI_USE_ResolutionVertical MUST be set to true to make this field effective. 431 ResolutionVertical int32 432 // RefreshRate is "ExternalDisplayInfo.refreshRate" 433 // 434 // Optional 435 // 436 // NOTE: FFI_USE_RefreshRate MUST be set to true to make this field effective. 437 RefreshRate float64 438 // Manufacturer is "ExternalDisplayInfo.manufacturer" 439 // 440 // Optional 441 Manufacturer js.String 442 // ModelId is "ExternalDisplayInfo.modelId" 443 // 444 // Optional 445 // 446 // NOTE: FFI_USE_ModelId MUST be set to true to make this field effective. 447 ModelId int32 448 // SerialNumber is "ExternalDisplayInfo.serialNumber" 449 // 450 // Optional 451 // 452 // NOTE: FFI_USE_SerialNumber MUST be set to true to make this field effective. 453 SerialNumber int32 454 // ManufactureWeek is "ExternalDisplayInfo.manufactureWeek" 455 // 456 // Optional 457 // 458 // NOTE: FFI_USE_ManufactureWeek MUST be set to true to make this field effective. 459 ManufactureWeek int32 460 // ManufactureYear is "ExternalDisplayInfo.manufactureYear" 461 // 462 // Optional 463 // 464 // NOTE: FFI_USE_ManufactureYear MUST be set to true to make this field effective. 465 ManufactureYear int32 466 // EdidVersion is "ExternalDisplayInfo.edidVersion" 467 // 468 // Optional 469 EdidVersion js.String 470 // InputType is "ExternalDisplayInfo.inputType" 471 // 472 // Optional 473 InputType DisplayInputType 474 // DisplayName is "ExternalDisplayInfo.displayName" 475 // 476 // Optional 477 DisplayName js.String 478 479 FFI_USE_DisplayWidth bool // for DisplayWidth. 480 FFI_USE_DisplayHeight bool // for DisplayHeight. 481 FFI_USE_ResolutionHorizontal bool // for ResolutionHorizontal. 482 FFI_USE_ResolutionVertical bool // for ResolutionVertical. 483 FFI_USE_RefreshRate bool // for RefreshRate. 484 FFI_USE_ModelId bool // for ModelId. 485 FFI_USE_SerialNumber bool // for SerialNumber. 486 FFI_USE_ManufactureWeek bool // for ManufactureWeek. 487 FFI_USE_ManufactureYear bool // for ManufactureYear. 488 489 FFI_USE bool 490 } 491 492 // FromRef calls UpdateFrom and returns a ExternalDisplayInfo with all fields set. 493 func (p ExternalDisplayInfo) FromRef(ref js.Ref) ExternalDisplayInfo { 494 p.UpdateFrom(ref) 495 return p 496 } 497 498 // New creates a new ExternalDisplayInfo in the application heap. 499 func (p ExternalDisplayInfo) New() js.Ref { 500 return bindings.ExternalDisplayInfoJSLoad( 501 js.Pointer(&p), js.True, 0, 502 ) 503 } 504 505 // UpdateFrom copies value of all fields of the heap object to p. 506 func (p *ExternalDisplayInfo) UpdateFrom(ref js.Ref) { 507 bindings.ExternalDisplayInfoJSStore( 508 js.Pointer(p), ref, 509 ) 510 } 511 512 // Update writes all fields of the p to the heap object referenced by ref. 513 func (p *ExternalDisplayInfo) Update(ref js.Ref) { 514 bindings.ExternalDisplayInfoJSLoad( 515 js.Pointer(p), js.False, ref, 516 ) 517 } 518 519 // FreeMembers frees fields with heap reference, if recursive is true 520 // free all heap references reachable from p. 521 func (p *ExternalDisplayInfo) FreeMembers(recursive bool) { 522 js.Free( 523 p.Manufacturer.Ref(), 524 p.EdidVersion.Ref(), 525 p.DisplayName.Ref(), 526 ) 527 p.Manufacturer = p.Manufacturer.FromRef(js.Undefined) 528 p.EdidVersion = p.EdidVersion.FromRef(js.Undefined) 529 p.DisplayName = p.DisplayName.FromRef(js.Undefined) 530 } 531 532 type ExternalDisplayEventInfo struct { 533 // Event is "ExternalDisplayEventInfo.event" 534 // 535 // Optional 536 Event ExternalDisplayEvent 537 // DisplayInfo is "ExternalDisplayEventInfo.displayInfo" 538 // 539 // Optional 540 // 541 // NOTE: DisplayInfo.FFI_USE MUST be set to true to get DisplayInfo used. 542 DisplayInfo ExternalDisplayInfo 543 544 FFI_USE bool 545 } 546 547 // FromRef calls UpdateFrom and returns a ExternalDisplayEventInfo with all fields set. 548 func (p ExternalDisplayEventInfo) FromRef(ref js.Ref) ExternalDisplayEventInfo { 549 p.UpdateFrom(ref) 550 return p 551 } 552 553 // New creates a new ExternalDisplayEventInfo in the application heap. 554 func (p ExternalDisplayEventInfo) New() js.Ref { 555 return bindings.ExternalDisplayEventInfoJSLoad( 556 js.Pointer(&p), js.True, 0, 557 ) 558 } 559 560 // UpdateFrom copies value of all fields of the heap object to p. 561 func (p *ExternalDisplayEventInfo) UpdateFrom(ref js.Ref) { 562 bindings.ExternalDisplayEventInfoJSStore( 563 js.Pointer(p), ref, 564 ) 565 } 566 567 // Update writes all fields of the p to the heap object referenced by ref. 568 func (p *ExternalDisplayEventInfo) Update(ref js.Ref) { 569 bindings.ExternalDisplayEventInfoJSLoad( 570 js.Pointer(p), js.False, ref, 571 ) 572 } 573 574 // FreeMembers frees fields with heap reference, if recursive is true 575 // free all heap references reachable from p. 576 func (p *ExternalDisplayEventInfo) FreeMembers(recursive bool) { 577 if recursive { 578 p.DisplayInfo.FreeMembers(true) 579 } 580 } 581 582 type InputTouchButton uint32 583 584 const ( 585 _ InputTouchButton = iota 586 587 InputTouchButton_LEFT 588 InputTouchButton_MIDDLE 589 InputTouchButton_RIGHT 590 ) 591 592 func (InputTouchButton) FromRef(str js.Ref) InputTouchButton { 593 return InputTouchButton(bindings.ConstOfInputTouchButton(str)) 594 } 595 596 func (x InputTouchButton) String() (string, bool) { 597 switch x { 598 case InputTouchButton_LEFT: 599 return "left", true 600 case InputTouchButton_MIDDLE: 601 return "middle", true 602 case InputTouchButton_RIGHT: 603 return "right", true 604 default: 605 return "", false 606 } 607 } 608 609 type InputTouchButtonState uint32 610 611 const ( 612 _ InputTouchButtonState = iota 613 614 InputTouchButtonState_PRESSED 615 InputTouchButtonState_RELEASED 616 ) 617 618 func (InputTouchButtonState) FromRef(str js.Ref) InputTouchButtonState { 619 return InputTouchButtonState(bindings.ConstOfInputTouchButtonState(str)) 620 } 621 622 func (x InputTouchButtonState) String() (string, bool) { 623 switch x { 624 case InputTouchButtonState_PRESSED: 625 return "pressed", true 626 case InputTouchButtonState_RELEASED: 627 return "released", true 628 default: 629 return "", false 630 } 631 } 632 633 type KeyboardConnectionType uint32 634 635 const ( 636 _ KeyboardConnectionType = iota 637 638 KeyboardConnectionType_INTERNAL 639 KeyboardConnectionType_USB 640 KeyboardConnectionType_BLUETOOTH 641 KeyboardConnectionType_UNKNOWN 642 ) 643 644 func (KeyboardConnectionType) FromRef(str js.Ref) KeyboardConnectionType { 645 return KeyboardConnectionType(bindings.ConstOfKeyboardConnectionType(str)) 646 } 647 648 func (x KeyboardConnectionType) String() (string, bool) { 649 switch x { 650 case KeyboardConnectionType_INTERNAL: 651 return "internal", true 652 case KeyboardConnectionType_USB: 653 return "usb", true 654 case KeyboardConnectionType_BLUETOOTH: 655 return "bluetooth", true 656 case KeyboardConnectionType_UNKNOWN: 657 return "unknown", true 658 default: 659 return "", false 660 } 661 } 662 663 type PhysicalKeyboardLayout uint32 664 665 const ( 666 _ PhysicalKeyboardLayout = iota 667 668 PhysicalKeyboardLayout_UNKNOWN 669 PhysicalKeyboardLayout_CHROME_OS 670 ) 671 672 func (PhysicalKeyboardLayout) FromRef(str js.Ref) PhysicalKeyboardLayout { 673 return PhysicalKeyboardLayout(bindings.ConstOfPhysicalKeyboardLayout(str)) 674 } 675 676 func (x PhysicalKeyboardLayout) String() (string, bool) { 677 switch x { 678 case PhysicalKeyboardLayout_UNKNOWN: 679 return "unknown", true 680 case PhysicalKeyboardLayout_CHROME_OS: 681 return "chrome_os", true 682 default: 683 return "", false 684 } 685 } 686 687 type MechanicalKeyboardLayout uint32 688 689 const ( 690 _ MechanicalKeyboardLayout = iota 691 692 MechanicalKeyboardLayout_UNKNOWN 693 MechanicalKeyboardLayout_ANSI 694 MechanicalKeyboardLayout_ISO 695 MechanicalKeyboardLayout_JIS 696 ) 697 698 func (MechanicalKeyboardLayout) FromRef(str js.Ref) MechanicalKeyboardLayout { 699 return MechanicalKeyboardLayout(bindings.ConstOfMechanicalKeyboardLayout(str)) 700 } 701 702 func (x MechanicalKeyboardLayout) String() (string, bool) { 703 switch x { 704 case MechanicalKeyboardLayout_UNKNOWN: 705 return "unknown", true 706 case MechanicalKeyboardLayout_ANSI: 707 return "ansi", true 708 case MechanicalKeyboardLayout_ISO: 709 return "iso", true 710 case MechanicalKeyboardLayout_JIS: 711 return "jis", true 712 default: 713 return "", false 714 } 715 } 716 717 type KeyboardNumberPadPresence uint32 718 719 const ( 720 _ KeyboardNumberPadPresence = iota 721 722 KeyboardNumberPadPresence_UNKNOWN 723 KeyboardNumberPadPresence_PRESENT 724 KeyboardNumberPadPresence_NOT_PRESENT 725 ) 726 727 func (KeyboardNumberPadPresence) FromRef(str js.Ref) KeyboardNumberPadPresence { 728 return KeyboardNumberPadPresence(bindings.ConstOfKeyboardNumberPadPresence(str)) 729 } 730 731 func (x KeyboardNumberPadPresence) String() (string, bool) { 732 switch x { 733 case KeyboardNumberPadPresence_UNKNOWN: 734 return "unknown", true 735 case KeyboardNumberPadPresence_PRESENT: 736 return "present", true 737 case KeyboardNumberPadPresence_NOT_PRESENT: 738 return "not_present", true 739 default: 740 return "", false 741 } 742 } 743 744 type KeyboardTopRowKey uint32 745 746 const ( 747 _ KeyboardTopRowKey = iota 748 749 KeyboardTopRowKey_NO_KEY 750 KeyboardTopRowKey_UNKNOWN 751 KeyboardTopRowKey_BACK 752 KeyboardTopRowKey_FORWARD 753 KeyboardTopRowKey_REFRESH 754 KeyboardTopRowKey_FULLSCREEN 755 KeyboardTopRowKey_OVERVIEW 756 KeyboardTopRowKey_SCREENSHOT 757 KeyboardTopRowKey_SCREEN_BRIGHTNESS_DOWN 758 KeyboardTopRowKey_SCREEN_BRIGHTNESS_UP 759 KeyboardTopRowKey_PRIVACY_SCREEN_TOGGLE 760 KeyboardTopRowKey_MICROPHONE_MUTE 761 KeyboardTopRowKey_VOLUME_MUTE 762 KeyboardTopRowKey_VOLUME_DOWN 763 KeyboardTopRowKey_VOLUME_UP 764 KeyboardTopRowKey_KEYBOARD_BACKLIGHT_TOGGLE 765 KeyboardTopRowKey_KEYBOARD_BACKLIGHT_DOWN 766 KeyboardTopRowKey_KEYBOARD_BACKLIGHT_UP 767 KeyboardTopRowKey_NEXT_TRACK 768 KeyboardTopRowKey_PREVIOUS_TRACK 769 KeyboardTopRowKey_PLAY_PAUSE 770 KeyboardTopRowKey_SCREEN_MIRROR 771 KeyboardTopRowKey_DELETE 772 ) 773 774 func (KeyboardTopRowKey) FromRef(str js.Ref) KeyboardTopRowKey { 775 return KeyboardTopRowKey(bindings.ConstOfKeyboardTopRowKey(str)) 776 } 777 778 func (x KeyboardTopRowKey) String() (string, bool) { 779 switch x { 780 case KeyboardTopRowKey_NO_KEY: 781 return "no_key", true 782 case KeyboardTopRowKey_UNKNOWN: 783 return "unknown", true 784 case KeyboardTopRowKey_BACK: 785 return "back", true 786 case KeyboardTopRowKey_FORWARD: 787 return "forward", true 788 case KeyboardTopRowKey_REFRESH: 789 return "refresh", true 790 case KeyboardTopRowKey_FULLSCREEN: 791 return "fullscreen", true 792 case KeyboardTopRowKey_OVERVIEW: 793 return "overview", true 794 case KeyboardTopRowKey_SCREENSHOT: 795 return "screenshot", true 796 case KeyboardTopRowKey_SCREEN_BRIGHTNESS_DOWN: 797 return "screen_brightness_down", true 798 case KeyboardTopRowKey_SCREEN_BRIGHTNESS_UP: 799 return "screen_brightness_up", true 800 case KeyboardTopRowKey_PRIVACY_SCREEN_TOGGLE: 801 return "privacy_screen_toggle", true 802 case KeyboardTopRowKey_MICROPHONE_MUTE: 803 return "microphone_mute", true 804 case KeyboardTopRowKey_VOLUME_MUTE: 805 return "volume_mute", true 806 case KeyboardTopRowKey_VOLUME_DOWN: 807 return "volume_down", true 808 case KeyboardTopRowKey_VOLUME_UP: 809 return "volume_up", true 810 case KeyboardTopRowKey_KEYBOARD_BACKLIGHT_TOGGLE: 811 return "keyboard_backlight_toggle", true 812 case KeyboardTopRowKey_KEYBOARD_BACKLIGHT_DOWN: 813 return "keyboard_backlight_down", true 814 case KeyboardTopRowKey_KEYBOARD_BACKLIGHT_UP: 815 return "keyboard_backlight_up", true 816 case KeyboardTopRowKey_NEXT_TRACK: 817 return "next_track", true 818 case KeyboardTopRowKey_PREVIOUS_TRACK: 819 return "previous_track", true 820 case KeyboardTopRowKey_PLAY_PAUSE: 821 return "play_pause", true 822 case KeyboardTopRowKey_SCREEN_MIRROR: 823 return "screen_mirror", true 824 case KeyboardTopRowKey_DELETE: 825 return "delete", true 826 default: 827 return "", false 828 } 829 } 830 831 type KeyboardTopRightKey uint32 832 833 const ( 834 _ KeyboardTopRightKey = iota 835 836 KeyboardTopRightKey_UNKNOWN 837 KeyboardTopRightKey_POWER 838 KeyboardTopRightKey_LOCK 839 KeyboardTopRightKey_CONTROL_PANEL 840 ) 841 842 func (KeyboardTopRightKey) FromRef(str js.Ref) KeyboardTopRightKey { 843 return KeyboardTopRightKey(bindings.ConstOfKeyboardTopRightKey(str)) 844 } 845 846 func (x KeyboardTopRightKey) String() (string, bool) { 847 switch x { 848 case KeyboardTopRightKey_UNKNOWN: 849 return "unknown", true 850 case KeyboardTopRightKey_POWER: 851 return "power", true 852 case KeyboardTopRightKey_LOCK: 853 return "lock", true 854 case KeyboardTopRightKey_CONTROL_PANEL: 855 return "control_panel", true 856 default: 857 return "", false 858 } 859 } 860 861 type KeyboardInfo struct { 862 // Id is "KeyboardInfo.id" 863 // 864 // Optional 865 // 866 // NOTE: FFI_USE_Id MUST be set to true to make this field effective. 867 Id int32 868 // ConnectionType is "KeyboardInfo.connectionType" 869 // 870 // Optional 871 ConnectionType KeyboardConnectionType 872 // Name is "KeyboardInfo.name" 873 // 874 // Optional 875 Name js.String 876 // PhysicalLayout is "KeyboardInfo.physicalLayout" 877 // 878 // Optional 879 PhysicalLayout PhysicalKeyboardLayout 880 // MechanicalLayout is "KeyboardInfo.mechanicalLayout" 881 // 882 // Optional 883 MechanicalLayout MechanicalKeyboardLayout 884 // RegionCode is "KeyboardInfo.regionCode" 885 // 886 // Optional 887 RegionCode js.String 888 // NumberPadPresent is "KeyboardInfo.numberPadPresent" 889 // 890 // Optional 891 NumberPadPresent KeyboardNumberPadPresence 892 // TopRowKeys is "KeyboardInfo.topRowKeys" 893 // 894 // Optional 895 TopRowKeys js.Array[KeyboardTopRowKey] 896 // TopRightKey is "KeyboardInfo.topRightKey" 897 // 898 // Optional 899 TopRightKey KeyboardTopRightKey 900 // HasAssistantKey is "KeyboardInfo.hasAssistantKey" 901 // 902 // Optional 903 // 904 // NOTE: FFI_USE_HasAssistantKey MUST be set to true to make this field effective. 905 HasAssistantKey bool 906 907 FFI_USE_Id bool // for Id. 908 FFI_USE_HasAssistantKey bool // for HasAssistantKey. 909 910 FFI_USE bool 911 } 912 913 // FromRef calls UpdateFrom and returns a KeyboardInfo with all fields set. 914 func (p KeyboardInfo) FromRef(ref js.Ref) KeyboardInfo { 915 p.UpdateFrom(ref) 916 return p 917 } 918 919 // New creates a new KeyboardInfo in the application heap. 920 func (p KeyboardInfo) New() js.Ref { 921 return bindings.KeyboardInfoJSLoad( 922 js.Pointer(&p), js.True, 0, 923 ) 924 } 925 926 // UpdateFrom copies value of all fields of the heap object to p. 927 func (p *KeyboardInfo) UpdateFrom(ref js.Ref) { 928 bindings.KeyboardInfoJSStore( 929 js.Pointer(p), ref, 930 ) 931 } 932 933 // Update writes all fields of the p to the heap object referenced by ref. 934 func (p *KeyboardInfo) Update(ref js.Ref) { 935 bindings.KeyboardInfoJSLoad( 936 js.Pointer(p), js.False, ref, 937 ) 938 } 939 940 // FreeMembers frees fields with heap reference, if recursive is true 941 // free all heap references reachable from p. 942 func (p *KeyboardInfo) FreeMembers(recursive bool) { 943 js.Free( 944 p.Name.Ref(), 945 p.RegionCode.Ref(), 946 p.TopRowKeys.Ref(), 947 ) 948 p.Name = p.Name.FromRef(js.Undefined) 949 p.RegionCode = p.RegionCode.FromRef(js.Undefined) 950 p.TopRowKeys = p.TopRowKeys.FromRef(js.Undefined) 951 } 952 953 type KeyboardDiagnosticEventInfo struct { 954 // KeyboardInfo is "KeyboardDiagnosticEventInfo.keyboardInfo" 955 // 956 // Optional 957 // 958 // NOTE: KeyboardInfo.FFI_USE MUST be set to true to get KeyboardInfo used. 959 KeyboardInfo KeyboardInfo 960 // TestedKeys is "KeyboardDiagnosticEventInfo.testedKeys" 961 // 962 // Optional 963 TestedKeys js.Array[int32] 964 // TestedTopRowKeys is "KeyboardDiagnosticEventInfo.testedTopRowKeys" 965 // 966 // Optional 967 TestedTopRowKeys js.Array[int32] 968 969 FFI_USE bool 970 } 971 972 // FromRef calls UpdateFrom and returns a KeyboardDiagnosticEventInfo with all fields set. 973 func (p KeyboardDiagnosticEventInfo) FromRef(ref js.Ref) KeyboardDiagnosticEventInfo { 974 p.UpdateFrom(ref) 975 return p 976 } 977 978 // New creates a new KeyboardDiagnosticEventInfo in the application heap. 979 func (p KeyboardDiagnosticEventInfo) New() js.Ref { 980 return bindings.KeyboardDiagnosticEventInfoJSLoad( 981 js.Pointer(&p), js.True, 0, 982 ) 983 } 984 985 // UpdateFrom copies value of all fields of the heap object to p. 986 func (p *KeyboardDiagnosticEventInfo) UpdateFrom(ref js.Ref) { 987 bindings.KeyboardDiagnosticEventInfoJSStore( 988 js.Pointer(p), ref, 989 ) 990 } 991 992 // Update writes all fields of the p to the heap object referenced by ref. 993 func (p *KeyboardDiagnosticEventInfo) Update(ref js.Ref) { 994 bindings.KeyboardDiagnosticEventInfoJSLoad( 995 js.Pointer(p), js.False, ref, 996 ) 997 } 998 999 // FreeMembers frees fields with heap reference, if recursive is true 1000 // free all heap references reachable from p. 1001 func (p *KeyboardDiagnosticEventInfo) FreeMembers(recursive bool) { 1002 js.Free( 1003 p.TestedKeys.Ref(), 1004 p.TestedTopRowKeys.Ref(), 1005 ) 1006 p.TestedKeys = p.TestedKeys.FromRef(js.Undefined) 1007 p.TestedTopRowKeys = p.TestedTopRowKeys.FromRef(js.Undefined) 1008 if recursive { 1009 p.KeyboardInfo.FreeMembers(true) 1010 } 1011 } 1012 1013 type LidEvent uint32 1014 1015 const ( 1016 _ LidEvent = iota 1017 1018 LidEvent_CLOSED 1019 LidEvent_OPENED 1020 ) 1021 1022 func (LidEvent) FromRef(str js.Ref) LidEvent { 1023 return LidEvent(bindings.ConstOfLidEvent(str)) 1024 } 1025 1026 func (x LidEvent) String() (string, bool) { 1027 switch x { 1028 case LidEvent_CLOSED: 1029 return "closed", true 1030 case LidEvent_OPENED: 1031 return "opened", true 1032 default: 1033 return "", false 1034 } 1035 } 1036 1037 type LidEventInfo struct { 1038 // Event is "LidEventInfo.event" 1039 // 1040 // Optional 1041 Event LidEvent 1042 1043 FFI_USE bool 1044 } 1045 1046 // FromRef calls UpdateFrom and returns a LidEventInfo with all fields set. 1047 func (p LidEventInfo) FromRef(ref js.Ref) LidEventInfo { 1048 p.UpdateFrom(ref) 1049 return p 1050 } 1051 1052 // New creates a new LidEventInfo in the application heap. 1053 func (p LidEventInfo) New() js.Ref { 1054 return bindings.LidEventInfoJSLoad( 1055 js.Pointer(&p), js.True, 0, 1056 ) 1057 } 1058 1059 // UpdateFrom copies value of all fields of the heap object to p. 1060 func (p *LidEventInfo) UpdateFrom(ref js.Ref) { 1061 bindings.LidEventInfoJSStore( 1062 js.Pointer(p), ref, 1063 ) 1064 } 1065 1066 // Update writes all fields of the p to the heap object referenced by ref. 1067 func (p *LidEventInfo) Update(ref js.Ref) { 1068 bindings.LidEventInfoJSLoad( 1069 js.Pointer(p), js.False, ref, 1070 ) 1071 } 1072 1073 // FreeMembers frees fields with heap reference, if recursive is true 1074 // free all heap references reachable from p. 1075 func (p *LidEventInfo) FreeMembers(recursive bool) { 1076 } 1077 1078 type PowerEvent uint32 1079 1080 const ( 1081 _ PowerEvent = iota 1082 1083 PowerEvent_AC_INSERTED 1084 PowerEvent_AC_REMOVED 1085 PowerEvent_OS_SUSPEND 1086 PowerEvent_OS_RESUME 1087 ) 1088 1089 func (PowerEvent) FromRef(str js.Ref) PowerEvent { 1090 return PowerEvent(bindings.ConstOfPowerEvent(str)) 1091 } 1092 1093 func (x PowerEvent) String() (string, bool) { 1094 switch x { 1095 case PowerEvent_AC_INSERTED: 1096 return "ac_inserted", true 1097 case PowerEvent_AC_REMOVED: 1098 return "ac_removed", true 1099 case PowerEvent_OS_SUSPEND: 1100 return "os_suspend", true 1101 case PowerEvent_OS_RESUME: 1102 return "os_resume", true 1103 default: 1104 return "", false 1105 } 1106 } 1107 1108 type PowerEventInfo struct { 1109 // Event is "PowerEventInfo.event" 1110 // 1111 // Optional 1112 Event PowerEvent 1113 1114 FFI_USE bool 1115 } 1116 1117 // FromRef calls UpdateFrom and returns a PowerEventInfo with all fields set. 1118 func (p PowerEventInfo) FromRef(ref js.Ref) PowerEventInfo { 1119 p.UpdateFrom(ref) 1120 return p 1121 } 1122 1123 // New creates a new PowerEventInfo in the application heap. 1124 func (p PowerEventInfo) New() js.Ref { 1125 return bindings.PowerEventInfoJSLoad( 1126 js.Pointer(&p), js.True, 0, 1127 ) 1128 } 1129 1130 // UpdateFrom copies value of all fields of the heap object to p. 1131 func (p *PowerEventInfo) UpdateFrom(ref js.Ref) { 1132 bindings.PowerEventInfoJSStore( 1133 js.Pointer(p), ref, 1134 ) 1135 } 1136 1137 // Update writes all fields of the p to the heap object referenced by ref. 1138 func (p *PowerEventInfo) Update(ref js.Ref) { 1139 bindings.PowerEventInfoJSLoad( 1140 js.Pointer(p), js.False, ref, 1141 ) 1142 } 1143 1144 // FreeMembers frees fields with heap reference, if recursive is true 1145 // free all heap references reachable from p. 1146 func (p *PowerEventInfo) FreeMembers(recursive bool) { 1147 } 1148 1149 type SdCardEvent uint32 1150 1151 const ( 1152 _ SdCardEvent = iota 1153 1154 SdCardEvent_CONNECTED 1155 SdCardEvent_DISCONNECTED 1156 ) 1157 1158 func (SdCardEvent) FromRef(str js.Ref) SdCardEvent { 1159 return SdCardEvent(bindings.ConstOfSdCardEvent(str)) 1160 } 1161 1162 func (x SdCardEvent) String() (string, bool) { 1163 switch x { 1164 case SdCardEvent_CONNECTED: 1165 return "connected", true 1166 case SdCardEvent_DISCONNECTED: 1167 return "disconnected", true 1168 default: 1169 return "", false 1170 } 1171 } 1172 1173 type SdCardEventInfo struct { 1174 // Event is "SdCardEventInfo.event" 1175 // 1176 // Optional 1177 Event SdCardEvent 1178 1179 FFI_USE bool 1180 } 1181 1182 // FromRef calls UpdateFrom and returns a SdCardEventInfo with all fields set. 1183 func (p SdCardEventInfo) FromRef(ref js.Ref) SdCardEventInfo { 1184 p.UpdateFrom(ref) 1185 return p 1186 } 1187 1188 // New creates a new SdCardEventInfo in the application heap. 1189 func (p SdCardEventInfo) New() js.Ref { 1190 return bindings.SdCardEventInfoJSLoad( 1191 js.Pointer(&p), js.True, 0, 1192 ) 1193 } 1194 1195 // UpdateFrom copies value of all fields of the heap object to p. 1196 func (p *SdCardEventInfo) UpdateFrom(ref js.Ref) { 1197 bindings.SdCardEventInfoJSStore( 1198 js.Pointer(p), ref, 1199 ) 1200 } 1201 1202 // Update writes all fields of the p to the heap object referenced by ref. 1203 func (p *SdCardEventInfo) Update(ref js.Ref) { 1204 bindings.SdCardEventInfoJSLoad( 1205 js.Pointer(p), js.False, ref, 1206 ) 1207 } 1208 1209 // FreeMembers frees fields with heap reference, if recursive is true 1210 // free all heap references reachable from p. 1211 func (p *SdCardEventInfo) FreeMembers(recursive bool) { 1212 } 1213 1214 type StylusConnectedEventInfo struct { 1215 // MaxX is "StylusConnectedEventInfo.max_x" 1216 // 1217 // Optional 1218 // 1219 // NOTE: FFI_USE_MaxX MUST be set to true to make this field effective. 1220 MaxX int32 1221 // MaxY is "StylusConnectedEventInfo.max_y" 1222 // 1223 // Optional 1224 // 1225 // NOTE: FFI_USE_MaxY MUST be set to true to make this field effective. 1226 MaxY int32 1227 // MaxPressure is "StylusConnectedEventInfo.max_pressure" 1228 // 1229 // Optional 1230 // 1231 // NOTE: FFI_USE_MaxPressure MUST be set to true to make this field effective. 1232 MaxPressure int32 1233 1234 FFI_USE_MaxX bool // for MaxX. 1235 FFI_USE_MaxY bool // for MaxY. 1236 FFI_USE_MaxPressure bool // for MaxPressure. 1237 1238 FFI_USE bool 1239 } 1240 1241 // FromRef calls UpdateFrom and returns a StylusConnectedEventInfo with all fields set. 1242 func (p StylusConnectedEventInfo) FromRef(ref js.Ref) StylusConnectedEventInfo { 1243 p.UpdateFrom(ref) 1244 return p 1245 } 1246 1247 // New creates a new StylusConnectedEventInfo in the application heap. 1248 func (p StylusConnectedEventInfo) New() js.Ref { 1249 return bindings.StylusConnectedEventInfoJSLoad( 1250 js.Pointer(&p), js.True, 0, 1251 ) 1252 } 1253 1254 // UpdateFrom copies value of all fields of the heap object to p. 1255 func (p *StylusConnectedEventInfo) UpdateFrom(ref js.Ref) { 1256 bindings.StylusConnectedEventInfoJSStore( 1257 js.Pointer(p), ref, 1258 ) 1259 } 1260 1261 // Update writes all fields of the p to the heap object referenced by ref. 1262 func (p *StylusConnectedEventInfo) Update(ref js.Ref) { 1263 bindings.StylusConnectedEventInfoJSLoad( 1264 js.Pointer(p), js.False, ref, 1265 ) 1266 } 1267 1268 // FreeMembers frees fields with heap reference, if recursive is true 1269 // free all heap references reachable from p. 1270 func (p *StylusConnectedEventInfo) FreeMembers(recursive bool) { 1271 } 1272 1273 type StylusGarageEvent uint32 1274 1275 const ( 1276 _ StylusGarageEvent = iota 1277 1278 StylusGarageEvent_INSERTED 1279 StylusGarageEvent_REMOVED 1280 ) 1281 1282 func (StylusGarageEvent) FromRef(str js.Ref) StylusGarageEvent { 1283 return StylusGarageEvent(bindings.ConstOfStylusGarageEvent(str)) 1284 } 1285 1286 func (x StylusGarageEvent) String() (string, bool) { 1287 switch x { 1288 case StylusGarageEvent_INSERTED: 1289 return "inserted", true 1290 case StylusGarageEvent_REMOVED: 1291 return "removed", true 1292 default: 1293 return "", false 1294 } 1295 } 1296 1297 type StylusGarageEventInfo struct { 1298 // Event is "StylusGarageEventInfo.event" 1299 // 1300 // Optional 1301 Event StylusGarageEvent 1302 1303 FFI_USE bool 1304 } 1305 1306 // FromRef calls UpdateFrom and returns a StylusGarageEventInfo with all fields set. 1307 func (p StylusGarageEventInfo) FromRef(ref js.Ref) StylusGarageEventInfo { 1308 p.UpdateFrom(ref) 1309 return p 1310 } 1311 1312 // New creates a new StylusGarageEventInfo in the application heap. 1313 func (p StylusGarageEventInfo) New() js.Ref { 1314 return bindings.StylusGarageEventInfoJSLoad( 1315 js.Pointer(&p), js.True, 0, 1316 ) 1317 } 1318 1319 // UpdateFrom copies value of all fields of the heap object to p. 1320 func (p *StylusGarageEventInfo) UpdateFrom(ref js.Ref) { 1321 bindings.StylusGarageEventInfoJSStore( 1322 js.Pointer(p), ref, 1323 ) 1324 } 1325 1326 // Update writes all fields of the p to the heap object referenced by ref. 1327 func (p *StylusGarageEventInfo) Update(ref js.Ref) { 1328 bindings.StylusGarageEventInfoJSLoad( 1329 js.Pointer(p), js.False, ref, 1330 ) 1331 } 1332 1333 // FreeMembers frees fields with heap reference, if recursive is true 1334 // free all heap references reachable from p. 1335 func (p *StylusGarageEventInfo) FreeMembers(recursive bool) { 1336 } 1337 1338 type StylusTouchPointInfo struct { 1339 // X is "StylusTouchPointInfo.x" 1340 // 1341 // Optional 1342 // 1343 // NOTE: FFI_USE_X MUST be set to true to make this field effective. 1344 X int32 1345 // Y is "StylusTouchPointInfo.y" 1346 // 1347 // Optional 1348 // 1349 // NOTE: FFI_USE_Y MUST be set to true to make this field effective. 1350 Y int32 1351 // Pressure is "StylusTouchPointInfo.pressure" 1352 // 1353 // Optional 1354 // 1355 // NOTE: FFI_USE_Pressure MUST be set to true to make this field effective. 1356 Pressure int32 1357 1358 FFI_USE_X bool // for X. 1359 FFI_USE_Y bool // for Y. 1360 FFI_USE_Pressure bool // for Pressure. 1361 1362 FFI_USE bool 1363 } 1364 1365 // FromRef calls UpdateFrom and returns a StylusTouchPointInfo with all fields set. 1366 func (p StylusTouchPointInfo) FromRef(ref js.Ref) StylusTouchPointInfo { 1367 p.UpdateFrom(ref) 1368 return p 1369 } 1370 1371 // New creates a new StylusTouchPointInfo in the application heap. 1372 func (p StylusTouchPointInfo) New() js.Ref { 1373 return bindings.StylusTouchPointInfoJSLoad( 1374 js.Pointer(&p), js.True, 0, 1375 ) 1376 } 1377 1378 // UpdateFrom copies value of all fields of the heap object to p. 1379 func (p *StylusTouchPointInfo) UpdateFrom(ref js.Ref) { 1380 bindings.StylusTouchPointInfoJSStore( 1381 js.Pointer(p), ref, 1382 ) 1383 } 1384 1385 // Update writes all fields of the p to the heap object referenced by ref. 1386 func (p *StylusTouchPointInfo) Update(ref js.Ref) { 1387 bindings.StylusTouchPointInfoJSLoad( 1388 js.Pointer(p), js.False, ref, 1389 ) 1390 } 1391 1392 // FreeMembers frees fields with heap reference, if recursive is true 1393 // free all heap references reachable from p. 1394 func (p *StylusTouchPointInfo) FreeMembers(recursive bool) { 1395 } 1396 1397 type StylusTouchEventInfo struct { 1398 // TouchPoint is "StylusTouchEventInfo.touch_point" 1399 // 1400 // Optional 1401 // 1402 // NOTE: TouchPoint.FFI_USE MUST be set to true to get TouchPoint used. 1403 TouchPoint StylusTouchPointInfo 1404 1405 FFI_USE bool 1406 } 1407 1408 // FromRef calls UpdateFrom and returns a StylusTouchEventInfo with all fields set. 1409 func (p StylusTouchEventInfo) FromRef(ref js.Ref) StylusTouchEventInfo { 1410 p.UpdateFrom(ref) 1411 return p 1412 } 1413 1414 // New creates a new StylusTouchEventInfo in the application heap. 1415 func (p StylusTouchEventInfo) New() js.Ref { 1416 return bindings.StylusTouchEventInfoJSLoad( 1417 js.Pointer(&p), js.True, 0, 1418 ) 1419 } 1420 1421 // UpdateFrom copies value of all fields of the heap object to p. 1422 func (p *StylusTouchEventInfo) UpdateFrom(ref js.Ref) { 1423 bindings.StylusTouchEventInfoJSStore( 1424 js.Pointer(p), ref, 1425 ) 1426 } 1427 1428 // Update writes all fields of the p to the heap object referenced by ref. 1429 func (p *StylusTouchEventInfo) Update(ref js.Ref) { 1430 bindings.StylusTouchEventInfoJSLoad( 1431 js.Pointer(p), js.False, ref, 1432 ) 1433 } 1434 1435 // FreeMembers frees fields with heap reference, if recursive is true 1436 // free all heap references reachable from p. 1437 func (p *StylusTouchEventInfo) FreeMembers(recursive bool) { 1438 if recursive { 1439 p.TouchPoint.FreeMembers(true) 1440 } 1441 } 1442 1443 type TouchPointInfo struct { 1444 // TrackingId is "TouchPointInfo.trackingId" 1445 // 1446 // Optional 1447 // 1448 // NOTE: FFI_USE_TrackingId MUST be set to true to make this field effective. 1449 TrackingId int32 1450 // X is "TouchPointInfo.x" 1451 // 1452 // Optional 1453 // 1454 // NOTE: FFI_USE_X MUST be set to true to make this field effective. 1455 X int32 1456 // Y is "TouchPointInfo.y" 1457 // 1458 // Optional 1459 // 1460 // NOTE: FFI_USE_Y MUST be set to true to make this field effective. 1461 Y int32 1462 // Pressure is "TouchPointInfo.pressure" 1463 // 1464 // Optional 1465 // 1466 // NOTE: FFI_USE_Pressure MUST be set to true to make this field effective. 1467 Pressure int32 1468 // TouchMajor is "TouchPointInfo.touchMajor" 1469 // 1470 // Optional 1471 // 1472 // NOTE: FFI_USE_TouchMajor MUST be set to true to make this field effective. 1473 TouchMajor int32 1474 // TouchMinor is "TouchPointInfo.touchMinor" 1475 // 1476 // Optional 1477 // 1478 // NOTE: FFI_USE_TouchMinor MUST be set to true to make this field effective. 1479 TouchMinor int32 1480 1481 FFI_USE_TrackingId bool // for TrackingId. 1482 FFI_USE_X bool // for X. 1483 FFI_USE_Y bool // for Y. 1484 FFI_USE_Pressure bool // for Pressure. 1485 FFI_USE_TouchMajor bool // for TouchMajor. 1486 FFI_USE_TouchMinor bool // for TouchMinor. 1487 1488 FFI_USE bool 1489 } 1490 1491 // FromRef calls UpdateFrom and returns a TouchPointInfo with all fields set. 1492 func (p TouchPointInfo) FromRef(ref js.Ref) TouchPointInfo { 1493 p.UpdateFrom(ref) 1494 return p 1495 } 1496 1497 // New creates a new TouchPointInfo in the application heap. 1498 func (p TouchPointInfo) New() js.Ref { 1499 return bindings.TouchPointInfoJSLoad( 1500 js.Pointer(&p), js.True, 0, 1501 ) 1502 } 1503 1504 // UpdateFrom copies value of all fields of the heap object to p. 1505 func (p *TouchPointInfo) UpdateFrom(ref js.Ref) { 1506 bindings.TouchPointInfoJSStore( 1507 js.Pointer(p), ref, 1508 ) 1509 } 1510 1511 // Update writes all fields of the p to the heap object referenced by ref. 1512 func (p *TouchPointInfo) Update(ref js.Ref) { 1513 bindings.TouchPointInfoJSLoad( 1514 js.Pointer(p), js.False, ref, 1515 ) 1516 } 1517 1518 // FreeMembers frees fields with heap reference, if recursive is true 1519 // free all heap references reachable from p. 1520 func (p *TouchPointInfo) FreeMembers(recursive bool) { 1521 } 1522 1523 type TouchpadButtonEventInfo struct { 1524 // Button is "TouchpadButtonEventInfo.button" 1525 // 1526 // Optional 1527 Button InputTouchButton 1528 // State is "TouchpadButtonEventInfo.state" 1529 // 1530 // Optional 1531 State InputTouchButtonState 1532 1533 FFI_USE bool 1534 } 1535 1536 // FromRef calls UpdateFrom and returns a TouchpadButtonEventInfo with all fields set. 1537 func (p TouchpadButtonEventInfo) FromRef(ref js.Ref) TouchpadButtonEventInfo { 1538 p.UpdateFrom(ref) 1539 return p 1540 } 1541 1542 // New creates a new TouchpadButtonEventInfo in the application heap. 1543 func (p TouchpadButtonEventInfo) New() js.Ref { 1544 return bindings.TouchpadButtonEventInfoJSLoad( 1545 js.Pointer(&p), js.True, 0, 1546 ) 1547 } 1548 1549 // UpdateFrom copies value of all fields of the heap object to p. 1550 func (p *TouchpadButtonEventInfo) UpdateFrom(ref js.Ref) { 1551 bindings.TouchpadButtonEventInfoJSStore( 1552 js.Pointer(p), ref, 1553 ) 1554 } 1555 1556 // Update writes all fields of the p to the heap object referenced by ref. 1557 func (p *TouchpadButtonEventInfo) Update(ref js.Ref) { 1558 bindings.TouchpadButtonEventInfoJSLoad( 1559 js.Pointer(p), js.False, ref, 1560 ) 1561 } 1562 1563 // FreeMembers frees fields with heap reference, if recursive is true 1564 // free all heap references reachable from p. 1565 func (p *TouchpadButtonEventInfo) FreeMembers(recursive bool) { 1566 } 1567 1568 type TouchpadConnectedEventInfo struct { 1569 // MaxX is "TouchpadConnectedEventInfo.maxX" 1570 // 1571 // Optional 1572 // 1573 // NOTE: FFI_USE_MaxX MUST be set to true to make this field effective. 1574 MaxX int32 1575 // MaxY is "TouchpadConnectedEventInfo.maxY" 1576 // 1577 // Optional 1578 // 1579 // NOTE: FFI_USE_MaxY MUST be set to true to make this field effective. 1580 MaxY int32 1581 // MaxPressure is "TouchpadConnectedEventInfo.maxPressure" 1582 // 1583 // Optional 1584 // 1585 // NOTE: FFI_USE_MaxPressure MUST be set to true to make this field effective. 1586 MaxPressure int32 1587 // Buttons is "TouchpadConnectedEventInfo.buttons" 1588 // 1589 // Optional 1590 Buttons js.Array[InputTouchButton] 1591 1592 FFI_USE_MaxX bool // for MaxX. 1593 FFI_USE_MaxY bool // for MaxY. 1594 FFI_USE_MaxPressure bool // for MaxPressure. 1595 1596 FFI_USE bool 1597 } 1598 1599 // FromRef calls UpdateFrom and returns a TouchpadConnectedEventInfo with all fields set. 1600 func (p TouchpadConnectedEventInfo) FromRef(ref js.Ref) TouchpadConnectedEventInfo { 1601 p.UpdateFrom(ref) 1602 return p 1603 } 1604 1605 // New creates a new TouchpadConnectedEventInfo in the application heap. 1606 func (p TouchpadConnectedEventInfo) New() js.Ref { 1607 return bindings.TouchpadConnectedEventInfoJSLoad( 1608 js.Pointer(&p), js.True, 0, 1609 ) 1610 } 1611 1612 // UpdateFrom copies value of all fields of the heap object to p. 1613 func (p *TouchpadConnectedEventInfo) UpdateFrom(ref js.Ref) { 1614 bindings.TouchpadConnectedEventInfoJSStore( 1615 js.Pointer(p), ref, 1616 ) 1617 } 1618 1619 // Update writes all fields of the p to the heap object referenced by ref. 1620 func (p *TouchpadConnectedEventInfo) Update(ref js.Ref) { 1621 bindings.TouchpadConnectedEventInfoJSLoad( 1622 js.Pointer(p), js.False, ref, 1623 ) 1624 } 1625 1626 // FreeMembers frees fields with heap reference, if recursive is true 1627 // free all heap references reachable from p. 1628 func (p *TouchpadConnectedEventInfo) FreeMembers(recursive bool) { 1629 js.Free( 1630 p.Buttons.Ref(), 1631 ) 1632 p.Buttons = p.Buttons.FromRef(js.Undefined) 1633 } 1634 1635 type TouchpadTouchEventInfo struct { 1636 // TouchPoints is "TouchpadTouchEventInfo.touchPoints" 1637 // 1638 // Optional 1639 TouchPoints js.Array[TouchPointInfo] 1640 1641 FFI_USE bool 1642 } 1643 1644 // FromRef calls UpdateFrom and returns a TouchpadTouchEventInfo with all fields set. 1645 func (p TouchpadTouchEventInfo) FromRef(ref js.Ref) TouchpadTouchEventInfo { 1646 p.UpdateFrom(ref) 1647 return p 1648 } 1649 1650 // New creates a new TouchpadTouchEventInfo in the application heap. 1651 func (p TouchpadTouchEventInfo) New() js.Ref { 1652 return bindings.TouchpadTouchEventInfoJSLoad( 1653 js.Pointer(&p), js.True, 0, 1654 ) 1655 } 1656 1657 // UpdateFrom copies value of all fields of the heap object to p. 1658 func (p *TouchpadTouchEventInfo) UpdateFrom(ref js.Ref) { 1659 bindings.TouchpadTouchEventInfoJSStore( 1660 js.Pointer(p), ref, 1661 ) 1662 } 1663 1664 // Update writes all fields of the p to the heap object referenced by ref. 1665 func (p *TouchpadTouchEventInfo) Update(ref js.Ref) { 1666 bindings.TouchpadTouchEventInfoJSLoad( 1667 js.Pointer(p), js.False, ref, 1668 ) 1669 } 1670 1671 // FreeMembers frees fields with heap reference, if recursive is true 1672 // free all heap references reachable from p. 1673 func (p *TouchpadTouchEventInfo) FreeMembers(recursive bool) { 1674 js.Free( 1675 p.TouchPoints.Ref(), 1676 ) 1677 p.TouchPoints = p.TouchPoints.FromRef(js.Undefined) 1678 } 1679 1680 type TouchscreenConnectedEventInfo struct { 1681 // MaxX is "TouchscreenConnectedEventInfo.maxX" 1682 // 1683 // Optional 1684 // 1685 // NOTE: FFI_USE_MaxX MUST be set to true to make this field effective. 1686 MaxX int32 1687 // MaxY is "TouchscreenConnectedEventInfo.maxY" 1688 // 1689 // Optional 1690 // 1691 // NOTE: FFI_USE_MaxY MUST be set to true to make this field effective. 1692 MaxY int32 1693 // MaxPressure is "TouchscreenConnectedEventInfo.maxPressure" 1694 // 1695 // Optional 1696 // 1697 // NOTE: FFI_USE_MaxPressure MUST be set to true to make this field effective. 1698 MaxPressure int32 1699 1700 FFI_USE_MaxX bool // for MaxX. 1701 FFI_USE_MaxY bool // for MaxY. 1702 FFI_USE_MaxPressure bool // for MaxPressure. 1703 1704 FFI_USE bool 1705 } 1706 1707 // FromRef calls UpdateFrom and returns a TouchscreenConnectedEventInfo with all fields set. 1708 func (p TouchscreenConnectedEventInfo) FromRef(ref js.Ref) TouchscreenConnectedEventInfo { 1709 p.UpdateFrom(ref) 1710 return p 1711 } 1712 1713 // New creates a new TouchscreenConnectedEventInfo in the application heap. 1714 func (p TouchscreenConnectedEventInfo) New() js.Ref { 1715 return bindings.TouchscreenConnectedEventInfoJSLoad( 1716 js.Pointer(&p), js.True, 0, 1717 ) 1718 } 1719 1720 // UpdateFrom copies value of all fields of the heap object to p. 1721 func (p *TouchscreenConnectedEventInfo) UpdateFrom(ref js.Ref) { 1722 bindings.TouchscreenConnectedEventInfoJSStore( 1723 js.Pointer(p), ref, 1724 ) 1725 } 1726 1727 // Update writes all fields of the p to the heap object referenced by ref. 1728 func (p *TouchscreenConnectedEventInfo) Update(ref js.Ref) { 1729 bindings.TouchscreenConnectedEventInfoJSLoad( 1730 js.Pointer(p), js.False, ref, 1731 ) 1732 } 1733 1734 // FreeMembers frees fields with heap reference, if recursive is true 1735 // free all heap references reachable from p. 1736 func (p *TouchscreenConnectedEventInfo) FreeMembers(recursive bool) { 1737 } 1738 1739 type TouchscreenTouchEventInfo struct { 1740 // TouchPoints is "TouchscreenTouchEventInfo.touchPoints" 1741 // 1742 // Optional 1743 TouchPoints js.Array[TouchPointInfo] 1744 1745 FFI_USE bool 1746 } 1747 1748 // FromRef calls UpdateFrom and returns a TouchscreenTouchEventInfo with all fields set. 1749 func (p TouchscreenTouchEventInfo) FromRef(ref js.Ref) TouchscreenTouchEventInfo { 1750 p.UpdateFrom(ref) 1751 return p 1752 } 1753 1754 // New creates a new TouchscreenTouchEventInfo in the application heap. 1755 func (p TouchscreenTouchEventInfo) New() js.Ref { 1756 return bindings.TouchscreenTouchEventInfoJSLoad( 1757 js.Pointer(&p), js.True, 0, 1758 ) 1759 } 1760 1761 // UpdateFrom copies value of all fields of the heap object to p. 1762 func (p *TouchscreenTouchEventInfo) UpdateFrom(ref js.Ref) { 1763 bindings.TouchscreenTouchEventInfoJSStore( 1764 js.Pointer(p), ref, 1765 ) 1766 } 1767 1768 // Update writes all fields of the p to the heap object referenced by ref. 1769 func (p *TouchscreenTouchEventInfo) Update(ref js.Ref) { 1770 bindings.TouchscreenTouchEventInfoJSLoad( 1771 js.Pointer(p), js.False, ref, 1772 ) 1773 } 1774 1775 // FreeMembers frees fields with heap reference, if recursive is true 1776 // free all heap references reachable from p. 1777 func (p *TouchscreenTouchEventInfo) FreeMembers(recursive bool) { 1778 js.Free( 1779 p.TouchPoints.Ref(), 1780 ) 1781 p.TouchPoints = p.TouchPoints.FromRef(js.Undefined) 1782 } 1783 1784 type UsbEvent uint32 1785 1786 const ( 1787 _ UsbEvent = iota 1788 1789 UsbEvent_CONNECTED 1790 UsbEvent_DISCONNECTED 1791 ) 1792 1793 func (UsbEvent) FromRef(str js.Ref) UsbEvent { 1794 return UsbEvent(bindings.ConstOfUsbEvent(str)) 1795 } 1796 1797 func (x UsbEvent) String() (string, bool) { 1798 switch x { 1799 case UsbEvent_CONNECTED: 1800 return "connected", true 1801 case UsbEvent_DISCONNECTED: 1802 return "disconnected", true 1803 default: 1804 return "", false 1805 } 1806 } 1807 1808 type UsbEventInfo struct { 1809 // Vendor is "UsbEventInfo.vendor" 1810 // 1811 // Optional 1812 Vendor js.String 1813 // Name is "UsbEventInfo.name" 1814 // 1815 // Optional 1816 Name js.String 1817 // Vid is "UsbEventInfo.vid" 1818 // 1819 // Optional 1820 // 1821 // NOTE: FFI_USE_Vid MUST be set to true to make this field effective. 1822 Vid int32 1823 // Pid is "UsbEventInfo.pid" 1824 // 1825 // Optional 1826 // 1827 // NOTE: FFI_USE_Pid MUST be set to true to make this field effective. 1828 Pid int32 1829 // Categories is "UsbEventInfo.categories" 1830 // 1831 // Optional 1832 Categories js.Array[js.String] 1833 // Event is "UsbEventInfo.event" 1834 // 1835 // Optional 1836 Event UsbEvent 1837 1838 FFI_USE_Vid bool // for Vid. 1839 FFI_USE_Pid bool // for Pid. 1840 1841 FFI_USE bool 1842 } 1843 1844 // FromRef calls UpdateFrom and returns a UsbEventInfo with all fields set. 1845 func (p UsbEventInfo) FromRef(ref js.Ref) UsbEventInfo { 1846 p.UpdateFrom(ref) 1847 return p 1848 } 1849 1850 // New creates a new UsbEventInfo in the application heap. 1851 func (p UsbEventInfo) New() js.Ref { 1852 return bindings.UsbEventInfoJSLoad( 1853 js.Pointer(&p), js.True, 0, 1854 ) 1855 } 1856 1857 // UpdateFrom copies value of all fields of the heap object to p. 1858 func (p *UsbEventInfo) UpdateFrom(ref js.Ref) { 1859 bindings.UsbEventInfoJSStore( 1860 js.Pointer(p), ref, 1861 ) 1862 } 1863 1864 // Update writes all fields of the p to the heap object referenced by ref. 1865 func (p *UsbEventInfo) Update(ref js.Ref) { 1866 bindings.UsbEventInfoJSLoad( 1867 js.Pointer(p), js.False, ref, 1868 ) 1869 } 1870 1871 // FreeMembers frees fields with heap reference, if recursive is true 1872 // free all heap references reachable from p. 1873 func (p *UsbEventInfo) FreeMembers(recursive bool) { 1874 js.Free( 1875 p.Vendor.Ref(), 1876 p.Name.Ref(), 1877 p.Categories.Ref(), 1878 ) 1879 p.Vendor = p.Vendor.FromRef(js.Undefined) 1880 p.Name = p.Name.FromRef(js.Undefined) 1881 p.Categories = p.Categories.FromRef(js.Undefined) 1882 } 1883 1884 type VoidCallbackFunc func(this js.Ref) js.Ref 1885 1886 func (fn VoidCallbackFunc) Register() js.Func[func()] { 1887 return js.RegisterCallback[func()]( 1888 fn, abi.FuncPCABIInternal(fn), 1889 ) 1890 } 1891 1892 func (fn VoidCallbackFunc) DispatchCallback( 1893 targetPC uintptr, ctx *js.CallbackContext, 1894 ) { 1895 args := ctx.Args() 1896 if len(args) != 0+1 /* js this */ || 1897 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1898 js.ThrowInvalidCallbackInvocation() 1899 } 1900 1901 if ctx.Return(fn( 1902 args[0], 1903 )) { 1904 return 1905 } 1906 1907 js.ThrowCallbackValueNotReturned() 1908 } 1909 1910 type VoidCallback[T any] struct { 1911 Fn func(arg T, this js.Ref) js.Ref 1912 Arg T 1913 } 1914 1915 func (cb *VoidCallback[T]) Register() js.Func[func()] { 1916 return js.RegisterCallback[func()]( 1917 cb, abi.FuncPCABIInternal(cb.Fn), 1918 ) 1919 } 1920 1921 func (cb *VoidCallback[T]) DispatchCallback( 1922 targetPC uintptr, ctx *js.CallbackContext, 1923 ) { 1924 args := ctx.Args() 1925 if len(args) != 0+1 /* js this */ || 1926 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1927 js.ThrowInvalidCallbackInvocation() 1928 } 1929 1930 if ctx.Return(cb.Fn( 1931 cb.Arg, 1932 args[0], 1933 )) { 1934 return 1935 } 1936 1937 js.ThrowCallbackValueNotReturned() 1938 } 1939 1940 // HasFuncIsEventSupported returns true if the function "WEBEXT.os.events.isEventSupported" exists. 1941 func HasFuncIsEventSupported() bool { 1942 return js.True == bindings.HasFuncIsEventSupported() 1943 } 1944 1945 // FuncIsEventSupported returns the function "WEBEXT.os.events.isEventSupported". 1946 func FuncIsEventSupported() (fn js.Func[func(category EventCategory) js.Promise[EventSupportStatusInfo]]) { 1947 bindings.FuncIsEventSupported( 1948 js.Pointer(&fn), 1949 ) 1950 return 1951 } 1952 1953 // IsEventSupported calls the function "WEBEXT.os.events.isEventSupported" directly. 1954 func IsEventSupported(category EventCategory) (ret js.Promise[EventSupportStatusInfo]) { 1955 bindings.CallIsEventSupported( 1956 js.Pointer(&ret), 1957 uint32(category), 1958 ) 1959 1960 return 1961 } 1962 1963 // TryIsEventSupported calls the function "WEBEXT.os.events.isEventSupported" 1964 // in a try/catch block and returns (_, err, ok = false) when it went through 1965 // the catch clause. 1966 func TryIsEventSupported(category EventCategory) (ret js.Promise[EventSupportStatusInfo], exception js.Any, ok bool) { 1967 ok = js.True == bindings.TryIsEventSupported( 1968 js.Pointer(&ret), js.Pointer(&exception), 1969 uint32(category), 1970 ) 1971 1972 return 1973 } 1974 1975 type OnAudioJackEventEventCallbackFunc func(this js.Ref, event_info *AudioJackEventInfo) js.Ref 1976 1977 func (fn OnAudioJackEventEventCallbackFunc) Register() js.Func[func(event_info *AudioJackEventInfo)] { 1978 return js.RegisterCallback[func(event_info *AudioJackEventInfo)]( 1979 fn, abi.FuncPCABIInternal(fn), 1980 ) 1981 } 1982 1983 func (fn OnAudioJackEventEventCallbackFunc) DispatchCallback( 1984 targetPC uintptr, ctx *js.CallbackContext, 1985 ) { 1986 args := ctx.Args() 1987 if len(args) != 1+1 /* js this */ || 1988 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1989 js.ThrowInvalidCallbackInvocation() 1990 } 1991 var arg0 AudioJackEventInfo 1992 arg0.UpdateFrom(args[0+1]) 1993 defer arg0.FreeMembers(true) 1994 1995 if ctx.Return(fn( 1996 args[0], 1997 1998 mark.NoEscape(&arg0), 1999 )) { 2000 return 2001 } 2002 2003 js.ThrowCallbackValueNotReturned() 2004 } 2005 2006 type OnAudioJackEventEventCallback[T any] struct { 2007 Fn func(arg T, this js.Ref, event_info *AudioJackEventInfo) js.Ref 2008 Arg T 2009 } 2010 2011 func (cb *OnAudioJackEventEventCallback[T]) Register() js.Func[func(event_info *AudioJackEventInfo)] { 2012 return js.RegisterCallback[func(event_info *AudioJackEventInfo)]( 2013 cb, abi.FuncPCABIInternal(cb.Fn), 2014 ) 2015 } 2016 2017 func (cb *OnAudioJackEventEventCallback[T]) DispatchCallback( 2018 targetPC uintptr, ctx *js.CallbackContext, 2019 ) { 2020 args := ctx.Args() 2021 if len(args) != 1+1 /* js this */ || 2022 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2023 js.ThrowInvalidCallbackInvocation() 2024 } 2025 var arg0 AudioJackEventInfo 2026 arg0.UpdateFrom(args[0+1]) 2027 defer arg0.FreeMembers(true) 2028 2029 if ctx.Return(cb.Fn( 2030 cb.Arg, 2031 args[0], 2032 2033 mark.NoEscape(&arg0), 2034 )) { 2035 return 2036 } 2037 2038 js.ThrowCallbackValueNotReturned() 2039 } 2040 2041 // HasFuncOnAudioJackEvent returns true if the function "WEBEXT.os.events.onAudioJackEvent.addListener" exists. 2042 func HasFuncOnAudioJackEvent() bool { 2043 return js.True == bindings.HasFuncOnAudioJackEvent() 2044 } 2045 2046 // FuncOnAudioJackEvent returns the function "WEBEXT.os.events.onAudioJackEvent.addListener". 2047 func FuncOnAudioJackEvent() (fn js.Func[func(callback js.Func[func(event_info *AudioJackEventInfo)])]) { 2048 bindings.FuncOnAudioJackEvent( 2049 js.Pointer(&fn), 2050 ) 2051 return 2052 } 2053 2054 // OnAudioJackEvent calls the function "WEBEXT.os.events.onAudioJackEvent.addListener" directly. 2055 func OnAudioJackEvent(callback js.Func[func(event_info *AudioJackEventInfo)]) (ret js.Void) { 2056 bindings.CallOnAudioJackEvent( 2057 js.Pointer(&ret), 2058 callback.Ref(), 2059 ) 2060 2061 return 2062 } 2063 2064 // TryOnAudioJackEvent calls the function "WEBEXT.os.events.onAudioJackEvent.addListener" 2065 // in a try/catch block and returns (_, err, ok = false) when it went through 2066 // the catch clause. 2067 func TryOnAudioJackEvent(callback js.Func[func(event_info *AudioJackEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2068 ok = js.True == bindings.TryOnAudioJackEvent( 2069 js.Pointer(&ret), js.Pointer(&exception), 2070 callback.Ref(), 2071 ) 2072 2073 return 2074 } 2075 2076 // HasFuncOffAudioJackEvent returns true if the function "WEBEXT.os.events.onAudioJackEvent.removeListener" exists. 2077 func HasFuncOffAudioJackEvent() bool { 2078 return js.True == bindings.HasFuncOffAudioJackEvent() 2079 } 2080 2081 // FuncOffAudioJackEvent returns the function "WEBEXT.os.events.onAudioJackEvent.removeListener". 2082 func FuncOffAudioJackEvent() (fn js.Func[func(callback js.Func[func(event_info *AudioJackEventInfo)])]) { 2083 bindings.FuncOffAudioJackEvent( 2084 js.Pointer(&fn), 2085 ) 2086 return 2087 } 2088 2089 // OffAudioJackEvent calls the function "WEBEXT.os.events.onAudioJackEvent.removeListener" directly. 2090 func OffAudioJackEvent(callback js.Func[func(event_info *AudioJackEventInfo)]) (ret js.Void) { 2091 bindings.CallOffAudioJackEvent( 2092 js.Pointer(&ret), 2093 callback.Ref(), 2094 ) 2095 2096 return 2097 } 2098 2099 // TryOffAudioJackEvent calls the function "WEBEXT.os.events.onAudioJackEvent.removeListener" 2100 // in a try/catch block and returns (_, err, ok = false) when it went through 2101 // the catch clause. 2102 func TryOffAudioJackEvent(callback js.Func[func(event_info *AudioJackEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2103 ok = js.True == bindings.TryOffAudioJackEvent( 2104 js.Pointer(&ret), js.Pointer(&exception), 2105 callback.Ref(), 2106 ) 2107 2108 return 2109 } 2110 2111 // HasFuncHasOnAudioJackEvent returns true if the function "WEBEXT.os.events.onAudioJackEvent.hasListener" exists. 2112 func HasFuncHasOnAudioJackEvent() bool { 2113 return js.True == bindings.HasFuncHasOnAudioJackEvent() 2114 } 2115 2116 // FuncHasOnAudioJackEvent returns the function "WEBEXT.os.events.onAudioJackEvent.hasListener". 2117 func FuncHasOnAudioJackEvent() (fn js.Func[func(callback js.Func[func(event_info *AudioJackEventInfo)]) bool]) { 2118 bindings.FuncHasOnAudioJackEvent( 2119 js.Pointer(&fn), 2120 ) 2121 return 2122 } 2123 2124 // HasOnAudioJackEvent calls the function "WEBEXT.os.events.onAudioJackEvent.hasListener" directly. 2125 func HasOnAudioJackEvent(callback js.Func[func(event_info *AudioJackEventInfo)]) (ret bool) { 2126 bindings.CallHasOnAudioJackEvent( 2127 js.Pointer(&ret), 2128 callback.Ref(), 2129 ) 2130 2131 return 2132 } 2133 2134 // TryHasOnAudioJackEvent calls the function "WEBEXT.os.events.onAudioJackEvent.hasListener" 2135 // in a try/catch block and returns (_, err, ok = false) when it went through 2136 // the catch clause. 2137 func TryHasOnAudioJackEvent(callback js.Func[func(event_info *AudioJackEventInfo)]) (ret bool, exception js.Any, ok bool) { 2138 ok = js.True == bindings.TryHasOnAudioJackEvent( 2139 js.Pointer(&ret), js.Pointer(&exception), 2140 callback.Ref(), 2141 ) 2142 2143 return 2144 } 2145 2146 type OnExternalDisplayEventEventCallbackFunc func(this js.Ref, event_info *ExternalDisplayEventInfo) js.Ref 2147 2148 func (fn OnExternalDisplayEventEventCallbackFunc) Register() js.Func[func(event_info *ExternalDisplayEventInfo)] { 2149 return js.RegisterCallback[func(event_info *ExternalDisplayEventInfo)]( 2150 fn, abi.FuncPCABIInternal(fn), 2151 ) 2152 } 2153 2154 func (fn OnExternalDisplayEventEventCallbackFunc) DispatchCallback( 2155 targetPC uintptr, ctx *js.CallbackContext, 2156 ) { 2157 args := ctx.Args() 2158 if len(args) != 1+1 /* js this */ || 2159 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2160 js.ThrowInvalidCallbackInvocation() 2161 } 2162 var arg0 ExternalDisplayEventInfo 2163 arg0.UpdateFrom(args[0+1]) 2164 defer arg0.FreeMembers(true) 2165 2166 if ctx.Return(fn( 2167 args[0], 2168 2169 mark.NoEscape(&arg0), 2170 )) { 2171 return 2172 } 2173 2174 js.ThrowCallbackValueNotReturned() 2175 } 2176 2177 type OnExternalDisplayEventEventCallback[T any] struct { 2178 Fn func(arg T, this js.Ref, event_info *ExternalDisplayEventInfo) js.Ref 2179 Arg T 2180 } 2181 2182 func (cb *OnExternalDisplayEventEventCallback[T]) Register() js.Func[func(event_info *ExternalDisplayEventInfo)] { 2183 return js.RegisterCallback[func(event_info *ExternalDisplayEventInfo)]( 2184 cb, abi.FuncPCABIInternal(cb.Fn), 2185 ) 2186 } 2187 2188 func (cb *OnExternalDisplayEventEventCallback[T]) DispatchCallback( 2189 targetPC uintptr, ctx *js.CallbackContext, 2190 ) { 2191 args := ctx.Args() 2192 if len(args) != 1+1 /* js this */ || 2193 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2194 js.ThrowInvalidCallbackInvocation() 2195 } 2196 var arg0 ExternalDisplayEventInfo 2197 arg0.UpdateFrom(args[0+1]) 2198 defer arg0.FreeMembers(true) 2199 2200 if ctx.Return(cb.Fn( 2201 cb.Arg, 2202 args[0], 2203 2204 mark.NoEscape(&arg0), 2205 )) { 2206 return 2207 } 2208 2209 js.ThrowCallbackValueNotReturned() 2210 } 2211 2212 // HasFuncOnExternalDisplayEvent returns true if the function "WEBEXT.os.events.onExternalDisplayEvent.addListener" exists. 2213 func HasFuncOnExternalDisplayEvent() bool { 2214 return js.True == bindings.HasFuncOnExternalDisplayEvent() 2215 } 2216 2217 // FuncOnExternalDisplayEvent returns the function "WEBEXT.os.events.onExternalDisplayEvent.addListener". 2218 func FuncOnExternalDisplayEvent() (fn js.Func[func(callback js.Func[func(event_info *ExternalDisplayEventInfo)])]) { 2219 bindings.FuncOnExternalDisplayEvent( 2220 js.Pointer(&fn), 2221 ) 2222 return 2223 } 2224 2225 // OnExternalDisplayEvent calls the function "WEBEXT.os.events.onExternalDisplayEvent.addListener" directly. 2226 func OnExternalDisplayEvent(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) (ret js.Void) { 2227 bindings.CallOnExternalDisplayEvent( 2228 js.Pointer(&ret), 2229 callback.Ref(), 2230 ) 2231 2232 return 2233 } 2234 2235 // TryOnExternalDisplayEvent calls the function "WEBEXT.os.events.onExternalDisplayEvent.addListener" 2236 // in a try/catch block and returns (_, err, ok = false) when it went through 2237 // the catch clause. 2238 func TryOnExternalDisplayEvent(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2239 ok = js.True == bindings.TryOnExternalDisplayEvent( 2240 js.Pointer(&ret), js.Pointer(&exception), 2241 callback.Ref(), 2242 ) 2243 2244 return 2245 } 2246 2247 // HasFuncOffExternalDisplayEvent returns true if the function "WEBEXT.os.events.onExternalDisplayEvent.removeListener" exists. 2248 func HasFuncOffExternalDisplayEvent() bool { 2249 return js.True == bindings.HasFuncOffExternalDisplayEvent() 2250 } 2251 2252 // FuncOffExternalDisplayEvent returns the function "WEBEXT.os.events.onExternalDisplayEvent.removeListener". 2253 func FuncOffExternalDisplayEvent() (fn js.Func[func(callback js.Func[func(event_info *ExternalDisplayEventInfo)])]) { 2254 bindings.FuncOffExternalDisplayEvent( 2255 js.Pointer(&fn), 2256 ) 2257 return 2258 } 2259 2260 // OffExternalDisplayEvent calls the function "WEBEXT.os.events.onExternalDisplayEvent.removeListener" directly. 2261 func OffExternalDisplayEvent(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) (ret js.Void) { 2262 bindings.CallOffExternalDisplayEvent( 2263 js.Pointer(&ret), 2264 callback.Ref(), 2265 ) 2266 2267 return 2268 } 2269 2270 // TryOffExternalDisplayEvent calls the function "WEBEXT.os.events.onExternalDisplayEvent.removeListener" 2271 // in a try/catch block and returns (_, err, ok = false) when it went through 2272 // the catch clause. 2273 func TryOffExternalDisplayEvent(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2274 ok = js.True == bindings.TryOffExternalDisplayEvent( 2275 js.Pointer(&ret), js.Pointer(&exception), 2276 callback.Ref(), 2277 ) 2278 2279 return 2280 } 2281 2282 // HasFuncHasOnExternalDisplayEvent returns true if the function "WEBEXT.os.events.onExternalDisplayEvent.hasListener" exists. 2283 func HasFuncHasOnExternalDisplayEvent() bool { 2284 return js.True == bindings.HasFuncHasOnExternalDisplayEvent() 2285 } 2286 2287 // FuncHasOnExternalDisplayEvent returns the function "WEBEXT.os.events.onExternalDisplayEvent.hasListener". 2288 func FuncHasOnExternalDisplayEvent() (fn js.Func[func(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) bool]) { 2289 bindings.FuncHasOnExternalDisplayEvent( 2290 js.Pointer(&fn), 2291 ) 2292 return 2293 } 2294 2295 // HasOnExternalDisplayEvent calls the function "WEBEXT.os.events.onExternalDisplayEvent.hasListener" directly. 2296 func HasOnExternalDisplayEvent(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) (ret bool) { 2297 bindings.CallHasOnExternalDisplayEvent( 2298 js.Pointer(&ret), 2299 callback.Ref(), 2300 ) 2301 2302 return 2303 } 2304 2305 // TryHasOnExternalDisplayEvent calls the function "WEBEXT.os.events.onExternalDisplayEvent.hasListener" 2306 // in a try/catch block and returns (_, err, ok = false) when it went through 2307 // the catch clause. 2308 func TryHasOnExternalDisplayEvent(callback js.Func[func(event_info *ExternalDisplayEventInfo)]) (ret bool, exception js.Any, ok bool) { 2309 ok = js.True == bindings.TryHasOnExternalDisplayEvent( 2310 js.Pointer(&ret), js.Pointer(&exception), 2311 callback.Ref(), 2312 ) 2313 2314 return 2315 } 2316 2317 type OnKeyboardDiagnosticEventEventCallbackFunc func(this js.Ref, event_info *KeyboardDiagnosticEventInfo) js.Ref 2318 2319 func (fn OnKeyboardDiagnosticEventEventCallbackFunc) Register() js.Func[func(event_info *KeyboardDiagnosticEventInfo)] { 2320 return js.RegisterCallback[func(event_info *KeyboardDiagnosticEventInfo)]( 2321 fn, abi.FuncPCABIInternal(fn), 2322 ) 2323 } 2324 2325 func (fn OnKeyboardDiagnosticEventEventCallbackFunc) DispatchCallback( 2326 targetPC uintptr, ctx *js.CallbackContext, 2327 ) { 2328 args := ctx.Args() 2329 if len(args) != 1+1 /* js this */ || 2330 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2331 js.ThrowInvalidCallbackInvocation() 2332 } 2333 var arg0 KeyboardDiagnosticEventInfo 2334 arg0.UpdateFrom(args[0+1]) 2335 defer arg0.FreeMembers(true) 2336 2337 if ctx.Return(fn( 2338 args[0], 2339 2340 mark.NoEscape(&arg0), 2341 )) { 2342 return 2343 } 2344 2345 js.ThrowCallbackValueNotReturned() 2346 } 2347 2348 type OnKeyboardDiagnosticEventEventCallback[T any] struct { 2349 Fn func(arg T, this js.Ref, event_info *KeyboardDiagnosticEventInfo) js.Ref 2350 Arg T 2351 } 2352 2353 func (cb *OnKeyboardDiagnosticEventEventCallback[T]) Register() js.Func[func(event_info *KeyboardDiagnosticEventInfo)] { 2354 return js.RegisterCallback[func(event_info *KeyboardDiagnosticEventInfo)]( 2355 cb, abi.FuncPCABIInternal(cb.Fn), 2356 ) 2357 } 2358 2359 func (cb *OnKeyboardDiagnosticEventEventCallback[T]) DispatchCallback( 2360 targetPC uintptr, ctx *js.CallbackContext, 2361 ) { 2362 args := ctx.Args() 2363 if len(args) != 1+1 /* js this */ || 2364 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2365 js.ThrowInvalidCallbackInvocation() 2366 } 2367 var arg0 KeyboardDiagnosticEventInfo 2368 arg0.UpdateFrom(args[0+1]) 2369 defer arg0.FreeMembers(true) 2370 2371 if ctx.Return(cb.Fn( 2372 cb.Arg, 2373 args[0], 2374 2375 mark.NoEscape(&arg0), 2376 )) { 2377 return 2378 } 2379 2380 js.ThrowCallbackValueNotReturned() 2381 } 2382 2383 // HasFuncOnKeyboardDiagnosticEvent returns true if the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.addListener" exists. 2384 func HasFuncOnKeyboardDiagnosticEvent() bool { 2385 return js.True == bindings.HasFuncOnKeyboardDiagnosticEvent() 2386 } 2387 2388 // FuncOnKeyboardDiagnosticEvent returns the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.addListener". 2389 func FuncOnKeyboardDiagnosticEvent() (fn js.Func[func(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)])]) { 2390 bindings.FuncOnKeyboardDiagnosticEvent( 2391 js.Pointer(&fn), 2392 ) 2393 return 2394 } 2395 2396 // OnKeyboardDiagnosticEvent calls the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.addListener" directly. 2397 func OnKeyboardDiagnosticEvent(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) (ret js.Void) { 2398 bindings.CallOnKeyboardDiagnosticEvent( 2399 js.Pointer(&ret), 2400 callback.Ref(), 2401 ) 2402 2403 return 2404 } 2405 2406 // TryOnKeyboardDiagnosticEvent calls the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.addListener" 2407 // in a try/catch block and returns (_, err, ok = false) when it went through 2408 // the catch clause. 2409 func TryOnKeyboardDiagnosticEvent(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2410 ok = js.True == bindings.TryOnKeyboardDiagnosticEvent( 2411 js.Pointer(&ret), js.Pointer(&exception), 2412 callback.Ref(), 2413 ) 2414 2415 return 2416 } 2417 2418 // HasFuncOffKeyboardDiagnosticEvent returns true if the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.removeListener" exists. 2419 func HasFuncOffKeyboardDiagnosticEvent() bool { 2420 return js.True == bindings.HasFuncOffKeyboardDiagnosticEvent() 2421 } 2422 2423 // FuncOffKeyboardDiagnosticEvent returns the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.removeListener". 2424 func FuncOffKeyboardDiagnosticEvent() (fn js.Func[func(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)])]) { 2425 bindings.FuncOffKeyboardDiagnosticEvent( 2426 js.Pointer(&fn), 2427 ) 2428 return 2429 } 2430 2431 // OffKeyboardDiagnosticEvent calls the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.removeListener" directly. 2432 func OffKeyboardDiagnosticEvent(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) (ret js.Void) { 2433 bindings.CallOffKeyboardDiagnosticEvent( 2434 js.Pointer(&ret), 2435 callback.Ref(), 2436 ) 2437 2438 return 2439 } 2440 2441 // TryOffKeyboardDiagnosticEvent calls the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.removeListener" 2442 // in a try/catch block and returns (_, err, ok = false) when it went through 2443 // the catch clause. 2444 func TryOffKeyboardDiagnosticEvent(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2445 ok = js.True == bindings.TryOffKeyboardDiagnosticEvent( 2446 js.Pointer(&ret), js.Pointer(&exception), 2447 callback.Ref(), 2448 ) 2449 2450 return 2451 } 2452 2453 // HasFuncHasOnKeyboardDiagnosticEvent returns true if the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.hasListener" exists. 2454 func HasFuncHasOnKeyboardDiagnosticEvent() bool { 2455 return js.True == bindings.HasFuncHasOnKeyboardDiagnosticEvent() 2456 } 2457 2458 // FuncHasOnKeyboardDiagnosticEvent returns the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.hasListener". 2459 func FuncHasOnKeyboardDiagnosticEvent() (fn js.Func[func(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) bool]) { 2460 bindings.FuncHasOnKeyboardDiagnosticEvent( 2461 js.Pointer(&fn), 2462 ) 2463 return 2464 } 2465 2466 // HasOnKeyboardDiagnosticEvent calls the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.hasListener" directly. 2467 func HasOnKeyboardDiagnosticEvent(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) (ret bool) { 2468 bindings.CallHasOnKeyboardDiagnosticEvent( 2469 js.Pointer(&ret), 2470 callback.Ref(), 2471 ) 2472 2473 return 2474 } 2475 2476 // TryHasOnKeyboardDiagnosticEvent calls the function "WEBEXT.os.events.onKeyboardDiagnosticEvent.hasListener" 2477 // in a try/catch block and returns (_, err, ok = false) when it went through 2478 // the catch clause. 2479 func TryHasOnKeyboardDiagnosticEvent(callback js.Func[func(event_info *KeyboardDiagnosticEventInfo)]) (ret bool, exception js.Any, ok bool) { 2480 ok = js.True == bindings.TryHasOnKeyboardDiagnosticEvent( 2481 js.Pointer(&ret), js.Pointer(&exception), 2482 callback.Ref(), 2483 ) 2484 2485 return 2486 } 2487 2488 type OnLidEventEventCallbackFunc func(this js.Ref, event_info *LidEventInfo) js.Ref 2489 2490 func (fn OnLidEventEventCallbackFunc) Register() js.Func[func(event_info *LidEventInfo)] { 2491 return js.RegisterCallback[func(event_info *LidEventInfo)]( 2492 fn, abi.FuncPCABIInternal(fn), 2493 ) 2494 } 2495 2496 func (fn OnLidEventEventCallbackFunc) DispatchCallback( 2497 targetPC uintptr, ctx *js.CallbackContext, 2498 ) { 2499 args := ctx.Args() 2500 if len(args) != 1+1 /* js this */ || 2501 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2502 js.ThrowInvalidCallbackInvocation() 2503 } 2504 var arg0 LidEventInfo 2505 arg0.UpdateFrom(args[0+1]) 2506 defer arg0.FreeMembers(true) 2507 2508 if ctx.Return(fn( 2509 args[0], 2510 2511 mark.NoEscape(&arg0), 2512 )) { 2513 return 2514 } 2515 2516 js.ThrowCallbackValueNotReturned() 2517 } 2518 2519 type OnLidEventEventCallback[T any] struct { 2520 Fn func(arg T, this js.Ref, event_info *LidEventInfo) js.Ref 2521 Arg T 2522 } 2523 2524 func (cb *OnLidEventEventCallback[T]) Register() js.Func[func(event_info *LidEventInfo)] { 2525 return js.RegisterCallback[func(event_info *LidEventInfo)]( 2526 cb, abi.FuncPCABIInternal(cb.Fn), 2527 ) 2528 } 2529 2530 func (cb *OnLidEventEventCallback[T]) DispatchCallback( 2531 targetPC uintptr, ctx *js.CallbackContext, 2532 ) { 2533 args := ctx.Args() 2534 if len(args) != 1+1 /* js this */ || 2535 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2536 js.ThrowInvalidCallbackInvocation() 2537 } 2538 var arg0 LidEventInfo 2539 arg0.UpdateFrom(args[0+1]) 2540 defer arg0.FreeMembers(true) 2541 2542 if ctx.Return(cb.Fn( 2543 cb.Arg, 2544 args[0], 2545 2546 mark.NoEscape(&arg0), 2547 )) { 2548 return 2549 } 2550 2551 js.ThrowCallbackValueNotReturned() 2552 } 2553 2554 // HasFuncOnLidEvent returns true if the function "WEBEXT.os.events.onLidEvent.addListener" exists. 2555 func HasFuncOnLidEvent() bool { 2556 return js.True == bindings.HasFuncOnLidEvent() 2557 } 2558 2559 // FuncOnLidEvent returns the function "WEBEXT.os.events.onLidEvent.addListener". 2560 func FuncOnLidEvent() (fn js.Func[func(callback js.Func[func(event_info *LidEventInfo)])]) { 2561 bindings.FuncOnLidEvent( 2562 js.Pointer(&fn), 2563 ) 2564 return 2565 } 2566 2567 // OnLidEvent calls the function "WEBEXT.os.events.onLidEvent.addListener" directly. 2568 func OnLidEvent(callback js.Func[func(event_info *LidEventInfo)]) (ret js.Void) { 2569 bindings.CallOnLidEvent( 2570 js.Pointer(&ret), 2571 callback.Ref(), 2572 ) 2573 2574 return 2575 } 2576 2577 // TryOnLidEvent calls the function "WEBEXT.os.events.onLidEvent.addListener" 2578 // in a try/catch block and returns (_, err, ok = false) when it went through 2579 // the catch clause. 2580 func TryOnLidEvent(callback js.Func[func(event_info *LidEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2581 ok = js.True == bindings.TryOnLidEvent( 2582 js.Pointer(&ret), js.Pointer(&exception), 2583 callback.Ref(), 2584 ) 2585 2586 return 2587 } 2588 2589 // HasFuncOffLidEvent returns true if the function "WEBEXT.os.events.onLidEvent.removeListener" exists. 2590 func HasFuncOffLidEvent() bool { 2591 return js.True == bindings.HasFuncOffLidEvent() 2592 } 2593 2594 // FuncOffLidEvent returns the function "WEBEXT.os.events.onLidEvent.removeListener". 2595 func FuncOffLidEvent() (fn js.Func[func(callback js.Func[func(event_info *LidEventInfo)])]) { 2596 bindings.FuncOffLidEvent( 2597 js.Pointer(&fn), 2598 ) 2599 return 2600 } 2601 2602 // OffLidEvent calls the function "WEBEXT.os.events.onLidEvent.removeListener" directly. 2603 func OffLidEvent(callback js.Func[func(event_info *LidEventInfo)]) (ret js.Void) { 2604 bindings.CallOffLidEvent( 2605 js.Pointer(&ret), 2606 callback.Ref(), 2607 ) 2608 2609 return 2610 } 2611 2612 // TryOffLidEvent calls the function "WEBEXT.os.events.onLidEvent.removeListener" 2613 // in a try/catch block and returns (_, err, ok = false) when it went through 2614 // the catch clause. 2615 func TryOffLidEvent(callback js.Func[func(event_info *LidEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2616 ok = js.True == bindings.TryOffLidEvent( 2617 js.Pointer(&ret), js.Pointer(&exception), 2618 callback.Ref(), 2619 ) 2620 2621 return 2622 } 2623 2624 // HasFuncHasOnLidEvent returns true if the function "WEBEXT.os.events.onLidEvent.hasListener" exists. 2625 func HasFuncHasOnLidEvent() bool { 2626 return js.True == bindings.HasFuncHasOnLidEvent() 2627 } 2628 2629 // FuncHasOnLidEvent returns the function "WEBEXT.os.events.onLidEvent.hasListener". 2630 func FuncHasOnLidEvent() (fn js.Func[func(callback js.Func[func(event_info *LidEventInfo)]) bool]) { 2631 bindings.FuncHasOnLidEvent( 2632 js.Pointer(&fn), 2633 ) 2634 return 2635 } 2636 2637 // HasOnLidEvent calls the function "WEBEXT.os.events.onLidEvent.hasListener" directly. 2638 func HasOnLidEvent(callback js.Func[func(event_info *LidEventInfo)]) (ret bool) { 2639 bindings.CallHasOnLidEvent( 2640 js.Pointer(&ret), 2641 callback.Ref(), 2642 ) 2643 2644 return 2645 } 2646 2647 // TryHasOnLidEvent calls the function "WEBEXT.os.events.onLidEvent.hasListener" 2648 // in a try/catch block and returns (_, err, ok = false) when it went through 2649 // the catch clause. 2650 func TryHasOnLidEvent(callback js.Func[func(event_info *LidEventInfo)]) (ret bool, exception js.Any, ok bool) { 2651 ok = js.True == bindings.TryHasOnLidEvent( 2652 js.Pointer(&ret), js.Pointer(&exception), 2653 callback.Ref(), 2654 ) 2655 2656 return 2657 } 2658 2659 type OnPowerEventEventCallbackFunc func(this js.Ref, event_info *PowerEventInfo) js.Ref 2660 2661 func (fn OnPowerEventEventCallbackFunc) Register() js.Func[func(event_info *PowerEventInfo)] { 2662 return js.RegisterCallback[func(event_info *PowerEventInfo)]( 2663 fn, abi.FuncPCABIInternal(fn), 2664 ) 2665 } 2666 2667 func (fn OnPowerEventEventCallbackFunc) DispatchCallback( 2668 targetPC uintptr, ctx *js.CallbackContext, 2669 ) { 2670 args := ctx.Args() 2671 if len(args) != 1+1 /* js this */ || 2672 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2673 js.ThrowInvalidCallbackInvocation() 2674 } 2675 var arg0 PowerEventInfo 2676 arg0.UpdateFrom(args[0+1]) 2677 defer arg0.FreeMembers(true) 2678 2679 if ctx.Return(fn( 2680 args[0], 2681 2682 mark.NoEscape(&arg0), 2683 )) { 2684 return 2685 } 2686 2687 js.ThrowCallbackValueNotReturned() 2688 } 2689 2690 type OnPowerEventEventCallback[T any] struct { 2691 Fn func(arg T, this js.Ref, event_info *PowerEventInfo) js.Ref 2692 Arg T 2693 } 2694 2695 func (cb *OnPowerEventEventCallback[T]) Register() js.Func[func(event_info *PowerEventInfo)] { 2696 return js.RegisterCallback[func(event_info *PowerEventInfo)]( 2697 cb, abi.FuncPCABIInternal(cb.Fn), 2698 ) 2699 } 2700 2701 func (cb *OnPowerEventEventCallback[T]) DispatchCallback( 2702 targetPC uintptr, ctx *js.CallbackContext, 2703 ) { 2704 args := ctx.Args() 2705 if len(args) != 1+1 /* js this */ || 2706 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2707 js.ThrowInvalidCallbackInvocation() 2708 } 2709 var arg0 PowerEventInfo 2710 arg0.UpdateFrom(args[0+1]) 2711 defer arg0.FreeMembers(true) 2712 2713 if ctx.Return(cb.Fn( 2714 cb.Arg, 2715 args[0], 2716 2717 mark.NoEscape(&arg0), 2718 )) { 2719 return 2720 } 2721 2722 js.ThrowCallbackValueNotReturned() 2723 } 2724 2725 // HasFuncOnPowerEvent returns true if the function "WEBEXT.os.events.onPowerEvent.addListener" exists. 2726 func HasFuncOnPowerEvent() bool { 2727 return js.True == bindings.HasFuncOnPowerEvent() 2728 } 2729 2730 // FuncOnPowerEvent returns the function "WEBEXT.os.events.onPowerEvent.addListener". 2731 func FuncOnPowerEvent() (fn js.Func[func(callback js.Func[func(event_info *PowerEventInfo)])]) { 2732 bindings.FuncOnPowerEvent( 2733 js.Pointer(&fn), 2734 ) 2735 return 2736 } 2737 2738 // OnPowerEvent calls the function "WEBEXT.os.events.onPowerEvent.addListener" directly. 2739 func OnPowerEvent(callback js.Func[func(event_info *PowerEventInfo)]) (ret js.Void) { 2740 bindings.CallOnPowerEvent( 2741 js.Pointer(&ret), 2742 callback.Ref(), 2743 ) 2744 2745 return 2746 } 2747 2748 // TryOnPowerEvent calls the function "WEBEXT.os.events.onPowerEvent.addListener" 2749 // in a try/catch block and returns (_, err, ok = false) when it went through 2750 // the catch clause. 2751 func TryOnPowerEvent(callback js.Func[func(event_info *PowerEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2752 ok = js.True == bindings.TryOnPowerEvent( 2753 js.Pointer(&ret), js.Pointer(&exception), 2754 callback.Ref(), 2755 ) 2756 2757 return 2758 } 2759 2760 // HasFuncOffPowerEvent returns true if the function "WEBEXT.os.events.onPowerEvent.removeListener" exists. 2761 func HasFuncOffPowerEvent() bool { 2762 return js.True == bindings.HasFuncOffPowerEvent() 2763 } 2764 2765 // FuncOffPowerEvent returns the function "WEBEXT.os.events.onPowerEvent.removeListener". 2766 func FuncOffPowerEvent() (fn js.Func[func(callback js.Func[func(event_info *PowerEventInfo)])]) { 2767 bindings.FuncOffPowerEvent( 2768 js.Pointer(&fn), 2769 ) 2770 return 2771 } 2772 2773 // OffPowerEvent calls the function "WEBEXT.os.events.onPowerEvent.removeListener" directly. 2774 func OffPowerEvent(callback js.Func[func(event_info *PowerEventInfo)]) (ret js.Void) { 2775 bindings.CallOffPowerEvent( 2776 js.Pointer(&ret), 2777 callback.Ref(), 2778 ) 2779 2780 return 2781 } 2782 2783 // TryOffPowerEvent calls the function "WEBEXT.os.events.onPowerEvent.removeListener" 2784 // in a try/catch block and returns (_, err, ok = false) when it went through 2785 // the catch clause. 2786 func TryOffPowerEvent(callback js.Func[func(event_info *PowerEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2787 ok = js.True == bindings.TryOffPowerEvent( 2788 js.Pointer(&ret), js.Pointer(&exception), 2789 callback.Ref(), 2790 ) 2791 2792 return 2793 } 2794 2795 // HasFuncHasOnPowerEvent returns true if the function "WEBEXT.os.events.onPowerEvent.hasListener" exists. 2796 func HasFuncHasOnPowerEvent() bool { 2797 return js.True == bindings.HasFuncHasOnPowerEvent() 2798 } 2799 2800 // FuncHasOnPowerEvent returns the function "WEBEXT.os.events.onPowerEvent.hasListener". 2801 func FuncHasOnPowerEvent() (fn js.Func[func(callback js.Func[func(event_info *PowerEventInfo)]) bool]) { 2802 bindings.FuncHasOnPowerEvent( 2803 js.Pointer(&fn), 2804 ) 2805 return 2806 } 2807 2808 // HasOnPowerEvent calls the function "WEBEXT.os.events.onPowerEvent.hasListener" directly. 2809 func HasOnPowerEvent(callback js.Func[func(event_info *PowerEventInfo)]) (ret bool) { 2810 bindings.CallHasOnPowerEvent( 2811 js.Pointer(&ret), 2812 callback.Ref(), 2813 ) 2814 2815 return 2816 } 2817 2818 // TryHasOnPowerEvent calls the function "WEBEXT.os.events.onPowerEvent.hasListener" 2819 // in a try/catch block and returns (_, err, ok = false) when it went through 2820 // the catch clause. 2821 func TryHasOnPowerEvent(callback js.Func[func(event_info *PowerEventInfo)]) (ret bool, exception js.Any, ok bool) { 2822 ok = js.True == bindings.TryHasOnPowerEvent( 2823 js.Pointer(&ret), js.Pointer(&exception), 2824 callback.Ref(), 2825 ) 2826 2827 return 2828 } 2829 2830 type OnSdCardEventEventCallbackFunc func(this js.Ref, event_info *SdCardEventInfo) js.Ref 2831 2832 func (fn OnSdCardEventEventCallbackFunc) Register() js.Func[func(event_info *SdCardEventInfo)] { 2833 return js.RegisterCallback[func(event_info *SdCardEventInfo)]( 2834 fn, abi.FuncPCABIInternal(fn), 2835 ) 2836 } 2837 2838 func (fn OnSdCardEventEventCallbackFunc) DispatchCallback( 2839 targetPC uintptr, ctx *js.CallbackContext, 2840 ) { 2841 args := ctx.Args() 2842 if len(args) != 1+1 /* js this */ || 2843 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2844 js.ThrowInvalidCallbackInvocation() 2845 } 2846 var arg0 SdCardEventInfo 2847 arg0.UpdateFrom(args[0+1]) 2848 defer arg0.FreeMembers(true) 2849 2850 if ctx.Return(fn( 2851 args[0], 2852 2853 mark.NoEscape(&arg0), 2854 )) { 2855 return 2856 } 2857 2858 js.ThrowCallbackValueNotReturned() 2859 } 2860 2861 type OnSdCardEventEventCallback[T any] struct { 2862 Fn func(arg T, this js.Ref, event_info *SdCardEventInfo) js.Ref 2863 Arg T 2864 } 2865 2866 func (cb *OnSdCardEventEventCallback[T]) Register() js.Func[func(event_info *SdCardEventInfo)] { 2867 return js.RegisterCallback[func(event_info *SdCardEventInfo)]( 2868 cb, abi.FuncPCABIInternal(cb.Fn), 2869 ) 2870 } 2871 2872 func (cb *OnSdCardEventEventCallback[T]) DispatchCallback( 2873 targetPC uintptr, ctx *js.CallbackContext, 2874 ) { 2875 args := ctx.Args() 2876 if len(args) != 1+1 /* js this */ || 2877 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2878 js.ThrowInvalidCallbackInvocation() 2879 } 2880 var arg0 SdCardEventInfo 2881 arg0.UpdateFrom(args[0+1]) 2882 defer arg0.FreeMembers(true) 2883 2884 if ctx.Return(cb.Fn( 2885 cb.Arg, 2886 args[0], 2887 2888 mark.NoEscape(&arg0), 2889 )) { 2890 return 2891 } 2892 2893 js.ThrowCallbackValueNotReturned() 2894 } 2895 2896 // HasFuncOnSdCardEvent returns true if the function "WEBEXT.os.events.onSdCardEvent.addListener" exists. 2897 func HasFuncOnSdCardEvent() bool { 2898 return js.True == bindings.HasFuncOnSdCardEvent() 2899 } 2900 2901 // FuncOnSdCardEvent returns the function "WEBEXT.os.events.onSdCardEvent.addListener". 2902 func FuncOnSdCardEvent() (fn js.Func[func(callback js.Func[func(event_info *SdCardEventInfo)])]) { 2903 bindings.FuncOnSdCardEvent( 2904 js.Pointer(&fn), 2905 ) 2906 return 2907 } 2908 2909 // OnSdCardEvent calls the function "WEBEXT.os.events.onSdCardEvent.addListener" directly. 2910 func OnSdCardEvent(callback js.Func[func(event_info *SdCardEventInfo)]) (ret js.Void) { 2911 bindings.CallOnSdCardEvent( 2912 js.Pointer(&ret), 2913 callback.Ref(), 2914 ) 2915 2916 return 2917 } 2918 2919 // TryOnSdCardEvent calls the function "WEBEXT.os.events.onSdCardEvent.addListener" 2920 // in a try/catch block and returns (_, err, ok = false) when it went through 2921 // the catch clause. 2922 func TryOnSdCardEvent(callback js.Func[func(event_info *SdCardEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2923 ok = js.True == bindings.TryOnSdCardEvent( 2924 js.Pointer(&ret), js.Pointer(&exception), 2925 callback.Ref(), 2926 ) 2927 2928 return 2929 } 2930 2931 // HasFuncOffSdCardEvent returns true if the function "WEBEXT.os.events.onSdCardEvent.removeListener" exists. 2932 func HasFuncOffSdCardEvent() bool { 2933 return js.True == bindings.HasFuncOffSdCardEvent() 2934 } 2935 2936 // FuncOffSdCardEvent returns the function "WEBEXT.os.events.onSdCardEvent.removeListener". 2937 func FuncOffSdCardEvent() (fn js.Func[func(callback js.Func[func(event_info *SdCardEventInfo)])]) { 2938 bindings.FuncOffSdCardEvent( 2939 js.Pointer(&fn), 2940 ) 2941 return 2942 } 2943 2944 // OffSdCardEvent calls the function "WEBEXT.os.events.onSdCardEvent.removeListener" directly. 2945 func OffSdCardEvent(callback js.Func[func(event_info *SdCardEventInfo)]) (ret js.Void) { 2946 bindings.CallOffSdCardEvent( 2947 js.Pointer(&ret), 2948 callback.Ref(), 2949 ) 2950 2951 return 2952 } 2953 2954 // TryOffSdCardEvent calls the function "WEBEXT.os.events.onSdCardEvent.removeListener" 2955 // in a try/catch block and returns (_, err, ok = false) when it went through 2956 // the catch clause. 2957 func TryOffSdCardEvent(callback js.Func[func(event_info *SdCardEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 2958 ok = js.True == bindings.TryOffSdCardEvent( 2959 js.Pointer(&ret), js.Pointer(&exception), 2960 callback.Ref(), 2961 ) 2962 2963 return 2964 } 2965 2966 // HasFuncHasOnSdCardEvent returns true if the function "WEBEXT.os.events.onSdCardEvent.hasListener" exists. 2967 func HasFuncHasOnSdCardEvent() bool { 2968 return js.True == bindings.HasFuncHasOnSdCardEvent() 2969 } 2970 2971 // FuncHasOnSdCardEvent returns the function "WEBEXT.os.events.onSdCardEvent.hasListener". 2972 func FuncHasOnSdCardEvent() (fn js.Func[func(callback js.Func[func(event_info *SdCardEventInfo)]) bool]) { 2973 bindings.FuncHasOnSdCardEvent( 2974 js.Pointer(&fn), 2975 ) 2976 return 2977 } 2978 2979 // HasOnSdCardEvent calls the function "WEBEXT.os.events.onSdCardEvent.hasListener" directly. 2980 func HasOnSdCardEvent(callback js.Func[func(event_info *SdCardEventInfo)]) (ret bool) { 2981 bindings.CallHasOnSdCardEvent( 2982 js.Pointer(&ret), 2983 callback.Ref(), 2984 ) 2985 2986 return 2987 } 2988 2989 // TryHasOnSdCardEvent calls the function "WEBEXT.os.events.onSdCardEvent.hasListener" 2990 // in a try/catch block and returns (_, err, ok = false) when it went through 2991 // the catch clause. 2992 func TryHasOnSdCardEvent(callback js.Func[func(event_info *SdCardEventInfo)]) (ret bool, exception js.Any, ok bool) { 2993 ok = js.True == bindings.TryHasOnSdCardEvent( 2994 js.Pointer(&ret), js.Pointer(&exception), 2995 callback.Ref(), 2996 ) 2997 2998 return 2999 } 3000 3001 type OnStylusConnectedEventEventCallbackFunc func(this js.Ref, event_info *StylusConnectedEventInfo) js.Ref 3002 3003 func (fn OnStylusConnectedEventEventCallbackFunc) Register() js.Func[func(event_info *StylusConnectedEventInfo)] { 3004 return js.RegisterCallback[func(event_info *StylusConnectedEventInfo)]( 3005 fn, abi.FuncPCABIInternal(fn), 3006 ) 3007 } 3008 3009 func (fn OnStylusConnectedEventEventCallbackFunc) DispatchCallback( 3010 targetPC uintptr, ctx *js.CallbackContext, 3011 ) { 3012 args := ctx.Args() 3013 if len(args) != 1+1 /* js this */ || 3014 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3015 js.ThrowInvalidCallbackInvocation() 3016 } 3017 var arg0 StylusConnectedEventInfo 3018 arg0.UpdateFrom(args[0+1]) 3019 defer arg0.FreeMembers(true) 3020 3021 if ctx.Return(fn( 3022 args[0], 3023 3024 mark.NoEscape(&arg0), 3025 )) { 3026 return 3027 } 3028 3029 js.ThrowCallbackValueNotReturned() 3030 } 3031 3032 type OnStylusConnectedEventEventCallback[T any] struct { 3033 Fn func(arg T, this js.Ref, event_info *StylusConnectedEventInfo) js.Ref 3034 Arg T 3035 } 3036 3037 func (cb *OnStylusConnectedEventEventCallback[T]) Register() js.Func[func(event_info *StylusConnectedEventInfo)] { 3038 return js.RegisterCallback[func(event_info *StylusConnectedEventInfo)]( 3039 cb, abi.FuncPCABIInternal(cb.Fn), 3040 ) 3041 } 3042 3043 func (cb *OnStylusConnectedEventEventCallback[T]) DispatchCallback( 3044 targetPC uintptr, ctx *js.CallbackContext, 3045 ) { 3046 args := ctx.Args() 3047 if len(args) != 1+1 /* js this */ || 3048 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3049 js.ThrowInvalidCallbackInvocation() 3050 } 3051 var arg0 StylusConnectedEventInfo 3052 arg0.UpdateFrom(args[0+1]) 3053 defer arg0.FreeMembers(true) 3054 3055 if ctx.Return(cb.Fn( 3056 cb.Arg, 3057 args[0], 3058 3059 mark.NoEscape(&arg0), 3060 )) { 3061 return 3062 } 3063 3064 js.ThrowCallbackValueNotReturned() 3065 } 3066 3067 // HasFuncOnStylusConnectedEvent returns true if the function "WEBEXT.os.events.onStylusConnectedEvent.addListener" exists. 3068 func HasFuncOnStylusConnectedEvent() bool { 3069 return js.True == bindings.HasFuncOnStylusConnectedEvent() 3070 } 3071 3072 // FuncOnStylusConnectedEvent returns the function "WEBEXT.os.events.onStylusConnectedEvent.addListener". 3073 func FuncOnStylusConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusConnectedEventInfo)])]) { 3074 bindings.FuncOnStylusConnectedEvent( 3075 js.Pointer(&fn), 3076 ) 3077 return 3078 } 3079 3080 // OnStylusConnectedEvent calls the function "WEBEXT.os.events.onStylusConnectedEvent.addListener" directly. 3081 func OnStylusConnectedEvent(callback js.Func[func(event_info *StylusConnectedEventInfo)]) (ret js.Void) { 3082 bindings.CallOnStylusConnectedEvent( 3083 js.Pointer(&ret), 3084 callback.Ref(), 3085 ) 3086 3087 return 3088 } 3089 3090 // TryOnStylusConnectedEvent calls the function "WEBEXT.os.events.onStylusConnectedEvent.addListener" 3091 // in a try/catch block and returns (_, err, ok = false) when it went through 3092 // the catch clause. 3093 func TryOnStylusConnectedEvent(callback js.Func[func(event_info *StylusConnectedEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3094 ok = js.True == bindings.TryOnStylusConnectedEvent( 3095 js.Pointer(&ret), js.Pointer(&exception), 3096 callback.Ref(), 3097 ) 3098 3099 return 3100 } 3101 3102 // HasFuncOffStylusConnectedEvent returns true if the function "WEBEXT.os.events.onStylusConnectedEvent.removeListener" exists. 3103 func HasFuncOffStylusConnectedEvent() bool { 3104 return js.True == bindings.HasFuncOffStylusConnectedEvent() 3105 } 3106 3107 // FuncOffStylusConnectedEvent returns the function "WEBEXT.os.events.onStylusConnectedEvent.removeListener". 3108 func FuncOffStylusConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusConnectedEventInfo)])]) { 3109 bindings.FuncOffStylusConnectedEvent( 3110 js.Pointer(&fn), 3111 ) 3112 return 3113 } 3114 3115 // OffStylusConnectedEvent calls the function "WEBEXT.os.events.onStylusConnectedEvent.removeListener" directly. 3116 func OffStylusConnectedEvent(callback js.Func[func(event_info *StylusConnectedEventInfo)]) (ret js.Void) { 3117 bindings.CallOffStylusConnectedEvent( 3118 js.Pointer(&ret), 3119 callback.Ref(), 3120 ) 3121 3122 return 3123 } 3124 3125 // TryOffStylusConnectedEvent calls the function "WEBEXT.os.events.onStylusConnectedEvent.removeListener" 3126 // in a try/catch block and returns (_, err, ok = false) when it went through 3127 // the catch clause. 3128 func TryOffStylusConnectedEvent(callback js.Func[func(event_info *StylusConnectedEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3129 ok = js.True == bindings.TryOffStylusConnectedEvent( 3130 js.Pointer(&ret), js.Pointer(&exception), 3131 callback.Ref(), 3132 ) 3133 3134 return 3135 } 3136 3137 // HasFuncHasOnStylusConnectedEvent returns true if the function "WEBEXT.os.events.onStylusConnectedEvent.hasListener" exists. 3138 func HasFuncHasOnStylusConnectedEvent() bool { 3139 return js.True == bindings.HasFuncHasOnStylusConnectedEvent() 3140 } 3141 3142 // FuncHasOnStylusConnectedEvent returns the function "WEBEXT.os.events.onStylusConnectedEvent.hasListener". 3143 func FuncHasOnStylusConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusConnectedEventInfo)]) bool]) { 3144 bindings.FuncHasOnStylusConnectedEvent( 3145 js.Pointer(&fn), 3146 ) 3147 return 3148 } 3149 3150 // HasOnStylusConnectedEvent calls the function "WEBEXT.os.events.onStylusConnectedEvent.hasListener" directly. 3151 func HasOnStylusConnectedEvent(callback js.Func[func(event_info *StylusConnectedEventInfo)]) (ret bool) { 3152 bindings.CallHasOnStylusConnectedEvent( 3153 js.Pointer(&ret), 3154 callback.Ref(), 3155 ) 3156 3157 return 3158 } 3159 3160 // TryHasOnStylusConnectedEvent calls the function "WEBEXT.os.events.onStylusConnectedEvent.hasListener" 3161 // in a try/catch block and returns (_, err, ok = false) when it went through 3162 // the catch clause. 3163 func TryHasOnStylusConnectedEvent(callback js.Func[func(event_info *StylusConnectedEventInfo)]) (ret bool, exception js.Any, ok bool) { 3164 ok = js.True == bindings.TryHasOnStylusConnectedEvent( 3165 js.Pointer(&ret), js.Pointer(&exception), 3166 callback.Ref(), 3167 ) 3168 3169 return 3170 } 3171 3172 type OnStylusGarageEventEventCallbackFunc func(this js.Ref, event_info *StylusGarageEventInfo) js.Ref 3173 3174 func (fn OnStylusGarageEventEventCallbackFunc) Register() js.Func[func(event_info *StylusGarageEventInfo)] { 3175 return js.RegisterCallback[func(event_info *StylusGarageEventInfo)]( 3176 fn, abi.FuncPCABIInternal(fn), 3177 ) 3178 } 3179 3180 func (fn OnStylusGarageEventEventCallbackFunc) DispatchCallback( 3181 targetPC uintptr, ctx *js.CallbackContext, 3182 ) { 3183 args := ctx.Args() 3184 if len(args) != 1+1 /* js this */ || 3185 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3186 js.ThrowInvalidCallbackInvocation() 3187 } 3188 var arg0 StylusGarageEventInfo 3189 arg0.UpdateFrom(args[0+1]) 3190 defer arg0.FreeMembers(true) 3191 3192 if ctx.Return(fn( 3193 args[0], 3194 3195 mark.NoEscape(&arg0), 3196 )) { 3197 return 3198 } 3199 3200 js.ThrowCallbackValueNotReturned() 3201 } 3202 3203 type OnStylusGarageEventEventCallback[T any] struct { 3204 Fn func(arg T, this js.Ref, event_info *StylusGarageEventInfo) js.Ref 3205 Arg T 3206 } 3207 3208 func (cb *OnStylusGarageEventEventCallback[T]) Register() js.Func[func(event_info *StylusGarageEventInfo)] { 3209 return js.RegisterCallback[func(event_info *StylusGarageEventInfo)]( 3210 cb, abi.FuncPCABIInternal(cb.Fn), 3211 ) 3212 } 3213 3214 func (cb *OnStylusGarageEventEventCallback[T]) DispatchCallback( 3215 targetPC uintptr, ctx *js.CallbackContext, 3216 ) { 3217 args := ctx.Args() 3218 if len(args) != 1+1 /* js this */ || 3219 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3220 js.ThrowInvalidCallbackInvocation() 3221 } 3222 var arg0 StylusGarageEventInfo 3223 arg0.UpdateFrom(args[0+1]) 3224 defer arg0.FreeMembers(true) 3225 3226 if ctx.Return(cb.Fn( 3227 cb.Arg, 3228 args[0], 3229 3230 mark.NoEscape(&arg0), 3231 )) { 3232 return 3233 } 3234 3235 js.ThrowCallbackValueNotReturned() 3236 } 3237 3238 // HasFuncOnStylusGarageEvent returns true if the function "WEBEXT.os.events.onStylusGarageEvent.addListener" exists. 3239 func HasFuncOnStylusGarageEvent() bool { 3240 return js.True == bindings.HasFuncOnStylusGarageEvent() 3241 } 3242 3243 // FuncOnStylusGarageEvent returns the function "WEBEXT.os.events.onStylusGarageEvent.addListener". 3244 func FuncOnStylusGarageEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusGarageEventInfo)])]) { 3245 bindings.FuncOnStylusGarageEvent( 3246 js.Pointer(&fn), 3247 ) 3248 return 3249 } 3250 3251 // OnStylusGarageEvent calls the function "WEBEXT.os.events.onStylusGarageEvent.addListener" directly. 3252 func OnStylusGarageEvent(callback js.Func[func(event_info *StylusGarageEventInfo)]) (ret js.Void) { 3253 bindings.CallOnStylusGarageEvent( 3254 js.Pointer(&ret), 3255 callback.Ref(), 3256 ) 3257 3258 return 3259 } 3260 3261 // TryOnStylusGarageEvent calls the function "WEBEXT.os.events.onStylusGarageEvent.addListener" 3262 // in a try/catch block and returns (_, err, ok = false) when it went through 3263 // the catch clause. 3264 func TryOnStylusGarageEvent(callback js.Func[func(event_info *StylusGarageEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3265 ok = js.True == bindings.TryOnStylusGarageEvent( 3266 js.Pointer(&ret), js.Pointer(&exception), 3267 callback.Ref(), 3268 ) 3269 3270 return 3271 } 3272 3273 // HasFuncOffStylusGarageEvent returns true if the function "WEBEXT.os.events.onStylusGarageEvent.removeListener" exists. 3274 func HasFuncOffStylusGarageEvent() bool { 3275 return js.True == bindings.HasFuncOffStylusGarageEvent() 3276 } 3277 3278 // FuncOffStylusGarageEvent returns the function "WEBEXT.os.events.onStylusGarageEvent.removeListener". 3279 func FuncOffStylusGarageEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusGarageEventInfo)])]) { 3280 bindings.FuncOffStylusGarageEvent( 3281 js.Pointer(&fn), 3282 ) 3283 return 3284 } 3285 3286 // OffStylusGarageEvent calls the function "WEBEXT.os.events.onStylusGarageEvent.removeListener" directly. 3287 func OffStylusGarageEvent(callback js.Func[func(event_info *StylusGarageEventInfo)]) (ret js.Void) { 3288 bindings.CallOffStylusGarageEvent( 3289 js.Pointer(&ret), 3290 callback.Ref(), 3291 ) 3292 3293 return 3294 } 3295 3296 // TryOffStylusGarageEvent calls the function "WEBEXT.os.events.onStylusGarageEvent.removeListener" 3297 // in a try/catch block and returns (_, err, ok = false) when it went through 3298 // the catch clause. 3299 func TryOffStylusGarageEvent(callback js.Func[func(event_info *StylusGarageEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3300 ok = js.True == bindings.TryOffStylusGarageEvent( 3301 js.Pointer(&ret), js.Pointer(&exception), 3302 callback.Ref(), 3303 ) 3304 3305 return 3306 } 3307 3308 // HasFuncHasOnStylusGarageEvent returns true if the function "WEBEXT.os.events.onStylusGarageEvent.hasListener" exists. 3309 func HasFuncHasOnStylusGarageEvent() bool { 3310 return js.True == bindings.HasFuncHasOnStylusGarageEvent() 3311 } 3312 3313 // FuncHasOnStylusGarageEvent returns the function "WEBEXT.os.events.onStylusGarageEvent.hasListener". 3314 func FuncHasOnStylusGarageEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusGarageEventInfo)]) bool]) { 3315 bindings.FuncHasOnStylusGarageEvent( 3316 js.Pointer(&fn), 3317 ) 3318 return 3319 } 3320 3321 // HasOnStylusGarageEvent calls the function "WEBEXT.os.events.onStylusGarageEvent.hasListener" directly. 3322 func HasOnStylusGarageEvent(callback js.Func[func(event_info *StylusGarageEventInfo)]) (ret bool) { 3323 bindings.CallHasOnStylusGarageEvent( 3324 js.Pointer(&ret), 3325 callback.Ref(), 3326 ) 3327 3328 return 3329 } 3330 3331 // TryHasOnStylusGarageEvent calls the function "WEBEXT.os.events.onStylusGarageEvent.hasListener" 3332 // in a try/catch block and returns (_, err, ok = false) when it went through 3333 // the catch clause. 3334 func TryHasOnStylusGarageEvent(callback js.Func[func(event_info *StylusGarageEventInfo)]) (ret bool, exception js.Any, ok bool) { 3335 ok = js.True == bindings.TryHasOnStylusGarageEvent( 3336 js.Pointer(&ret), js.Pointer(&exception), 3337 callback.Ref(), 3338 ) 3339 3340 return 3341 } 3342 3343 type OnStylusTouchEventEventCallbackFunc func(this js.Ref, event_info *StylusTouchEventInfo) js.Ref 3344 3345 func (fn OnStylusTouchEventEventCallbackFunc) Register() js.Func[func(event_info *StylusTouchEventInfo)] { 3346 return js.RegisterCallback[func(event_info *StylusTouchEventInfo)]( 3347 fn, abi.FuncPCABIInternal(fn), 3348 ) 3349 } 3350 3351 func (fn OnStylusTouchEventEventCallbackFunc) DispatchCallback( 3352 targetPC uintptr, ctx *js.CallbackContext, 3353 ) { 3354 args := ctx.Args() 3355 if len(args) != 1+1 /* js this */ || 3356 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3357 js.ThrowInvalidCallbackInvocation() 3358 } 3359 var arg0 StylusTouchEventInfo 3360 arg0.UpdateFrom(args[0+1]) 3361 defer arg0.FreeMembers(true) 3362 3363 if ctx.Return(fn( 3364 args[0], 3365 3366 mark.NoEscape(&arg0), 3367 )) { 3368 return 3369 } 3370 3371 js.ThrowCallbackValueNotReturned() 3372 } 3373 3374 type OnStylusTouchEventEventCallback[T any] struct { 3375 Fn func(arg T, this js.Ref, event_info *StylusTouchEventInfo) js.Ref 3376 Arg T 3377 } 3378 3379 func (cb *OnStylusTouchEventEventCallback[T]) Register() js.Func[func(event_info *StylusTouchEventInfo)] { 3380 return js.RegisterCallback[func(event_info *StylusTouchEventInfo)]( 3381 cb, abi.FuncPCABIInternal(cb.Fn), 3382 ) 3383 } 3384 3385 func (cb *OnStylusTouchEventEventCallback[T]) DispatchCallback( 3386 targetPC uintptr, ctx *js.CallbackContext, 3387 ) { 3388 args := ctx.Args() 3389 if len(args) != 1+1 /* js this */ || 3390 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3391 js.ThrowInvalidCallbackInvocation() 3392 } 3393 var arg0 StylusTouchEventInfo 3394 arg0.UpdateFrom(args[0+1]) 3395 defer arg0.FreeMembers(true) 3396 3397 if ctx.Return(cb.Fn( 3398 cb.Arg, 3399 args[0], 3400 3401 mark.NoEscape(&arg0), 3402 )) { 3403 return 3404 } 3405 3406 js.ThrowCallbackValueNotReturned() 3407 } 3408 3409 // HasFuncOnStylusTouchEvent returns true if the function "WEBEXT.os.events.onStylusTouchEvent.addListener" exists. 3410 func HasFuncOnStylusTouchEvent() bool { 3411 return js.True == bindings.HasFuncOnStylusTouchEvent() 3412 } 3413 3414 // FuncOnStylusTouchEvent returns the function "WEBEXT.os.events.onStylusTouchEvent.addListener". 3415 func FuncOnStylusTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusTouchEventInfo)])]) { 3416 bindings.FuncOnStylusTouchEvent( 3417 js.Pointer(&fn), 3418 ) 3419 return 3420 } 3421 3422 // OnStylusTouchEvent calls the function "WEBEXT.os.events.onStylusTouchEvent.addListener" directly. 3423 func OnStylusTouchEvent(callback js.Func[func(event_info *StylusTouchEventInfo)]) (ret js.Void) { 3424 bindings.CallOnStylusTouchEvent( 3425 js.Pointer(&ret), 3426 callback.Ref(), 3427 ) 3428 3429 return 3430 } 3431 3432 // TryOnStylusTouchEvent calls the function "WEBEXT.os.events.onStylusTouchEvent.addListener" 3433 // in a try/catch block and returns (_, err, ok = false) when it went through 3434 // the catch clause. 3435 func TryOnStylusTouchEvent(callback js.Func[func(event_info *StylusTouchEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3436 ok = js.True == bindings.TryOnStylusTouchEvent( 3437 js.Pointer(&ret), js.Pointer(&exception), 3438 callback.Ref(), 3439 ) 3440 3441 return 3442 } 3443 3444 // HasFuncOffStylusTouchEvent returns true if the function "WEBEXT.os.events.onStylusTouchEvent.removeListener" exists. 3445 func HasFuncOffStylusTouchEvent() bool { 3446 return js.True == bindings.HasFuncOffStylusTouchEvent() 3447 } 3448 3449 // FuncOffStylusTouchEvent returns the function "WEBEXT.os.events.onStylusTouchEvent.removeListener". 3450 func FuncOffStylusTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusTouchEventInfo)])]) { 3451 bindings.FuncOffStylusTouchEvent( 3452 js.Pointer(&fn), 3453 ) 3454 return 3455 } 3456 3457 // OffStylusTouchEvent calls the function "WEBEXT.os.events.onStylusTouchEvent.removeListener" directly. 3458 func OffStylusTouchEvent(callback js.Func[func(event_info *StylusTouchEventInfo)]) (ret js.Void) { 3459 bindings.CallOffStylusTouchEvent( 3460 js.Pointer(&ret), 3461 callback.Ref(), 3462 ) 3463 3464 return 3465 } 3466 3467 // TryOffStylusTouchEvent calls the function "WEBEXT.os.events.onStylusTouchEvent.removeListener" 3468 // in a try/catch block and returns (_, err, ok = false) when it went through 3469 // the catch clause. 3470 func TryOffStylusTouchEvent(callback js.Func[func(event_info *StylusTouchEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3471 ok = js.True == bindings.TryOffStylusTouchEvent( 3472 js.Pointer(&ret), js.Pointer(&exception), 3473 callback.Ref(), 3474 ) 3475 3476 return 3477 } 3478 3479 // HasFuncHasOnStylusTouchEvent returns true if the function "WEBEXT.os.events.onStylusTouchEvent.hasListener" exists. 3480 func HasFuncHasOnStylusTouchEvent() bool { 3481 return js.True == bindings.HasFuncHasOnStylusTouchEvent() 3482 } 3483 3484 // FuncHasOnStylusTouchEvent returns the function "WEBEXT.os.events.onStylusTouchEvent.hasListener". 3485 func FuncHasOnStylusTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *StylusTouchEventInfo)]) bool]) { 3486 bindings.FuncHasOnStylusTouchEvent( 3487 js.Pointer(&fn), 3488 ) 3489 return 3490 } 3491 3492 // HasOnStylusTouchEvent calls the function "WEBEXT.os.events.onStylusTouchEvent.hasListener" directly. 3493 func HasOnStylusTouchEvent(callback js.Func[func(event_info *StylusTouchEventInfo)]) (ret bool) { 3494 bindings.CallHasOnStylusTouchEvent( 3495 js.Pointer(&ret), 3496 callback.Ref(), 3497 ) 3498 3499 return 3500 } 3501 3502 // TryHasOnStylusTouchEvent calls the function "WEBEXT.os.events.onStylusTouchEvent.hasListener" 3503 // in a try/catch block and returns (_, err, ok = false) when it went through 3504 // the catch clause. 3505 func TryHasOnStylusTouchEvent(callback js.Func[func(event_info *StylusTouchEventInfo)]) (ret bool, exception js.Any, ok bool) { 3506 ok = js.True == bindings.TryHasOnStylusTouchEvent( 3507 js.Pointer(&ret), js.Pointer(&exception), 3508 callback.Ref(), 3509 ) 3510 3511 return 3512 } 3513 3514 type OnTouchpadButtonEventEventCallbackFunc func(this js.Ref, event_info *TouchpadButtonEventInfo) js.Ref 3515 3516 func (fn OnTouchpadButtonEventEventCallbackFunc) Register() js.Func[func(event_info *TouchpadButtonEventInfo)] { 3517 return js.RegisterCallback[func(event_info *TouchpadButtonEventInfo)]( 3518 fn, abi.FuncPCABIInternal(fn), 3519 ) 3520 } 3521 3522 func (fn OnTouchpadButtonEventEventCallbackFunc) DispatchCallback( 3523 targetPC uintptr, ctx *js.CallbackContext, 3524 ) { 3525 args := ctx.Args() 3526 if len(args) != 1+1 /* js this */ || 3527 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3528 js.ThrowInvalidCallbackInvocation() 3529 } 3530 var arg0 TouchpadButtonEventInfo 3531 arg0.UpdateFrom(args[0+1]) 3532 defer arg0.FreeMembers(true) 3533 3534 if ctx.Return(fn( 3535 args[0], 3536 3537 mark.NoEscape(&arg0), 3538 )) { 3539 return 3540 } 3541 3542 js.ThrowCallbackValueNotReturned() 3543 } 3544 3545 type OnTouchpadButtonEventEventCallback[T any] struct { 3546 Fn func(arg T, this js.Ref, event_info *TouchpadButtonEventInfo) js.Ref 3547 Arg T 3548 } 3549 3550 func (cb *OnTouchpadButtonEventEventCallback[T]) Register() js.Func[func(event_info *TouchpadButtonEventInfo)] { 3551 return js.RegisterCallback[func(event_info *TouchpadButtonEventInfo)]( 3552 cb, abi.FuncPCABIInternal(cb.Fn), 3553 ) 3554 } 3555 3556 func (cb *OnTouchpadButtonEventEventCallback[T]) DispatchCallback( 3557 targetPC uintptr, ctx *js.CallbackContext, 3558 ) { 3559 args := ctx.Args() 3560 if len(args) != 1+1 /* js this */ || 3561 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3562 js.ThrowInvalidCallbackInvocation() 3563 } 3564 var arg0 TouchpadButtonEventInfo 3565 arg0.UpdateFrom(args[0+1]) 3566 defer arg0.FreeMembers(true) 3567 3568 if ctx.Return(cb.Fn( 3569 cb.Arg, 3570 args[0], 3571 3572 mark.NoEscape(&arg0), 3573 )) { 3574 return 3575 } 3576 3577 js.ThrowCallbackValueNotReturned() 3578 } 3579 3580 // HasFuncOnTouchpadButtonEvent returns true if the function "WEBEXT.os.events.onTouchpadButtonEvent.addListener" exists. 3581 func HasFuncOnTouchpadButtonEvent() bool { 3582 return js.True == bindings.HasFuncOnTouchpadButtonEvent() 3583 } 3584 3585 // FuncOnTouchpadButtonEvent returns the function "WEBEXT.os.events.onTouchpadButtonEvent.addListener". 3586 func FuncOnTouchpadButtonEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadButtonEventInfo)])]) { 3587 bindings.FuncOnTouchpadButtonEvent( 3588 js.Pointer(&fn), 3589 ) 3590 return 3591 } 3592 3593 // OnTouchpadButtonEvent calls the function "WEBEXT.os.events.onTouchpadButtonEvent.addListener" directly. 3594 func OnTouchpadButtonEvent(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) (ret js.Void) { 3595 bindings.CallOnTouchpadButtonEvent( 3596 js.Pointer(&ret), 3597 callback.Ref(), 3598 ) 3599 3600 return 3601 } 3602 3603 // TryOnTouchpadButtonEvent calls the function "WEBEXT.os.events.onTouchpadButtonEvent.addListener" 3604 // in a try/catch block and returns (_, err, ok = false) when it went through 3605 // the catch clause. 3606 func TryOnTouchpadButtonEvent(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3607 ok = js.True == bindings.TryOnTouchpadButtonEvent( 3608 js.Pointer(&ret), js.Pointer(&exception), 3609 callback.Ref(), 3610 ) 3611 3612 return 3613 } 3614 3615 // HasFuncOffTouchpadButtonEvent returns true if the function "WEBEXT.os.events.onTouchpadButtonEvent.removeListener" exists. 3616 func HasFuncOffTouchpadButtonEvent() bool { 3617 return js.True == bindings.HasFuncOffTouchpadButtonEvent() 3618 } 3619 3620 // FuncOffTouchpadButtonEvent returns the function "WEBEXT.os.events.onTouchpadButtonEvent.removeListener". 3621 func FuncOffTouchpadButtonEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadButtonEventInfo)])]) { 3622 bindings.FuncOffTouchpadButtonEvent( 3623 js.Pointer(&fn), 3624 ) 3625 return 3626 } 3627 3628 // OffTouchpadButtonEvent calls the function "WEBEXT.os.events.onTouchpadButtonEvent.removeListener" directly. 3629 func OffTouchpadButtonEvent(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) (ret js.Void) { 3630 bindings.CallOffTouchpadButtonEvent( 3631 js.Pointer(&ret), 3632 callback.Ref(), 3633 ) 3634 3635 return 3636 } 3637 3638 // TryOffTouchpadButtonEvent calls the function "WEBEXT.os.events.onTouchpadButtonEvent.removeListener" 3639 // in a try/catch block and returns (_, err, ok = false) when it went through 3640 // the catch clause. 3641 func TryOffTouchpadButtonEvent(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3642 ok = js.True == bindings.TryOffTouchpadButtonEvent( 3643 js.Pointer(&ret), js.Pointer(&exception), 3644 callback.Ref(), 3645 ) 3646 3647 return 3648 } 3649 3650 // HasFuncHasOnTouchpadButtonEvent returns true if the function "WEBEXT.os.events.onTouchpadButtonEvent.hasListener" exists. 3651 func HasFuncHasOnTouchpadButtonEvent() bool { 3652 return js.True == bindings.HasFuncHasOnTouchpadButtonEvent() 3653 } 3654 3655 // FuncHasOnTouchpadButtonEvent returns the function "WEBEXT.os.events.onTouchpadButtonEvent.hasListener". 3656 func FuncHasOnTouchpadButtonEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) bool]) { 3657 bindings.FuncHasOnTouchpadButtonEvent( 3658 js.Pointer(&fn), 3659 ) 3660 return 3661 } 3662 3663 // HasOnTouchpadButtonEvent calls the function "WEBEXT.os.events.onTouchpadButtonEvent.hasListener" directly. 3664 func HasOnTouchpadButtonEvent(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) (ret bool) { 3665 bindings.CallHasOnTouchpadButtonEvent( 3666 js.Pointer(&ret), 3667 callback.Ref(), 3668 ) 3669 3670 return 3671 } 3672 3673 // TryHasOnTouchpadButtonEvent calls the function "WEBEXT.os.events.onTouchpadButtonEvent.hasListener" 3674 // in a try/catch block and returns (_, err, ok = false) when it went through 3675 // the catch clause. 3676 func TryHasOnTouchpadButtonEvent(callback js.Func[func(event_info *TouchpadButtonEventInfo)]) (ret bool, exception js.Any, ok bool) { 3677 ok = js.True == bindings.TryHasOnTouchpadButtonEvent( 3678 js.Pointer(&ret), js.Pointer(&exception), 3679 callback.Ref(), 3680 ) 3681 3682 return 3683 } 3684 3685 type OnTouchpadConnectedEventEventCallbackFunc func(this js.Ref, event_info *TouchpadConnectedEventInfo) js.Ref 3686 3687 func (fn OnTouchpadConnectedEventEventCallbackFunc) Register() js.Func[func(event_info *TouchpadConnectedEventInfo)] { 3688 return js.RegisterCallback[func(event_info *TouchpadConnectedEventInfo)]( 3689 fn, abi.FuncPCABIInternal(fn), 3690 ) 3691 } 3692 3693 func (fn OnTouchpadConnectedEventEventCallbackFunc) DispatchCallback( 3694 targetPC uintptr, ctx *js.CallbackContext, 3695 ) { 3696 args := ctx.Args() 3697 if len(args) != 1+1 /* js this */ || 3698 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3699 js.ThrowInvalidCallbackInvocation() 3700 } 3701 var arg0 TouchpadConnectedEventInfo 3702 arg0.UpdateFrom(args[0+1]) 3703 defer arg0.FreeMembers(true) 3704 3705 if ctx.Return(fn( 3706 args[0], 3707 3708 mark.NoEscape(&arg0), 3709 )) { 3710 return 3711 } 3712 3713 js.ThrowCallbackValueNotReturned() 3714 } 3715 3716 type OnTouchpadConnectedEventEventCallback[T any] struct { 3717 Fn func(arg T, this js.Ref, event_info *TouchpadConnectedEventInfo) js.Ref 3718 Arg T 3719 } 3720 3721 func (cb *OnTouchpadConnectedEventEventCallback[T]) Register() js.Func[func(event_info *TouchpadConnectedEventInfo)] { 3722 return js.RegisterCallback[func(event_info *TouchpadConnectedEventInfo)]( 3723 cb, abi.FuncPCABIInternal(cb.Fn), 3724 ) 3725 } 3726 3727 func (cb *OnTouchpadConnectedEventEventCallback[T]) DispatchCallback( 3728 targetPC uintptr, ctx *js.CallbackContext, 3729 ) { 3730 args := ctx.Args() 3731 if len(args) != 1+1 /* js this */ || 3732 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3733 js.ThrowInvalidCallbackInvocation() 3734 } 3735 var arg0 TouchpadConnectedEventInfo 3736 arg0.UpdateFrom(args[0+1]) 3737 defer arg0.FreeMembers(true) 3738 3739 if ctx.Return(cb.Fn( 3740 cb.Arg, 3741 args[0], 3742 3743 mark.NoEscape(&arg0), 3744 )) { 3745 return 3746 } 3747 3748 js.ThrowCallbackValueNotReturned() 3749 } 3750 3751 // HasFuncOnTouchpadConnectedEvent returns true if the function "WEBEXT.os.events.onTouchpadConnectedEvent.addListener" exists. 3752 func HasFuncOnTouchpadConnectedEvent() bool { 3753 return js.True == bindings.HasFuncOnTouchpadConnectedEvent() 3754 } 3755 3756 // FuncOnTouchpadConnectedEvent returns the function "WEBEXT.os.events.onTouchpadConnectedEvent.addListener". 3757 func FuncOnTouchpadConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadConnectedEventInfo)])]) { 3758 bindings.FuncOnTouchpadConnectedEvent( 3759 js.Pointer(&fn), 3760 ) 3761 return 3762 } 3763 3764 // OnTouchpadConnectedEvent calls the function "WEBEXT.os.events.onTouchpadConnectedEvent.addListener" directly. 3765 func OnTouchpadConnectedEvent(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) (ret js.Void) { 3766 bindings.CallOnTouchpadConnectedEvent( 3767 js.Pointer(&ret), 3768 callback.Ref(), 3769 ) 3770 3771 return 3772 } 3773 3774 // TryOnTouchpadConnectedEvent calls the function "WEBEXT.os.events.onTouchpadConnectedEvent.addListener" 3775 // in a try/catch block and returns (_, err, ok = false) when it went through 3776 // the catch clause. 3777 func TryOnTouchpadConnectedEvent(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3778 ok = js.True == bindings.TryOnTouchpadConnectedEvent( 3779 js.Pointer(&ret), js.Pointer(&exception), 3780 callback.Ref(), 3781 ) 3782 3783 return 3784 } 3785 3786 // HasFuncOffTouchpadConnectedEvent returns true if the function "WEBEXT.os.events.onTouchpadConnectedEvent.removeListener" exists. 3787 func HasFuncOffTouchpadConnectedEvent() bool { 3788 return js.True == bindings.HasFuncOffTouchpadConnectedEvent() 3789 } 3790 3791 // FuncOffTouchpadConnectedEvent returns the function "WEBEXT.os.events.onTouchpadConnectedEvent.removeListener". 3792 func FuncOffTouchpadConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadConnectedEventInfo)])]) { 3793 bindings.FuncOffTouchpadConnectedEvent( 3794 js.Pointer(&fn), 3795 ) 3796 return 3797 } 3798 3799 // OffTouchpadConnectedEvent calls the function "WEBEXT.os.events.onTouchpadConnectedEvent.removeListener" directly. 3800 func OffTouchpadConnectedEvent(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) (ret js.Void) { 3801 bindings.CallOffTouchpadConnectedEvent( 3802 js.Pointer(&ret), 3803 callback.Ref(), 3804 ) 3805 3806 return 3807 } 3808 3809 // TryOffTouchpadConnectedEvent calls the function "WEBEXT.os.events.onTouchpadConnectedEvent.removeListener" 3810 // in a try/catch block and returns (_, err, ok = false) when it went through 3811 // the catch clause. 3812 func TryOffTouchpadConnectedEvent(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3813 ok = js.True == bindings.TryOffTouchpadConnectedEvent( 3814 js.Pointer(&ret), js.Pointer(&exception), 3815 callback.Ref(), 3816 ) 3817 3818 return 3819 } 3820 3821 // HasFuncHasOnTouchpadConnectedEvent returns true if the function "WEBEXT.os.events.onTouchpadConnectedEvent.hasListener" exists. 3822 func HasFuncHasOnTouchpadConnectedEvent() bool { 3823 return js.True == bindings.HasFuncHasOnTouchpadConnectedEvent() 3824 } 3825 3826 // FuncHasOnTouchpadConnectedEvent returns the function "WEBEXT.os.events.onTouchpadConnectedEvent.hasListener". 3827 func FuncHasOnTouchpadConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) bool]) { 3828 bindings.FuncHasOnTouchpadConnectedEvent( 3829 js.Pointer(&fn), 3830 ) 3831 return 3832 } 3833 3834 // HasOnTouchpadConnectedEvent calls the function "WEBEXT.os.events.onTouchpadConnectedEvent.hasListener" directly. 3835 func HasOnTouchpadConnectedEvent(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) (ret bool) { 3836 bindings.CallHasOnTouchpadConnectedEvent( 3837 js.Pointer(&ret), 3838 callback.Ref(), 3839 ) 3840 3841 return 3842 } 3843 3844 // TryHasOnTouchpadConnectedEvent calls the function "WEBEXT.os.events.onTouchpadConnectedEvent.hasListener" 3845 // in a try/catch block and returns (_, err, ok = false) when it went through 3846 // the catch clause. 3847 func TryHasOnTouchpadConnectedEvent(callback js.Func[func(event_info *TouchpadConnectedEventInfo)]) (ret bool, exception js.Any, ok bool) { 3848 ok = js.True == bindings.TryHasOnTouchpadConnectedEvent( 3849 js.Pointer(&ret), js.Pointer(&exception), 3850 callback.Ref(), 3851 ) 3852 3853 return 3854 } 3855 3856 type OnTouchpadTouchEventEventCallbackFunc func(this js.Ref, event_info *TouchpadTouchEventInfo) js.Ref 3857 3858 func (fn OnTouchpadTouchEventEventCallbackFunc) Register() js.Func[func(event_info *TouchpadTouchEventInfo)] { 3859 return js.RegisterCallback[func(event_info *TouchpadTouchEventInfo)]( 3860 fn, abi.FuncPCABIInternal(fn), 3861 ) 3862 } 3863 3864 func (fn OnTouchpadTouchEventEventCallbackFunc) DispatchCallback( 3865 targetPC uintptr, ctx *js.CallbackContext, 3866 ) { 3867 args := ctx.Args() 3868 if len(args) != 1+1 /* js this */ || 3869 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3870 js.ThrowInvalidCallbackInvocation() 3871 } 3872 var arg0 TouchpadTouchEventInfo 3873 arg0.UpdateFrom(args[0+1]) 3874 defer arg0.FreeMembers(true) 3875 3876 if ctx.Return(fn( 3877 args[0], 3878 3879 mark.NoEscape(&arg0), 3880 )) { 3881 return 3882 } 3883 3884 js.ThrowCallbackValueNotReturned() 3885 } 3886 3887 type OnTouchpadTouchEventEventCallback[T any] struct { 3888 Fn func(arg T, this js.Ref, event_info *TouchpadTouchEventInfo) js.Ref 3889 Arg T 3890 } 3891 3892 func (cb *OnTouchpadTouchEventEventCallback[T]) Register() js.Func[func(event_info *TouchpadTouchEventInfo)] { 3893 return js.RegisterCallback[func(event_info *TouchpadTouchEventInfo)]( 3894 cb, abi.FuncPCABIInternal(cb.Fn), 3895 ) 3896 } 3897 3898 func (cb *OnTouchpadTouchEventEventCallback[T]) DispatchCallback( 3899 targetPC uintptr, ctx *js.CallbackContext, 3900 ) { 3901 args := ctx.Args() 3902 if len(args) != 1+1 /* js this */ || 3903 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3904 js.ThrowInvalidCallbackInvocation() 3905 } 3906 var arg0 TouchpadTouchEventInfo 3907 arg0.UpdateFrom(args[0+1]) 3908 defer arg0.FreeMembers(true) 3909 3910 if ctx.Return(cb.Fn( 3911 cb.Arg, 3912 args[0], 3913 3914 mark.NoEscape(&arg0), 3915 )) { 3916 return 3917 } 3918 3919 js.ThrowCallbackValueNotReturned() 3920 } 3921 3922 // HasFuncOnTouchpadTouchEvent returns true if the function "WEBEXT.os.events.onTouchpadTouchEvent.addListener" exists. 3923 func HasFuncOnTouchpadTouchEvent() bool { 3924 return js.True == bindings.HasFuncOnTouchpadTouchEvent() 3925 } 3926 3927 // FuncOnTouchpadTouchEvent returns the function "WEBEXT.os.events.onTouchpadTouchEvent.addListener". 3928 func FuncOnTouchpadTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadTouchEventInfo)])]) { 3929 bindings.FuncOnTouchpadTouchEvent( 3930 js.Pointer(&fn), 3931 ) 3932 return 3933 } 3934 3935 // OnTouchpadTouchEvent calls the function "WEBEXT.os.events.onTouchpadTouchEvent.addListener" directly. 3936 func OnTouchpadTouchEvent(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) (ret js.Void) { 3937 bindings.CallOnTouchpadTouchEvent( 3938 js.Pointer(&ret), 3939 callback.Ref(), 3940 ) 3941 3942 return 3943 } 3944 3945 // TryOnTouchpadTouchEvent calls the function "WEBEXT.os.events.onTouchpadTouchEvent.addListener" 3946 // in a try/catch block and returns (_, err, ok = false) when it went through 3947 // the catch clause. 3948 func TryOnTouchpadTouchEvent(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3949 ok = js.True == bindings.TryOnTouchpadTouchEvent( 3950 js.Pointer(&ret), js.Pointer(&exception), 3951 callback.Ref(), 3952 ) 3953 3954 return 3955 } 3956 3957 // HasFuncOffTouchpadTouchEvent returns true if the function "WEBEXT.os.events.onTouchpadTouchEvent.removeListener" exists. 3958 func HasFuncOffTouchpadTouchEvent() bool { 3959 return js.True == bindings.HasFuncOffTouchpadTouchEvent() 3960 } 3961 3962 // FuncOffTouchpadTouchEvent returns the function "WEBEXT.os.events.onTouchpadTouchEvent.removeListener". 3963 func FuncOffTouchpadTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadTouchEventInfo)])]) { 3964 bindings.FuncOffTouchpadTouchEvent( 3965 js.Pointer(&fn), 3966 ) 3967 return 3968 } 3969 3970 // OffTouchpadTouchEvent calls the function "WEBEXT.os.events.onTouchpadTouchEvent.removeListener" directly. 3971 func OffTouchpadTouchEvent(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) (ret js.Void) { 3972 bindings.CallOffTouchpadTouchEvent( 3973 js.Pointer(&ret), 3974 callback.Ref(), 3975 ) 3976 3977 return 3978 } 3979 3980 // TryOffTouchpadTouchEvent calls the function "WEBEXT.os.events.onTouchpadTouchEvent.removeListener" 3981 // in a try/catch block and returns (_, err, ok = false) when it went through 3982 // the catch clause. 3983 func TryOffTouchpadTouchEvent(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 3984 ok = js.True == bindings.TryOffTouchpadTouchEvent( 3985 js.Pointer(&ret), js.Pointer(&exception), 3986 callback.Ref(), 3987 ) 3988 3989 return 3990 } 3991 3992 // HasFuncHasOnTouchpadTouchEvent returns true if the function "WEBEXT.os.events.onTouchpadTouchEvent.hasListener" exists. 3993 func HasFuncHasOnTouchpadTouchEvent() bool { 3994 return js.True == bindings.HasFuncHasOnTouchpadTouchEvent() 3995 } 3996 3997 // FuncHasOnTouchpadTouchEvent returns the function "WEBEXT.os.events.onTouchpadTouchEvent.hasListener". 3998 func FuncHasOnTouchpadTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) bool]) { 3999 bindings.FuncHasOnTouchpadTouchEvent( 4000 js.Pointer(&fn), 4001 ) 4002 return 4003 } 4004 4005 // HasOnTouchpadTouchEvent calls the function "WEBEXT.os.events.onTouchpadTouchEvent.hasListener" directly. 4006 func HasOnTouchpadTouchEvent(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) (ret bool) { 4007 bindings.CallHasOnTouchpadTouchEvent( 4008 js.Pointer(&ret), 4009 callback.Ref(), 4010 ) 4011 4012 return 4013 } 4014 4015 // TryHasOnTouchpadTouchEvent calls the function "WEBEXT.os.events.onTouchpadTouchEvent.hasListener" 4016 // in a try/catch block and returns (_, err, ok = false) when it went through 4017 // the catch clause. 4018 func TryHasOnTouchpadTouchEvent(callback js.Func[func(event_info *TouchpadTouchEventInfo)]) (ret bool, exception js.Any, ok bool) { 4019 ok = js.True == bindings.TryHasOnTouchpadTouchEvent( 4020 js.Pointer(&ret), js.Pointer(&exception), 4021 callback.Ref(), 4022 ) 4023 4024 return 4025 } 4026 4027 type OnTouchscreenConnectedEventEventCallbackFunc func(this js.Ref, event_info *TouchscreenConnectedEventInfo) js.Ref 4028 4029 func (fn OnTouchscreenConnectedEventEventCallbackFunc) Register() js.Func[func(event_info *TouchscreenConnectedEventInfo)] { 4030 return js.RegisterCallback[func(event_info *TouchscreenConnectedEventInfo)]( 4031 fn, abi.FuncPCABIInternal(fn), 4032 ) 4033 } 4034 4035 func (fn OnTouchscreenConnectedEventEventCallbackFunc) DispatchCallback( 4036 targetPC uintptr, ctx *js.CallbackContext, 4037 ) { 4038 args := ctx.Args() 4039 if len(args) != 1+1 /* js this */ || 4040 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 4041 js.ThrowInvalidCallbackInvocation() 4042 } 4043 var arg0 TouchscreenConnectedEventInfo 4044 arg0.UpdateFrom(args[0+1]) 4045 defer arg0.FreeMembers(true) 4046 4047 if ctx.Return(fn( 4048 args[0], 4049 4050 mark.NoEscape(&arg0), 4051 )) { 4052 return 4053 } 4054 4055 js.ThrowCallbackValueNotReturned() 4056 } 4057 4058 type OnTouchscreenConnectedEventEventCallback[T any] struct { 4059 Fn func(arg T, this js.Ref, event_info *TouchscreenConnectedEventInfo) js.Ref 4060 Arg T 4061 } 4062 4063 func (cb *OnTouchscreenConnectedEventEventCallback[T]) Register() js.Func[func(event_info *TouchscreenConnectedEventInfo)] { 4064 return js.RegisterCallback[func(event_info *TouchscreenConnectedEventInfo)]( 4065 cb, abi.FuncPCABIInternal(cb.Fn), 4066 ) 4067 } 4068 4069 func (cb *OnTouchscreenConnectedEventEventCallback[T]) DispatchCallback( 4070 targetPC uintptr, ctx *js.CallbackContext, 4071 ) { 4072 args := ctx.Args() 4073 if len(args) != 1+1 /* js this */ || 4074 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 4075 js.ThrowInvalidCallbackInvocation() 4076 } 4077 var arg0 TouchscreenConnectedEventInfo 4078 arg0.UpdateFrom(args[0+1]) 4079 defer arg0.FreeMembers(true) 4080 4081 if ctx.Return(cb.Fn( 4082 cb.Arg, 4083 args[0], 4084 4085 mark.NoEscape(&arg0), 4086 )) { 4087 return 4088 } 4089 4090 js.ThrowCallbackValueNotReturned() 4091 } 4092 4093 // HasFuncOnTouchscreenConnectedEvent returns true if the function "WEBEXT.os.events.onTouchscreenConnectedEvent.addListener" exists. 4094 func HasFuncOnTouchscreenConnectedEvent() bool { 4095 return js.True == bindings.HasFuncOnTouchscreenConnectedEvent() 4096 } 4097 4098 // FuncOnTouchscreenConnectedEvent returns the function "WEBEXT.os.events.onTouchscreenConnectedEvent.addListener". 4099 func FuncOnTouchscreenConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)])]) { 4100 bindings.FuncOnTouchscreenConnectedEvent( 4101 js.Pointer(&fn), 4102 ) 4103 return 4104 } 4105 4106 // OnTouchscreenConnectedEvent calls the function "WEBEXT.os.events.onTouchscreenConnectedEvent.addListener" directly. 4107 func OnTouchscreenConnectedEvent(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) (ret js.Void) { 4108 bindings.CallOnTouchscreenConnectedEvent( 4109 js.Pointer(&ret), 4110 callback.Ref(), 4111 ) 4112 4113 return 4114 } 4115 4116 // TryOnTouchscreenConnectedEvent calls the function "WEBEXT.os.events.onTouchscreenConnectedEvent.addListener" 4117 // in a try/catch block and returns (_, err, ok = false) when it went through 4118 // the catch clause. 4119 func TryOnTouchscreenConnectedEvent(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 4120 ok = js.True == bindings.TryOnTouchscreenConnectedEvent( 4121 js.Pointer(&ret), js.Pointer(&exception), 4122 callback.Ref(), 4123 ) 4124 4125 return 4126 } 4127 4128 // HasFuncOffTouchscreenConnectedEvent returns true if the function "WEBEXT.os.events.onTouchscreenConnectedEvent.removeListener" exists. 4129 func HasFuncOffTouchscreenConnectedEvent() bool { 4130 return js.True == bindings.HasFuncOffTouchscreenConnectedEvent() 4131 } 4132 4133 // FuncOffTouchscreenConnectedEvent returns the function "WEBEXT.os.events.onTouchscreenConnectedEvent.removeListener". 4134 func FuncOffTouchscreenConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)])]) { 4135 bindings.FuncOffTouchscreenConnectedEvent( 4136 js.Pointer(&fn), 4137 ) 4138 return 4139 } 4140 4141 // OffTouchscreenConnectedEvent calls the function "WEBEXT.os.events.onTouchscreenConnectedEvent.removeListener" directly. 4142 func OffTouchscreenConnectedEvent(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) (ret js.Void) { 4143 bindings.CallOffTouchscreenConnectedEvent( 4144 js.Pointer(&ret), 4145 callback.Ref(), 4146 ) 4147 4148 return 4149 } 4150 4151 // TryOffTouchscreenConnectedEvent calls the function "WEBEXT.os.events.onTouchscreenConnectedEvent.removeListener" 4152 // in a try/catch block and returns (_, err, ok = false) when it went through 4153 // the catch clause. 4154 func TryOffTouchscreenConnectedEvent(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 4155 ok = js.True == bindings.TryOffTouchscreenConnectedEvent( 4156 js.Pointer(&ret), js.Pointer(&exception), 4157 callback.Ref(), 4158 ) 4159 4160 return 4161 } 4162 4163 // HasFuncHasOnTouchscreenConnectedEvent returns true if the function "WEBEXT.os.events.onTouchscreenConnectedEvent.hasListener" exists. 4164 func HasFuncHasOnTouchscreenConnectedEvent() bool { 4165 return js.True == bindings.HasFuncHasOnTouchscreenConnectedEvent() 4166 } 4167 4168 // FuncHasOnTouchscreenConnectedEvent returns the function "WEBEXT.os.events.onTouchscreenConnectedEvent.hasListener". 4169 func FuncHasOnTouchscreenConnectedEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) bool]) { 4170 bindings.FuncHasOnTouchscreenConnectedEvent( 4171 js.Pointer(&fn), 4172 ) 4173 return 4174 } 4175 4176 // HasOnTouchscreenConnectedEvent calls the function "WEBEXT.os.events.onTouchscreenConnectedEvent.hasListener" directly. 4177 func HasOnTouchscreenConnectedEvent(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) (ret bool) { 4178 bindings.CallHasOnTouchscreenConnectedEvent( 4179 js.Pointer(&ret), 4180 callback.Ref(), 4181 ) 4182 4183 return 4184 } 4185 4186 // TryHasOnTouchscreenConnectedEvent calls the function "WEBEXT.os.events.onTouchscreenConnectedEvent.hasListener" 4187 // in a try/catch block and returns (_, err, ok = false) when it went through 4188 // the catch clause. 4189 func TryHasOnTouchscreenConnectedEvent(callback js.Func[func(event_info *TouchscreenConnectedEventInfo)]) (ret bool, exception js.Any, ok bool) { 4190 ok = js.True == bindings.TryHasOnTouchscreenConnectedEvent( 4191 js.Pointer(&ret), js.Pointer(&exception), 4192 callback.Ref(), 4193 ) 4194 4195 return 4196 } 4197 4198 type OnTouchscreenTouchEventEventCallbackFunc func(this js.Ref, event_info *TouchscreenTouchEventInfo) js.Ref 4199 4200 func (fn OnTouchscreenTouchEventEventCallbackFunc) Register() js.Func[func(event_info *TouchscreenTouchEventInfo)] { 4201 return js.RegisterCallback[func(event_info *TouchscreenTouchEventInfo)]( 4202 fn, abi.FuncPCABIInternal(fn), 4203 ) 4204 } 4205 4206 func (fn OnTouchscreenTouchEventEventCallbackFunc) DispatchCallback( 4207 targetPC uintptr, ctx *js.CallbackContext, 4208 ) { 4209 args := ctx.Args() 4210 if len(args) != 1+1 /* js this */ || 4211 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 4212 js.ThrowInvalidCallbackInvocation() 4213 } 4214 var arg0 TouchscreenTouchEventInfo 4215 arg0.UpdateFrom(args[0+1]) 4216 defer arg0.FreeMembers(true) 4217 4218 if ctx.Return(fn( 4219 args[0], 4220 4221 mark.NoEscape(&arg0), 4222 )) { 4223 return 4224 } 4225 4226 js.ThrowCallbackValueNotReturned() 4227 } 4228 4229 type OnTouchscreenTouchEventEventCallback[T any] struct { 4230 Fn func(arg T, this js.Ref, event_info *TouchscreenTouchEventInfo) js.Ref 4231 Arg T 4232 } 4233 4234 func (cb *OnTouchscreenTouchEventEventCallback[T]) Register() js.Func[func(event_info *TouchscreenTouchEventInfo)] { 4235 return js.RegisterCallback[func(event_info *TouchscreenTouchEventInfo)]( 4236 cb, abi.FuncPCABIInternal(cb.Fn), 4237 ) 4238 } 4239 4240 func (cb *OnTouchscreenTouchEventEventCallback[T]) DispatchCallback( 4241 targetPC uintptr, ctx *js.CallbackContext, 4242 ) { 4243 args := ctx.Args() 4244 if len(args) != 1+1 /* js this */ || 4245 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 4246 js.ThrowInvalidCallbackInvocation() 4247 } 4248 var arg0 TouchscreenTouchEventInfo 4249 arg0.UpdateFrom(args[0+1]) 4250 defer arg0.FreeMembers(true) 4251 4252 if ctx.Return(cb.Fn( 4253 cb.Arg, 4254 args[0], 4255 4256 mark.NoEscape(&arg0), 4257 )) { 4258 return 4259 } 4260 4261 js.ThrowCallbackValueNotReturned() 4262 } 4263 4264 // HasFuncOnTouchscreenTouchEvent returns true if the function "WEBEXT.os.events.onTouchscreenTouchEvent.addListener" exists. 4265 func HasFuncOnTouchscreenTouchEvent() bool { 4266 return js.True == bindings.HasFuncOnTouchscreenTouchEvent() 4267 } 4268 4269 // FuncOnTouchscreenTouchEvent returns the function "WEBEXT.os.events.onTouchscreenTouchEvent.addListener". 4270 func FuncOnTouchscreenTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchscreenTouchEventInfo)])]) { 4271 bindings.FuncOnTouchscreenTouchEvent( 4272 js.Pointer(&fn), 4273 ) 4274 return 4275 } 4276 4277 // OnTouchscreenTouchEvent calls the function "WEBEXT.os.events.onTouchscreenTouchEvent.addListener" directly. 4278 func OnTouchscreenTouchEvent(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) (ret js.Void) { 4279 bindings.CallOnTouchscreenTouchEvent( 4280 js.Pointer(&ret), 4281 callback.Ref(), 4282 ) 4283 4284 return 4285 } 4286 4287 // TryOnTouchscreenTouchEvent calls the function "WEBEXT.os.events.onTouchscreenTouchEvent.addListener" 4288 // in a try/catch block and returns (_, err, ok = false) when it went through 4289 // the catch clause. 4290 func TryOnTouchscreenTouchEvent(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 4291 ok = js.True == bindings.TryOnTouchscreenTouchEvent( 4292 js.Pointer(&ret), js.Pointer(&exception), 4293 callback.Ref(), 4294 ) 4295 4296 return 4297 } 4298 4299 // HasFuncOffTouchscreenTouchEvent returns true if the function "WEBEXT.os.events.onTouchscreenTouchEvent.removeListener" exists. 4300 func HasFuncOffTouchscreenTouchEvent() bool { 4301 return js.True == bindings.HasFuncOffTouchscreenTouchEvent() 4302 } 4303 4304 // FuncOffTouchscreenTouchEvent returns the function "WEBEXT.os.events.onTouchscreenTouchEvent.removeListener". 4305 func FuncOffTouchscreenTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchscreenTouchEventInfo)])]) { 4306 bindings.FuncOffTouchscreenTouchEvent( 4307 js.Pointer(&fn), 4308 ) 4309 return 4310 } 4311 4312 // OffTouchscreenTouchEvent calls the function "WEBEXT.os.events.onTouchscreenTouchEvent.removeListener" directly. 4313 func OffTouchscreenTouchEvent(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) (ret js.Void) { 4314 bindings.CallOffTouchscreenTouchEvent( 4315 js.Pointer(&ret), 4316 callback.Ref(), 4317 ) 4318 4319 return 4320 } 4321 4322 // TryOffTouchscreenTouchEvent calls the function "WEBEXT.os.events.onTouchscreenTouchEvent.removeListener" 4323 // in a try/catch block and returns (_, err, ok = false) when it went through 4324 // the catch clause. 4325 func TryOffTouchscreenTouchEvent(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 4326 ok = js.True == bindings.TryOffTouchscreenTouchEvent( 4327 js.Pointer(&ret), js.Pointer(&exception), 4328 callback.Ref(), 4329 ) 4330 4331 return 4332 } 4333 4334 // HasFuncHasOnTouchscreenTouchEvent returns true if the function "WEBEXT.os.events.onTouchscreenTouchEvent.hasListener" exists. 4335 func HasFuncHasOnTouchscreenTouchEvent() bool { 4336 return js.True == bindings.HasFuncHasOnTouchscreenTouchEvent() 4337 } 4338 4339 // FuncHasOnTouchscreenTouchEvent returns the function "WEBEXT.os.events.onTouchscreenTouchEvent.hasListener". 4340 func FuncHasOnTouchscreenTouchEvent() (fn js.Func[func(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) bool]) { 4341 bindings.FuncHasOnTouchscreenTouchEvent( 4342 js.Pointer(&fn), 4343 ) 4344 return 4345 } 4346 4347 // HasOnTouchscreenTouchEvent calls the function "WEBEXT.os.events.onTouchscreenTouchEvent.hasListener" directly. 4348 func HasOnTouchscreenTouchEvent(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) (ret bool) { 4349 bindings.CallHasOnTouchscreenTouchEvent( 4350 js.Pointer(&ret), 4351 callback.Ref(), 4352 ) 4353 4354 return 4355 } 4356 4357 // TryHasOnTouchscreenTouchEvent calls the function "WEBEXT.os.events.onTouchscreenTouchEvent.hasListener" 4358 // in a try/catch block and returns (_, err, ok = false) when it went through 4359 // the catch clause. 4360 func TryHasOnTouchscreenTouchEvent(callback js.Func[func(event_info *TouchscreenTouchEventInfo)]) (ret bool, exception js.Any, ok bool) { 4361 ok = js.True == bindings.TryHasOnTouchscreenTouchEvent( 4362 js.Pointer(&ret), js.Pointer(&exception), 4363 callback.Ref(), 4364 ) 4365 4366 return 4367 } 4368 4369 type OnUsbEventEventCallbackFunc func(this js.Ref, event_info *UsbEventInfo) js.Ref 4370 4371 func (fn OnUsbEventEventCallbackFunc) Register() js.Func[func(event_info *UsbEventInfo)] { 4372 return js.RegisterCallback[func(event_info *UsbEventInfo)]( 4373 fn, abi.FuncPCABIInternal(fn), 4374 ) 4375 } 4376 4377 func (fn OnUsbEventEventCallbackFunc) DispatchCallback( 4378 targetPC uintptr, ctx *js.CallbackContext, 4379 ) { 4380 args := ctx.Args() 4381 if len(args) != 1+1 /* js this */ || 4382 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 4383 js.ThrowInvalidCallbackInvocation() 4384 } 4385 var arg0 UsbEventInfo 4386 arg0.UpdateFrom(args[0+1]) 4387 defer arg0.FreeMembers(true) 4388 4389 if ctx.Return(fn( 4390 args[0], 4391 4392 mark.NoEscape(&arg0), 4393 )) { 4394 return 4395 } 4396 4397 js.ThrowCallbackValueNotReturned() 4398 } 4399 4400 type OnUsbEventEventCallback[T any] struct { 4401 Fn func(arg T, this js.Ref, event_info *UsbEventInfo) js.Ref 4402 Arg T 4403 } 4404 4405 func (cb *OnUsbEventEventCallback[T]) Register() js.Func[func(event_info *UsbEventInfo)] { 4406 return js.RegisterCallback[func(event_info *UsbEventInfo)]( 4407 cb, abi.FuncPCABIInternal(cb.Fn), 4408 ) 4409 } 4410 4411 func (cb *OnUsbEventEventCallback[T]) DispatchCallback( 4412 targetPC uintptr, ctx *js.CallbackContext, 4413 ) { 4414 args := ctx.Args() 4415 if len(args) != 1+1 /* js this */ || 4416 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 4417 js.ThrowInvalidCallbackInvocation() 4418 } 4419 var arg0 UsbEventInfo 4420 arg0.UpdateFrom(args[0+1]) 4421 defer arg0.FreeMembers(true) 4422 4423 if ctx.Return(cb.Fn( 4424 cb.Arg, 4425 args[0], 4426 4427 mark.NoEscape(&arg0), 4428 )) { 4429 return 4430 } 4431 4432 js.ThrowCallbackValueNotReturned() 4433 } 4434 4435 // HasFuncOnUsbEvent returns true if the function "WEBEXT.os.events.onUsbEvent.addListener" exists. 4436 func HasFuncOnUsbEvent() bool { 4437 return js.True == bindings.HasFuncOnUsbEvent() 4438 } 4439 4440 // FuncOnUsbEvent returns the function "WEBEXT.os.events.onUsbEvent.addListener". 4441 func FuncOnUsbEvent() (fn js.Func[func(callback js.Func[func(event_info *UsbEventInfo)])]) { 4442 bindings.FuncOnUsbEvent( 4443 js.Pointer(&fn), 4444 ) 4445 return 4446 } 4447 4448 // OnUsbEvent calls the function "WEBEXT.os.events.onUsbEvent.addListener" directly. 4449 func OnUsbEvent(callback js.Func[func(event_info *UsbEventInfo)]) (ret js.Void) { 4450 bindings.CallOnUsbEvent( 4451 js.Pointer(&ret), 4452 callback.Ref(), 4453 ) 4454 4455 return 4456 } 4457 4458 // TryOnUsbEvent calls the function "WEBEXT.os.events.onUsbEvent.addListener" 4459 // in a try/catch block and returns (_, err, ok = false) when it went through 4460 // the catch clause. 4461 func TryOnUsbEvent(callback js.Func[func(event_info *UsbEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 4462 ok = js.True == bindings.TryOnUsbEvent( 4463 js.Pointer(&ret), js.Pointer(&exception), 4464 callback.Ref(), 4465 ) 4466 4467 return 4468 } 4469 4470 // HasFuncOffUsbEvent returns true if the function "WEBEXT.os.events.onUsbEvent.removeListener" exists. 4471 func HasFuncOffUsbEvent() bool { 4472 return js.True == bindings.HasFuncOffUsbEvent() 4473 } 4474 4475 // FuncOffUsbEvent returns the function "WEBEXT.os.events.onUsbEvent.removeListener". 4476 func FuncOffUsbEvent() (fn js.Func[func(callback js.Func[func(event_info *UsbEventInfo)])]) { 4477 bindings.FuncOffUsbEvent( 4478 js.Pointer(&fn), 4479 ) 4480 return 4481 } 4482 4483 // OffUsbEvent calls the function "WEBEXT.os.events.onUsbEvent.removeListener" directly. 4484 func OffUsbEvent(callback js.Func[func(event_info *UsbEventInfo)]) (ret js.Void) { 4485 bindings.CallOffUsbEvent( 4486 js.Pointer(&ret), 4487 callback.Ref(), 4488 ) 4489 4490 return 4491 } 4492 4493 // TryOffUsbEvent calls the function "WEBEXT.os.events.onUsbEvent.removeListener" 4494 // in a try/catch block and returns (_, err, ok = false) when it went through 4495 // the catch clause. 4496 func TryOffUsbEvent(callback js.Func[func(event_info *UsbEventInfo)]) (ret js.Void, exception js.Any, ok bool) { 4497 ok = js.True == bindings.TryOffUsbEvent( 4498 js.Pointer(&ret), js.Pointer(&exception), 4499 callback.Ref(), 4500 ) 4501 4502 return 4503 } 4504 4505 // HasFuncHasOnUsbEvent returns true if the function "WEBEXT.os.events.onUsbEvent.hasListener" exists. 4506 func HasFuncHasOnUsbEvent() bool { 4507 return js.True == bindings.HasFuncHasOnUsbEvent() 4508 } 4509 4510 // FuncHasOnUsbEvent returns the function "WEBEXT.os.events.onUsbEvent.hasListener". 4511 func FuncHasOnUsbEvent() (fn js.Func[func(callback js.Func[func(event_info *UsbEventInfo)]) bool]) { 4512 bindings.FuncHasOnUsbEvent( 4513 js.Pointer(&fn), 4514 ) 4515 return 4516 } 4517 4518 // HasOnUsbEvent calls the function "WEBEXT.os.events.onUsbEvent.hasListener" directly. 4519 func HasOnUsbEvent(callback js.Func[func(event_info *UsbEventInfo)]) (ret bool) { 4520 bindings.CallHasOnUsbEvent( 4521 js.Pointer(&ret), 4522 callback.Ref(), 4523 ) 4524 4525 return 4526 } 4527 4528 // TryHasOnUsbEvent calls the function "WEBEXT.os.events.onUsbEvent.hasListener" 4529 // in a try/catch block and returns (_, err, ok = false) when it went through 4530 // the catch clause. 4531 func TryHasOnUsbEvent(callback js.Func[func(event_info *UsbEventInfo)]) (ret bool, exception js.Any, ok bool) { 4532 ok = js.True == bindings.TryHasOnUsbEvent( 4533 js.Pointer(&ret), js.Pointer(&exception), 4534 callback.Ref(), 4535 ) 4536 4537 return 4538 } 4539 4540 // HasFuncStartCapturingEvents returns true if the function "WEBEXT.os.events.startCapturingEvents" exists. 4541 func HasFuncStartCapturingEvents() bool { 4542 return js.True == bindings.HasFuncStartCapturingEvents() 4543 } 4544 4545 // FuncStartCapturingEvents returns the function "WEBEXT.os.events.startCapturingEvents". 4546 func FuncStartCapturingEvents() (fn js.Func[func(category EventCategory) js.Promise[js.Void]]) { 4547 bindings.FuncStartCapturingEvents( 4548 js.Pointer(&fn), 4549 ) 4550 return 4551 } 4552 4553 // StartCapturingEvents calls the function "WEBEXT.os.events.startCapturingEvents" directly. 4554 func StartCapturingEvents(category EventCategory) (ret js.Promise[js.Void]) { 4555 bindings.CallStartCapturingEvents( 4556 js.Pointer(&ret), 4557 uint32(category), 4558 ) 4559 4560 return 4561 } 4562 4563 // TryStartCapturingEvents calls the function "WEBEXT.os.events.startCapturingEvents" 4564 // in a try/catch block and returns (_, err, ok = false) when it went through 4565 // the catch clause. 4566 func TryStartCapturingEvents(category EventCategory) (ret js.Promise[js.Void], exception js.Any, ok bool) { 4567 ok = js.True == bindings.TryStartCapturingEvents( 4568 js.Pointer(&ret), js.Pointer(&exception), 4569 uint32(category), 4570 ) 4571 4572 return 4573 } 4574 4575 // HasFuncStopCapturingEvents returns true if the function "WEBEXT.os.events.stopCapturingEvents" exists. 4576 func HasFuncStopCapturingEvents() bool { 4577 return js.True == bindings.HasFuncStopCapturingEvents() 4578 } 4579 4580 // FuncStopCapturingEvents returns the function "WEBEXT.os.events.stopCapturingEvents". 4581 func FuncStopCapturingEvents() (fn js.Func[func(category EventCategory) js.Promise[js.Void]]) { 4582 bindings.FuncStopCapturingEvents( 4583 js.Pointer(&fn), 4584 ) 4585 return 4586 } 4587 4588 // StopCapturingEvents calls the function "WEBEXT.os.events.stopCapturingEvents" directly. 4589 func StopCapturingEvents(category EventCategory) (ret js.Promise[js.Void]) { 4590 bindings.CallStopCapturingEvents( 4591 js.Pointer(&ret), 4592 uint32(category), 4593 ) 4594 4595 return 4596 } 4597 4598 // TryStopCapturingEvents calls the function "WEBEXT.os.events.stopCapturingEvents" 4599 // in a try/catch block and returns (_, err, ok = false) when it went through 4600 // the catch clause. 4601 func TryStopCapturingEvents(category EventCategory) (ret js.Promise[js.Void], exception js.Any, ok bool) { 4602 ok = js.True == bindings.TryStopCapturingEvents( 4603 js.Pointer(&ret), js.Pointer(&exception), 4604 uint32(category), 4605 ) 4606 4607 return 4608 }