github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/app/window/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package window 5 6 import ( 7 "github.com/primecitizens/pcz/std/core/abi" 8 "github.com/primecitizens/pcz/std/ffi/js" 9 "github.com/primecitizens/pcz/std/plat/js/webext/app/runtime" 10 "github.com/primecitizens/pcz/std/plat/js/webext/app/window/bindings" 11 ) 12 13 type ContentBounds struct { 14 // Left is "ContentBounds.left" 15 // 16 // Optional 17 // 18 // NOTE: FFI_USE_Left MUST be set to true to make this field effective. 19 Left int32 20 // Top is "ContentBounds.top" 21 // 22 // Optional 23 // 24 // NOTE: FFI_USE_Top MUST be set to true to make this field effective. 25 Top int32 26 // Width is "ContentBounds.width" 27 // 28 // Optional 29 // 30 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 31 Width int32 32 // Height is "ContentBounds.height" 33 // 34 // Optional 35 // 36 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 37 Height int32 38 39 FFI_USE_Left bool // for Left. 40 FFI_USE_Top bool // for Top. 41 FFI_USE_Width bool // for Width. 42 FFI_USE_Height bool // for Height. 43 44 FFI_USE bool 45 } 46 47 // FromRef calls UpdateFrom and returns a ContentBounds with all fields set. 48 func (p ContentBounds) FromRef(ref js.Ref) ContentBounds { 49 p.UpdateFrom(ref) 50 return p 51 } 52 53 // New creates a new ContentBounds in the application heap. 54 func (p ContentBounds) New() js.Ref { 55 return bindings.ContentBoundsJSLoad( 56 js.Pointer(&p), js.True, 0, 57 ) 58 } 59 60 // UpdateFrom copies value of all fields of the heap object to p. 61 func (p *ContentBounds) UpdateFrom(ref js.Ref) { 62 bindings.ContentBoundsJSStore( 63 js.Pointer(p), ref, 64 ) 65 } 66 67 // Update writes all fields of the p to the heap object referenced by ref. 68 func (p *ContentBounds) Update(ref js.Ref) { 69 bindings.ContentBoundsJSLoad( 70 js.Pointer(p), js.False, ref, 71 ) 72 } 73 74 // FreeMembers frees fields with heap reference, if recursive is true 75 // free all heap references reachable from p. 76 func (p *ContentBounds) FreeMembers(recursive bool) { 77 } 78 79 type Bounds struct { 80 ref js.Ref 81 } 82 83 func (this Bounds) Once() Bounds { 84 this.ref.Once() 85 return this 86 } 87 88 func (this Bounds) Ref() js.Ref { 89 return this.ref 90 } 91 92 func (this Bounds) FromRef(ref js.Ref) Bounds { 93 this.ref = ref 94 return this 95 } 96 97 func (this Bounds) Free() { 98 this.ref.Free() 99 } 100 101 // Left returns the value of property "Bounds.left". 102 // 103 // It returns ok=false if there is no such property. 104 func (this Bounds) Left() (ret int32, ok bool) { 105 ok = js.True == bindings.GetBoundsLeft( 106 this.ref, js.Pointer(&ret), 107 ) 108 return 109 } 110 111 // SetLeft sets the value of property "Bounds.left" to val. 112 // 113 // It returns false if the property cannot be set. 114 func (this Bounds) SetLeft(val int32) bool { 115 return js.True == bindings.SetBoundsLeft( 116 this.ref, 117 int32(val), 118 ) 119 } 120 121 // Top returns the value of property "Bounds.top". 122 // 123 // It returns ok=false if there is no such property. 124 func (this Bounds) Top() (ret int32, ok bool) { 125 ok = js.True == bindings.GetBoundsTop( 126 this.ref, js.Pointer(&ret), 127 ) 128 return 129 } 130 131 // SetTop sets the value of property "Bounds.top" to val. 132 // 133 // It returns false if the property cannot be set. 134 func (this Bounds) SetTop(val int32) bool { 135 return js.True == bindings.SetBoundsTop( 136 this.ref, 137 int32(val), 138 ) 139 } 140 141 // Width returns the value of property "Bounds.width". 142 // 143 // It returns ok=false if there is no such property. 144 func (this Bounds) Width() (ret int32, ok bool) { 145 ok = js.True == bindings.GetBoundsWidth( 146 this.ref, js.Pointer(&ret), 147 ) 148 return 149 } 150 151 // SetWidth sets the value of property "Bounds.width" to val. 152 // 153 // It returns false if the property cannot be set. 154 func (this Bounds) SetWidth(val int32) bool { 155 return js.True == bindings.SetBoundsWidth( 156 this.ref, 157 int32(val), 158 ) 159 } 160 161 // Height returns the value of property "Bounds.height". 162 // 163 // It returns ok=false if there is no such property. 164 func (this Bounds) Height() (ret int32, ok bool) { 165 ok = js.True == bindings.GetBoundsHeight( 166 this.ref, js.Pointer(&ret), 167 ) 168 return 169 } 170 171 // SetHeight sets the value of property "Bounds.height" to val. 172 // 173 // It returns false if the property cannot be set. 174 func (this Bounds) SetHeight(val int32) bool { 175 return js.True == bindings.SetBoundsHeight( 176 this.ref, 177 int32(val), 178 ) 179 } 180 181 // MinWidth returns the value of property "Bounds.minWidth". 182 // 183 // It returns ok=false if there is no such property. 184 func (this Bounds) MinWidth() (ret int32, ok bool) { 185 ok = js.True == bindings.GetBoundsMinWidth( 186 this.ref, js.Pointer(&ret), 187 ) 188 return 189 } 190 191 // SetMinWidth sets the value of property "Bounds.minWidth" to val. 192 // 193 // It returns false if the property cannot be set. 194 func (this Bounds) SetMinWidth(val int32) bool { 195 return js.True == bindings.SetBoundsMinWidth( 196 this.ref, 197 int32(val), 198 ) 199 } 200 201 // MinHeight returns the value of property "Bounds.minHeight". 202 // 203 // It returns ok=false if there is no such property. 204 func (this Bounds) MinHeight() (ret int32, ok bool) { 205 ok = js.True == bindings.GetBoundsMinHeight( 206 this.ref, js.Pointer(&ret), 207 ) 208 return 209 } 210 211 // SetMinHeight sets the value of property "Bounds.minHeight" to val. 212 // 213 // It returns false if the property cannot be set. 214 func (this Bounds) SetMinHeight(val int32) bool { 215 return js.True == bindings.SetBoundsMinHeight( 216 this.ref, 217 int32(val), 218 ) 219 } 220 221 // MaxWidth returns the value of property "Bounds.maxWidth". 222 // 223 // It returns ok=false if there is no such property. 224 func (this Bounds) MaxWidth() (ret int32, ok bool) { 225 ok = js.True == bindings.GetBoundsMaxWidth( 226 this.ref, js.Pointer(&ret), 227 ) 228 return 229 } 230 231 // SetMaxWidth sets the value of property "Bounds.maxWidth" to val. 232 // 233 // It returns false if the property cannot be set. 234 func (this Bounds) SetMaxWidth(val int32) bool { 235 return js.True == bindings.SetBoundsMaxWidth( 236 this.ref, 237 int32(val), 238 ) 239 } 240 241 // MaxHeight returns the value of property "Bounds.maxHeight". 242 // 243 // It returns ok=false if there is no such property. 244 func (this Bounds) MaxHeight() (ret int32, ok bool) { 245 ok = js.True == bindings.GetBoundsMaxHeight( 246 this.ref, js.Pointer(&ret), 247 ) 248 return 249 } 250 251 // SetMaxHeight sets the value of property "Bounds.maxHeight" to val. 252 // 253 // It returns false if the property cannot be set. 254 func (this Bounds) SetMaxHeight(val int32) bool { 255 return js.True == bindings.SetBoundsMaxHeight( 256 this.ref, 257 int32(val), 258 ) 259 } 260 261 // HasFuncSetPosition returns true if the method "Bounds.setPosition" exists. 262 func (this Bounds) HasFuncSetPosition() bool { 263 return js.True == bindings.HasFuncBoundsSetPosition( 264 this.ref, 265 ) 266 } 267 268 // FuncSetPosition returns the method "Bounds.setPosition". 269 func (this Bounds) FuncSetPosition() (fn js.Func[func(left int32, top int32)]) { 270 bindings.FuncBoundsSetPosition( 271 this.ref, js.Pointer(&fn), 272 ) 273 return 274 } 275 276 // SetPosition calls the method "Bounds.setPosition". 277 func (this Bounds) SetPosition(left int32, top int32) (ret js.Void) { 278 bindings.CallBoundsSetPosition( 279 this.ref, js.Pointer(&ret), 280 int32(left), 281 int32(top), 282 ) 283 284 return 285 } 286 287 // TrySetPosition calls the method "Bounds.setPosition" 288 // in a try/catch block and returns (_, err, ok = false) when it went through 289 // the catch clause. 290 func (this Bounds) TrySetPosition(left int32, top int32) (ret js.Void, exception js.Any, ok bool) { 291 ok = js.True == bindings.TryBoundsSetPosition( 292 this.ref, js.Pointer(&ret), js.Pointer(&exception), 293 int32(left), 294 int32(top), 295 ) 296 297 return 298 } 299 300 // HasFuncSetSize returns true if the method "Bounds.setSize" exists. 301 func (this Bounds) HasFuncSetSize() bool { 302 return js.True == bindings.HasFuncBoundsSetSize( 303 this.ref, 304 ) 305 } 306 307 // FuncSetSize returns the method "Bounds.setSize". 308 func (this Bounds) FuncSetSize() (fn js.Func[func(width int32, height int32)]) { 309 bindings.FuncBoundsSetSize( 310 this.ref, js.Pointer(&fn), 311 ) 312 return 313 } 314 315 // SetSize calls the method "Bounds.setSize". 316 func (this Bounds) SetSize(width int32, height int32) (ret js.Void) { 317 bindings.CallBoundsSetSize( 318 this.ref, js.Pointer(&ret), 319 int32(width), 320 int32(height), 321 ) 322 323 return 324 } 325 326 // TrySetSize calls the method "Bounds.setSize" 327 // in a try/catch block and returns (_, err, ok = false) when it went through 328 // the catch clause. 329 func (this Bounds) TrySetSize(width int32, height int32) (ret js.Void, exception js.Any, ok bool) { 330 ok = js.True == bindings.TryBoundsSetSize( 331 this.ref, js.Pointer(&ret), js.Pointer(&exception), 332 int32(width), 333 int32(height), 334 ) 335 336 return 337 } 338 339 // HasFuncSetMinimumSize returns true if the method "Bounds.setMinimumSize" exists. 340 func (this Bounds) HasFuncSetMinimumSize() bool { 341 return js.True == bindings.HasFuncBoundsSetMinimumSize( 342 this.ref, 343 ) 344 } 345 346 // FuncSetMinimumSize returns the method "Bounds.setMinimumSize". 347 func (this Bounds) FuncSetMinimumSize() (fn js.Func[func(minWidth int32, minHeight int32)]) { 348 bindings.FuncBoundsSetMinimumSize( 349 this.ref, js.Pointer(&fn), 350 ) 351 return 352 } 353 354 // SetMinimumSize calls the method "Bounds.setMinimumSize". 355 func (this Bounds) SetMinimumSize(minWidth int32, minHeight int32) (ret js.Void) { 356 bindings.CallBoundsSetMinimumSize( 357 this.ref, js.Pointer(&ret), 358 int32(minWidth), 359 int32(minHeight), 360 ) 361 362 return 363 } 364 365 // TrySetMinimumSize calls the method "Bounds.setMinimumSize" 366 // in a try/catch block and returns (_, err, ok = false) when it went through 367 // the catch clause. 368 func (this Bounds) TrySetMinimumSize(minWidth int32, minHeight int32) (ret js.Void, exception js.Any, ok bool) { 369 ok = js.True == bindings.TryBoundsSetMinimumSize( 370 this.ref, js.Pointer(&ret), js.Pointer(&exception), 371 int32(minWidth), 372 int32(minHeight), 373 ) 374 375 return 376 } 377 378 // HasFuncSetMaximumSize returns true if the method "Bounds.setMaximumSize" exists. 379 func (this Bounds) HasFuncSetMaximumSize() bool { 380 return js.True == bindings.HasFuncBoundsSetMaximumSize( 381 this.ref, 382 ) 383 } 384 385 // FuncSetMaximumSize returns the method "Bounds.setMaximumSize". 386 func (this Bounds) FuncSetMaximumSize() (fn js.Func[func(maxWidth int32, maxHeight int32)]) { 387 bindings.FuncBoundsSetMaximumSize( 388 this.ref, js.Pointer(&fn), 389 ) 390 return 391 } 392 393 // SetMaximumSize calls the method "Bounds.setMaximumSize". 394 func (this Bounds) SetMaximumSize(maxWidth int32, maxHeight int32) (ret js.Void) { 395 bindings.CallBoundsSetMaximumSize( 396 this.ref, js.Pointer(&ret), 397 int32(maxWidth), 398 int32(maxHeight), 399 ) 400 401 return 402 } 403 404 // TrySetMaximumSize calls the method "Bounds.setMaximumSize" 405 // in a try/catch block and returns (_, err, ok = false) when it went through 406 // the catch clause. 407 func (this Bounds) TrySetMaximumSize(maxWidth int32, maxHeight int32) (ret js.Void, exception js.Any, ok bool) { 408 ok = js.True == bindings.TryBoundsSetMaximumSize( 409 this.ref, js.Pointer(&ret), js.Pointer(&exception), 410 int32(maxWidth), 411 int32(maxHeight), 412 ) 413 414 return 415 } 416 417 type AppWindow struct { 418 ref js.Ref 419 } 420 421 func (this AppWindow) Once() AppWindow { 422 this.ref.Once() 423 return this 424 } 425 426 func (this AppWindow) Ref() js.Ref { 427 return this.ref 428 } 429 430 func (this AppWindow) FromRef(ref js.Ref) AppWindow { 431 this.ref = ref 432 return this 433 } 434 435 func (this AppWindow) Free() { 436 this.ref.Free() 437 } 438 439 // HasFrameColor returns the value of property "AppWindow.hasFrameColor". 440 // 441 // It returns ok=false if there is no such property. 442 func (this AppWindow) HasFrameColor() (ret bool, ok bool) { 443 ok = js.True == bindings.GetAppWindowHasFrameColor( 444 this.ref, js.Pointer(&ret), 445 ) 446 return 447 } 448 449 // SetHasFrameColor sets the value of property "AppWindow.hasFrameColor" to val. 450 // 451 // It returns false if the property cannot be set. 452 func (this AppWindow) SetHasFrameColor(val bool) bool { 453 return js.True == bindings.SetAppWindowHasFrameColor( 454 this.ref, 455 js.Bool(bool(val)), 456 ) 457 } 458 459 // ActiveFrameColor returns the value of property "AppWindow.activeFrameColor". 460 // 461 // It returns ok=false if there is no such property. 462 func (this AppWindow) ActiveFrameColor() (ret int32, ok bool) { 463 ok = js.True == bindings.GetAppWindowActiveFrameColor( 464 this.ref, js.Pointer(&ret), 465 ) 466 return 467 } 468 469 // SetActiveFrameColor sets the value of property "AppWindow.activeFrameColor" to val. 470 // 471 // It returns false if the property cannot be set. 472 func (this AppWindow) SetActiveFrameColor(val int32) bool { 473 return js.True == bindings.SetAppWindowActiveFrameColor( 474 this.ref, 475 int32(val), 476 ) 477 } 478 479 // InactiveFrameColor returns the value of property "AppWindow.inactiveFrameColor". 480 // 481 // It returns ok=false if there is no such property. 482 func (this AppWindow) InactiveFrameColor() (ret int32, ok bool) { 483 ok = js.True == bindings.GetAppWindowInactiveFrameColor( 484 this.ref, js.Pointer(&ret), 485 ) 486 return 487 } 488 489 // SetInactiveFrameColor sets the value of property "AppWindow.inactiveFrameColor" to val. 490 // 491 // It returns false if the property cannot be set. 492 func (this AppWindow) SetInactiveFrameColor(val int32) bool { 493 return js.True == bindings.SetAppWindowInactiveFrameColor( 494 this.ref, 495 int32(val), 496 ) 497 } 498 499 // ContentWindow returns the value of property "AppWindow.contentWindow". 500 // 501 // It returns ok=false if there is no such property. 502 func (this AppWindow) ContentWindow() (ret js.Object, ok bool) { 503 ok = js.True == bindings.GetAppWindowContentWindow( 504 this.ref, js.Pointer(&ret), 505 ) 506 return 507 } 508 509 // SetContentWindow sets the value of property "AppWindow.contentWindow" to val. 510 // 511 // It returns false if the property cannot be set. 512 func (this AppWindow) SetContentWindow(val js.Object) bool { 513 return js.True == bindings.SetAppWindowContentWindow( 514 this.ref, 515 val.Ref(), 516 ) 517 } 518 519 // Id returns the value of property "AppWindow.id". 520 // 521 // It returns ok=false if there is no such property. 522 func (this AppWindow) Id() (ret js.String, ok bool) { 523 ok = js.True == bindings.GetAppWindowId( 524 this.ref, js.Pointer(&ret), 525 ) 526 return 527 } 528 529 // SetId sets the value of property "AppWindow.id" to val. 530 // 531 // It returns false if the property cannot be set. 532 func (this AppWindow) SetId(val js.String) bool { 533 return js.True == bindings.SetAppWindowId( 534 this.ref, 535 val.Ref(), 536 ) 537 } 538 539 // InnerBounds returns the value of property "AppWindow.innerBounds". 540 // 541 // It returns ok=false if there is no such property. 542 func (this AppWindow) InnerBounds() (ret Bounds, ok bool) { 543 ok = js.True == bindings.GetAppWindowInnerBounds( 544 this.ref, js.Pointer(&ret), 545 ) 546 return 547 } 548 549 // SetInnerBounds sets the value of property "AppWindow.innerBounds" to val. 550 // 551 // It returns false if the property cannot be set. 552 func (this AppWindow) SetInnerBounds(val Bounds) bool { 553 return js.True == bindings.SetAppWindowInnerBounds( 554 this.ref, 555 val.Ref(), 556 ) 557 } 558 559 // OuterBounds returns the value of property "AppWindow.outerBounds". 560 // 561 // It returns ok=false if there is no such property. 562 func (this AppWindow) OuterBounds() (ret Bounds, ok bool) { 563 ok = js.True == bindings.GetAppWindowOuterBounds( 564 this.ref, js.Pointer(&ret), 565 ) 566 return 567 } 568 569 // SetOuterBounds sets the value of property "AppWindow.outerBounds" to val. 570 // 571 // It returns false if the property cannot be set. 572 func (this AppWindow) SetOuterBounds(val Bounds) bool { 573 return js.True == bindings.SetAppWindowOuterBounds( 574 this.ref, 575 val.Ref(), 576 ) 577 } 578 579 // HasFuncFocus returns true if the method "AppWindow.focus" exists. 580 func (this AppWindow) HasFuncFocus() bool { 581 return js.True == bindings.HasFuncAppWindowFocus( 582 this.ref, 583 ) 584 } 585 586 // FuncFocus returns the method "AppWindow.focus". 587 func (this AppWindow) FuncFocus() (fn js.Func[func()]) { 588 bindings.FuncAppWindowFocus( 589 this.ref, js.Pointer(&fn), 590 ) 591 return 592 } 593 594 // Focus calls the method "AppWindow.focus". 595 func (this AppWindow) Focus() (ret js.Void) { 596 bindings.CallAppWindowFocus( 597 this.ref, js.Pointer(&ret), 598 ) 599 600 return 601 } 602 603 // TryFocus calls the method "AppWindow.focus" 604 // in a try/catch block and returns (_, err, ok = false) when it went through 605 // the catch clause. 606 func (this AppWindow) TryFocus() (ret js.Void, exception js.Any, ok bool) { 607 ok = js.True == bindings.TryAppWindowFocus( 608 this.ref, js.Pointer(&ret), js.Pointer(&exception), 609 ) 610 611 return 612 } 613 614 // HasFuncFullscreen returns true if the method "AppWindow.fullscreen" exists. 615 func (this AppWindow) HasFuncFullscreen() bool { 616 return js.True == bindings.HasFuncAppWindowFullscreen( 617 this.ref, 618 ) 619 } 620 621 // FuncFullscreen returns the method "AppWindow.fullscreen". 622 func (this AppWindow) FuncFullscreen() (fn js.Func[func()]) { 623 bindings.FuncAppWindowFullscreen( 624 this.ref, js.Pointer(&fn), 625 ) 626 return 627 } 628 629 // Fullscreen calls the method "AppWindow.fullscreen". 630 func (this AppWindow) Fullscreen() (ret js.Void) { 631 bindings.CallAppWindowFullscreen( 632 this.ref, js.Pointer(&ret), 633 ) 634 635 return 636 } 637 638 // TryFullscreen calls the method "AppWindow.fullscreen" 639 // in a try/catch block and returns (_, err, ok = false) when it went through 640 // the catch clause. 641 func (this AppWindow) TryFullscreen() (ret js.Void, exception js.Any, ok bool) { 642 ok = js.True == bindings.TryAppWindowFullscreen( 643 this.ref, js.Pointer(&ret), js.Pointer(&exception), 644 ) 645 646 return 647 } 648 649 // HasFuncIsFullscreen returns true if the method "AppWindow.isFullscreen" exists. 650 func (this AppWindow) HasFuncIsFullscreen() bool { 651 return js.True == bindings.HasFuncAppWindowIsFullscreen( 652 this.ref, 653 ) 654 } 655 656 // FuncIsFullscreen returns the method "AppWindow.isFullscreen". 657 func (this AppWindow) FuncIsFullscreen() (fn js.Func[func() bool]) { 658 bindings.FuncAppWindowIsFullscreen( 659 this.ref, js.Pointer(&fn), 660 ) 661 return 662 } 663 664 // IsFullscreen calls the method "AppWindow.isFullscreen". 665 func (this AppWindow) IsFullscreen() (ret bool) { 666 bindings.CallAppWindowIsFullscreen( 667 this.ref, js.Pointer(&ret), 668 ) 669 670 return 671 } 672 673 // TryIsFullscreen calls the method "AppWindow.isFullscreen" 674 // in a try/catch block and returns (_, err, ok = false) when it went through 675 // the catch clause. 676 func (this AppWindow) TryIsFullscreen() (ret bool, exception js.Any, ok bool) { 677 ok = js.True == bindings.TryAppWindowIsFullscreen( 678 this.ref, js.Pointer(&ret), js.Pointer(&exception), 679 ) 680 681 return 682 } 683 684 // HasFuncMinimize returns true if the method "AppWindow.minimize" exists. 685 func (this AppWindow) HasFuncMinimize() bool { 686 return js.True == bindings.HasFuncAppWindowMinimize( 687 this.ref, 688 ) 689 } 690 691 // FuncMinimize returns the method "AppWindow.minimize". 692 func (this AppWindow) FuncMinimize() (fn js.Func[func()]) { 693 bindings.FuncAppWindowMinimize( 694 this.ref, js.Pointer(&fn), 695 ) 696 return 697 } 698 699 // Minimize calls the method "AppWindow.minimize". 700 func (this AppWindow) Minimize() (ret js.Void) { 701 bindings.CallAppWindowMinimize( 702 this.ref, js.Pointer(&ret), 703 ) 704 705 return 706 } 707 708 // TryMinimize calls the method "AppWindow.minimize" 709 // in a try/catch block and returns (_, err, ok = false) when it went through 710 // the catch clause. 711 func (this AppWindow) TryMinimize() (ret js.Void, exception js.Any, ok bool) { 712 ok = js.True == bindings.TryAppWindowMinimize( 713 this.ref, js.Pointer(&ret), js.Pointer(&exception), 714 ) 715 716 return 717 } 718 719 // HasFuncIsMinimized returns true if the method "AppWindow.isMinimized" exists. 720 func (this AppWindow) HasFuncIsMinimized() bool { 721 return js.True == bindings.HasFuncAppWindowIsMinimized( 722 this.ref, 723 ) 724 } 725 726 // FuncIsMinimized returns the method "AppWindow.isMinimized". 727 func (this AppWindow) FuncIsMinimized() (fn js.Func[func() bool]) { 728 bindings.FuncAppWindowIsMinimized( 729 this.ref, js.Pointer(&fn), 730 ) 731 return 732 } 733 734 // IsMinimized calls the method "AppWindow.isMinimized". 735 func (this AppWindow) IsMinimized() (ret bool) { 736 bindings.CallAppWindowIsMinimized( 737 this.ref, js.Pointer(&ret), 738 ) 739 740 return 741 } 742 743 // TryIsMinimized calls the method "AppWindow.isMinimized" 744 // in a try/catch block and returns (_, err, ok = false) when it went through 745 // the catch clause. 746 func (this AppWindow) TryIsMinimized() (ret bool, exception js.Any, ok bool) { 747 ok = js.True == bindings.TryAppWindowIsMinimized( 748 this.ref, js.Pointer(&ret), js.Pointer(&exception), 749 ) 750 751 return 752 } 753 754 // HasFuncMaximize returns true if the method "AppWindow.maximize" exists. 755 func (this AppWindow) HasFuncMaximize() bool { 756 return js.True == bindings.HasFuncAppWindowMaximize( 757 this.ref, 758 ) 759 } 760 761 // FuncMaximize returns the method "AppWindow.maximize". 762 func (this AppWindow) FuncMaximize() (fn js.Func[func()]) { 763 bindings.FuncAppWindowMaximize( 764 this.ref, js.Pointer(&fn), 765 ) 766 return 767 } 768 769 // Maximize calls the method "AppWindow.maximize". 770 func (this AppWindow) Maximize() (ret js.Void) { 771 bindings.CallAppWindowMaximize( 772 this.ref, js.Pointer(&ret), 773 ) 774 775 return 776 } 777 778 // TryMaximize calls the method "AppWindow.maximize" 779 // in a try/catch block and returns (_, err, ok = false) when it went through 780 // the catch clause. 781 func (this AppWindow) TryMaximize() (ret js.Void, exception js.Any, ok bool) { 782 ok = js.True == bindings.TryAppWindowMaximize( 783 this.ref, js.Pointer(&ret), js.Pointer(&exception), 784 ) 785 786 return 787 } 788 789 // HasFuncIsMaximized returns true if the method "AppWindow.isMaximized" exists. 790 func (this AppWindow) HasFuncIsMaximized() bool { 791 return js.True == bindings.HasFuncAppWindowIsMaximized( 792 this.ref, 793 ) 794 } 795 796 // FuncIsMaximized returns the method "AppWindow.isMaximized". 797 func (this AppWindow) FuncIsMaximized() (fn js.Func[func() bool]) { 798 bindings.FuncAppWindowIsMaximized( 799 this.ref, js.Pointer(&fn), 800 ) 801 return 802 } 803 804 // IsMaximized calls the method "AppWindow.isMaximized". 805 func (this AppWindow) IsMaximized() (ret bool) { 806 bindings.CallAppWindowIsMaximized( 807 this.ref, js.Pointer(&ret), 808 ) 809 810 return 811 } 812 813 // TryIsMaximized calls the method "AppWindow.isMaximized" 814 // in a try/catch block and returns (_, err, ok = false) when it went through 815 // the catch clause. 816 func (this AppWindow) TryIsMaximized() (ret bool, exception js.Any, ok bool) { 817 ok = js.True == bindings.TryAppWindowIsMaximized( 818 this.ref, js.Pointer(&ret), js.Pointer(&exception), 819 ) 820 821 return 822 } 823 824 // HasFuncRestore returns true if the method "AppWindow.restore" exists. 825 func (this AppWindow) HasFuncRestore() bool { 826 return js.True == bindings.HasFuncAppWindowRestore( 827 this.ref, 828 ) 829 } 830 831 // FuncRestore returns the method "AppWindow.restore". 832 func (this AppWindow) FuncRestore() (fn js.Func[func()]) { 833 bindings.FuncAppWindowRestore( 834 this.ref, js.Pointer(&fn), 835 ) 836 return 837 } 838 839 // Restore calls the method "AppWindow.restore". 840 func (this AppWindow) Restore() (ret js.Void) { 841 bindings.CallAppWindowRestore( 842 this.ref, js.Pointer(&ret), 843 ) 844 845 return 846 } 847 848 // TryRestore calls the method "AppWindow.restore" 849 // in a try/catch block and returns (_, err, ok = false) when it went through 850 // the catch clause. 851 func (this AppWindow) TryRestore() (ret js.Void, exception js.Any, ok bool) { 852 ok = js.True == bindings.TryAppWindowRestore( 853 this.ref, js.Pointer(&ret), js.Pointer(&exception), 854 ) 855 856 return 857 } 858 859 // HasFuncMoveTo returns true if the method "AppWindow.moveTo" exists. 860 func (this AppWindow) HasFuncMoveTo() bool { 861 return js.True == bindings.HasFuncAppWindowMoveTo( 862 this.ref, 863 ) 864 } 865 866 // FuncMoveTo returns the method "AppWindow.moveTo". 867 func (this AppWindow) FuncMoveTo() (fn js.Func[func(left int32, top int32)]) { 868 bindings.FuncAppWindowMoveTo( 869 this.ref, js.Pointer(&fn), 870 ) 871 return 872 } 873 874 // MoveTo calls the method "AppWindow.moveTo". 875 func (this AppWindow) MoveTo(left int32, top int32) (ret js.Void) { 876 bindings.CallAppWindowMoveTo( 877 this.ref, js.Pointer(&ret), 878 int32(left), 879 int32(top), 880 ) 881 882 return 883 } 884 885 // TryMoveTo calls the method "AppWindow.moveTo" 886 // in a try/catch block and returns (_, err, ok = false) when it went through 887 // the catch clause. 888 func (this AppWindow) TryMoveTo(left int32, top int32) (ret js.Void, exception js.Any, ok bool) { 889 ok = js.True == bindings.TryAppWindowMoveTo( 890 this.ref, js.Pointer(&ret), js.Pointer(&exception), 891 int32(left), 892 int32(top), 893 ) 894 895 return 896 } 897 898 // HasFuncResizeTo returns true if the method "AppWindow.resizeTo" exists. 899 func (this AppWindow) HasFuncResizeTo() bool { 900 return js.True == bindings.HasFuncAppWindowResizeTo( 901 this.ref, 902 ) 903 } 904 905 // FuncResizeTo returns the method "AppWindow.resizeTo". 906 func (this AppWindow) FuncResizeTo() (fn js.Func[func(width int32, height int32)]) { 907 bindings.FuncAppWindowResizeTo( 908 this.ref, js.Pointer(&fn), 909 ) 910 return 911 } 912 913 // ResizeTo calls the method "AppWindow.resizeTo". 914 func (this AppWindow) ResizeTo(width int32, height int32) (ret js.Void) { 915 bindings.CallAppWindowResizeTo( 916 this.ref, js.Pointer(&ret), 917 int32(width), 918 int32(height), 919 ) 920 921 return 922 } 923 924 // TryResizeTo calls the method "AppWindow.resizeTo" 925 // in a try/catch block and returns (_, err, ok = false) when it went through 926 // the catch clause. 927 func (this AppWindow) TryResizeTo(width int32, height int32) (ret js.Void, exception js.Any, ok bool) { 928 ok = js.True == bindings.TryAppWindowResizeTo( 929 this.ref, js.Pointer(&ret), js.Pointer(&exception), 930 int32(width), 931 int32(height), 932 ) 933 934 return 935 } 936 937 // HasFuncDrawAttention returns true if the method "AppWindow.drawAttention" exists. 938 func (this AppWindow) HasFuncDrawAttention() bool { 939 return js.True == bindings.HasFuncAppWindowDrawAttention( 940 this.ref, 941 ) 942 } 943 944 // FuncDrawAttention returns the method "AppWindow.drawAttention". 945 func (this AppWindow) FuncDrawAttention() (fn js.Func[func()]) { 946 bindings.FuncAppWindowDrawAttention( 947 this.ref, js.Pointer(&fn), 948 ) 949 return 950 } 951 952 // DrawAttention calls the method "AppWindow.drawAttention". 953 func (this AppWindow) DrawAttention() (ret js.Void) { 954 bindings.CallAppWindowDrawAttention( 955 this.ref, js.Pointer(&ret), 956 ) 957 958 return 959 } 960 961 // TryDrawAttention calls the method "AppWindow.drawAttention" 962 // in a try/catch block and returns (_, err, ok = false) when it went through 963 // the catch clause. 964 func (this AppWindow) TryDrawAttention() (ret js.Void, exception js.Any, ok bool) { 965 ok = js.True == bindings.TryAppWindowDrawAttention( 966 this.ref, js.Pointer(&ret), js.Pointer(&exception), 967 ) 968 969 return 970 } 971 972 // HasFuncClearAttention returns true if the method "AppWindow.clearAttention" exists. 973 func (this AppWindow) HasFuncClearAttention() bool { 974 return js.True == bindings.HasFuncAppWindowClearAttention( 975 this.ref, 976 ) 977 } 978 979 // FuncClearAttention returns the method "AppWindow.clearAttention". 980 func (this AppWindow) FuncClearAttention() (fn js.Func[func()]) { 981 bindings.FuncAppWindowClearAttention( 982 this.ref, js.Pointer(&fn), 983 ) 984 return 985 } 986 987 // ClearAttention calls the method "AppWindow.clearAttention". 988 func (this AppWindow) ClearAttention() (ret js.Void) { 989 bindings.CallAppWindowClearAttention( 990 this.ref, js.Pointer(&ret), 991 ) 992 993 return 994 } 995 996 // TryClearAttention calls the method "AppWindow.clearAttention" 997 // in a try/catch block and returns (_, err, ok = false) when it went through 998 // the catch clause. 999 func (this AppWindow) TryClearAttention() (ret js.Void, exception js.Any, ok bool) { 1000 ok = js.True == bindings.TryAppWindowClearAttention( 1001 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1002 ) 1003 1004 return 1005 } 1006 1007 // HasFuncClose returns true if the method "AppWindow.close" exists. 1008 func (this AppWindow) HasFuncClose() bool { 1009 return js.True == bindings.HasFuncAppWindowClose( 1010 this.ref, 1011 ) 1012 } 1013 1014 // FuncClose returns the method "AppWindow.close". 1015 func (this AppWindow) FuncClose() (fn js.Func[func()]) { 1016 bindings.FuncAppWindowClose( 1017 this.ref, js.Pointer(&fn), 1018 ) 1019 return 1020 } 1021 1022 // Close calls the method "AppWindow.close". 1023 func (this AppWindow) Close() (ret js.Void) { 1024 bindings.CallAppWindowClose( 1025 this.ref, js.Pointer(&ret), 1026 ) 1027 1028 return 1029 } 1030 1031 // TryClose calls the method "AppWindow.close" 1032 // in a try/catch block and returns (_, err, ok = false) when it went through 1033 // the catch clause. 1034 func (this AppWindow) TryClose() (ret js.Void, exception js.Any, ok bool) { 1035 ok = js.True == bindings.TryAppWindowClose( 1036 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1037 ) 1038 1039 return 1040 } 1041 1042 // HasFuncShow returns true if the method "AppWindow.show" exists. 1043 func (this AppWindow) HasFuncShow() bool { 1044 return js.True == bindings.HasFuncAppWindowShow( 1045 this.ref, 1046 ) 1047 } 1048 1049 // FuncShow returns the method "AppWindow.show". 1050 func (this AppWindow) FuncShow() (fn js.Func[func(focused bool)]) { 1051 bindings.FuncAppWindowShow( 1052 this.ref, js.Pointer(&fn), 1053 ) 1054 return 1055 } 1056 1057 // Show calls the method "AppWindow.show". 1058 func (this AppWindow) Show(focused bool) (ret js.Void) { 1059 bindings.CallAppWindowShow( 1060 this.ref, js.Pointer(&ret), 1061 js.Bool(bool(focused)), 1062 ) 1063 1064 return 1065 } 1066 1067 // TryShow calls the method "AppWindow.show" 1068 // in a try/catch block and returns (_, err, ok = false) when it went through 1069 // the catch clause. 1070 func (this AppWindow) TryShow(focused bool) (ret js.Void, exception js.Any, ok bool) { 1071 ok = js.True == bindings.TryAppWindowShow( 1072 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1073 js.Bool(bool(focused)), 1074 ) 1075 1076 return 1077 } 1078 1079 // HasFuncShow1 returns true if the method "AppWindow.show" exists. 1080 func (this AppWindow) HasFuncShow1() bool { 1081 return js.True == bindings.HasFuncAppWindowShow1( 1082 this.ref, 1083 ) 1084 } 1085 1086 // FuncShow1 returns the method "AppWindow.show". 1087 func (this AppWindow) FuncShow1() (fn js.Func[func()]) { 1088 bindings.FuncAppWindowShow1( 1089 this.ref, js.Pointer(&fn), 1090 ) 1091 return 1092 } 1093 1094 // Show1 calls the method "AppWindow.show". 1095 func (this AppWindow) Show1() (ret js.Void) { 1096 bindings.CallAppWindowShow1( 1097 this.ref, js.Pointer(&ret), 1098 ) 1099 1100 return 1101 } 1102 1103 // TryShow1 calls the method "AppWindow.show" 1104 // in a try/catch block and returns (_, err, ok = false) when it went through 1105 // the catch clause. 1106 func (this AppWindow) TryShow1() (ret js.Void, exception js.Any, ok bool) { 1107 ok = js.True == bindings.TryAppWindowShow1( 1108 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1109 ) 1110 1111 return 1112 } 1113 1114 // HasFuncHide returns true if the method "AppWindow.hide" exists. 1115 func (this AppWindow) HasFuncHide() bool { 1116 return js.True == bindings.HasFuncAppWindowHide( 1117 this.ref, 1118 ) 1119 } 1120 1121 // FuncHide returns the method "AppWindow.hide". 1122 func (this AppWindow) FuncHide() (fn js.Func[func()]) { 1123 bindings.FuncAppWindowHide( 1124 this.ref, js.Pointer(&fn), 1125 ) 1126 return 1127 } 1128 1129 // Hide calls the method "AppWindow.hide". 1130 func (this AppWindow) Hide() (ret js.Void) { 1131 bindings.CallAppWindowHide( 1132 this.ref, js.Pointer(&ret), 1133 ) 1134 1135 return 1136 } 1137 1138 // TryHide calls the method "AppWindow.hide" 1139 // in a try/catch block and returns (_, err, ok = false) when it went through 1140 // the catch clause. 1141 func (this AppWindow) TryHide() (ret js.Void, exception js.Any, ok bool) { 1142 ok = js.True == bindings.TryAppWindowHide( 1143 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1144 ) 1145 1146 return 1147 } 1148 1149 // HasFuncGetBounds returns true if the method "AppWindow.getBounds" exists. 1150 func (this AppWindow) HasFuncGetBounds() bool { 1151 return js.True == bindings.HasFuncAppWindowGetBounds( 1152 this.ref, 1153 ) 1154 } 1155 1156 // FuncGetBounds returns the method "AppWindow.getBounds". 1157 func (this AppWindow) FuncGetBounds() (fn js.Func[func() ContentBounds]) { 1158 bindings.FuncAppWindowGetBounds( 1159 this.ref, js.Pointer(&fn), 1160 ) 1161 return 1162 } 1163 1164 // GetBounds calls the method "AppWindow.getBounds". 1165 func (this AppWindow) GetBounds() (ret ContentBounds) { 1166 bindings.CallAppWindowGetBounds( 1167 this.ref, js.Pointer(&ret), 1168 ) 1169 1170 return 1171 } 1172 1173 // TryGetBounds calls the method "AppWindow.getBounds" 1174 // in a try/catch block and returns (_, err, ok = false) when it went through 1175 // the catch clause. 1176 func (this AppWindow) TryGetBounds() (ret ContentBounds, exception js.Any, ok bool) { 1177 ok = js.True == bindings.TryAppWindowGetBounds( 1178 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1179 ) 1180 1181 return 1182 } 1183 1184 // HasFuncSetBounds returns true if the method "AppWindow.setBounds" exists. 1185 func (this AppWindow) HasFuncSetBounds() bool { 1186 return js.True == bindings.HasFuncAppWindowSetBounds( 1187 this.ref, 1188 ) 1189 } 1190 1191 // FuncSetBounds returns the method "AppWindow.setBounds". 1192 func (this AppWindow) FuncSetBounds() (fn js.Func[func(bounds ContentBounds)]) { 1193 bindings.FuncAppWindowSetBounds( 1194 this.ref, js.Pointer(&fn), 1195 ) 1196 return 1197 } 1198 1199 // SetBounds calls the method "AppWindow.setBounds". 1200 func (this AppWindow) SetBounds(bounds ContentBounds) (ret js.Void) { 1201 bindings.CallAppWindowSetBounds( 1202 this.ref, js.Pointer(&ret), 1203 js.Pointer(&bounds), 1204 ) 1205 1206 return 1207 } 1208 1209 // TrySetBounds calls the method "AppWindow.setBounds" 1210 // in a try/catch block and returns (_, err, ok = false) when it went through 1211 // the catch clause. 1212 func (this AppWindow) TrySetBounds(bounds ContentBounds) (ret js.Void, exception js.Any, ok bool) { 1213 ok = js.True == bindings.TryAppWindowSetBounds( 1214 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1215 js.Pointer(&bounds), 1216 ) 1217 1218 return 1219 } 1220 1221 // HasFuncSetIcon returns true if the method "AppWindow.setIcon" exists. 1222 func (this AppWindow) HasFuncSetIcon() bool { 1223 return js.True == bindings.HasFuncAppWindowSetIcon( 1224 this.ref, 1225 ) 1226 } 1227 1228 // FuncSetIcon returns the method "AppWindow.setIcon". 1229 func (this AppWindow) FuncSetIcon() (fn js.Func[func(iconUrl js.String)]) { 1230 bindings.FuncAppWindowSetIcon( 1231 this.ref, js.Pointer(&fn), 1232 ) 1233 return 1234 } 1235 1236 // SetIcon calls the method "AppWindow.setIcon". 1237 func (this AppWindow) SetIcon(iconUrl js.String) (ret js.Void) { 1238 bindings.CallAppWindowSetIcon( 1239 this.ref, js.Pointer(&ret), 1240 iconUrl.Ref(), 1241 ) 1242 1243 return 1244 } 1245 1246 // TrySetIcon calls the method "AppWindow.setIcon" 1247 // in a try/catch block and returns (_, err, ok = false) when it went through 1248 // the catch clause. 1249 func (this AppWindow) TrySetIcon(iconUrl js.String) (ret js.Void, exception js.Any, ok bool) { 1250 ok = js.True == bindings.TryAppWindowSetIcon( 1251 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1252 iconUrl.Ref(), 1253 ) 1254 1255 return 1256 } 1257 1258 // HasFuncIsAlwaysOnTop returns true if the method "AppWindow.isAlwaysOnTop" exists. 1259 func (this AppWindow) HasFuncIsAlwaysOnTop() bool { 1260 return js.True == bindings.HasFuncAppWindowIsAlwaysOnTop( 1261 this.ref, 1262 ) 1263 } 1264 1265 // FuncIsAlwaysOnTop returns the method "AppWindow.isAlwaysOnTop". 1266 func (this AppWindow) FuncIsAlwaysOnTop() (fn js.Func[func() bool]) { 1267 bindings.FuncAppWindowIsAlwaysOnTop( 1268 this.ref, js.Pointer(&fn), 1269 ) 1270 return 1271 } 1272 1273 // IsAlwaysOnTop calls the method "AppWindow.isAlwaysOnTop". 1274 func (this AppWindow) IsAlwaysOnTop() (ret bool) { 1275 bindings.CallAppWindowIsAlwaysOnTop( 1276 this.ref, js.Pointer(&ret), 1277 ) 1278 1279 return 1280 } 1281 1282 // TryIsAlwaysOnTop calls the method "AppWindow.isAlwaysOnTop" 1283 // in a try/catch block and returns (_, err, ok = false) when it went through 1284 // the catch clause. 1285 func (this AppWindow) TryIsAlwaysOnTop() (ret bool, exception js.Any, ok bool) { 1286 ok = js.True == bindings.TryAppWindowIsAlwaysOnTop( 1287 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1288 ) 1289 1290 return 1291 } 1292 1293 // HasFuncSetAlwaysOnTop returns true if the method "AppWindow.setAlwaysOnTop" exists. 1294 func (this AppWindow) HasFuncSetAlwaysOnTop() bool { 1295 return js.True == bindings.HasFuncAppWindowSetAlwaysOnTop( 1296 this.ref, 1297 ) 1298 } 1299 1300 // FuncSetAlwaysOnTop returns the method "AppWindow.setAlwaysOnTop". 1301 func (this AppWindow) FuncSetAlwaysOnTop() (fn js.Func[func(alwaysOnTop bool)]) { 1302 bindings.FuncAppWindowSetAlwaysOnTop( 1303 this.ref, js.Pointer(&fn), 1304 ) 1305 return 1306 } 1307 1308 // SetAlwaysOnTop calls the method "AppWindow.setAlwaysOnTop". 1309 func (this AppWindow) SetAlwaysOnTop(alwaysOnTop bool) (ret js.Void) { 1310 bindings.CallAppWindowSetAlwaysOnTop( 1311 this.ref, js.Pointer(&ret), 1312 js.Bool(bool(alwaysOnTop)), 1313 ) 1314 1315 return 1316 } 1317 1318 // TrySetAlwaysOnTop calls the method "AppWindow.setAlwaysOnTop" 1319 // in a try/catch block and returns (_, err, ok = false) when it went through 1320 // the catch clause. 1321 func (this AppWindow) TrySetAlwaysOnTop(alwaysOnTop bool) (ret js.Void, exception js.Any, ok bool) { 1322 ok = js.True == bindings.TryAppWindowSetAlwaysOnTop( 1323 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1324 js.Bool(bool(alwaysOnTop)), 1325 ) 1326 1327 return 1328 } 1329 1330 // HasFuncAlphaEnabled returns true if the method "AppWindow.alphaEnabled" exists. 1331 func (this AppWindow) HasFuncAlphaEnabled() bool { 1332 return js.True == bindings.HasFuncAppWindowAlphaEnabled( 1333 this.ref, 1334 ) 1335 } 1336 1337 // FuncAlphaEnabled returns the method "AppWindow.alphaEnabled". 1338 func (this AppWindow) FuncAlphaEnabled() (fn js.Func[func() bool]) { 1339 bindings.FuncAppWindowAlphaEnabled( 1340 this.ref, js.Pointer(&fn), 1341 ) 1342 return 1343 } 1344 1345 // AlphaEnabled calls the method "AppWindow.alphaEnabled". 1346 func (this AppWindow) AlphaEnabled() (ret bool) { 1347 bindings.CallAppWindowAlphaEnabled( 1348 this.ref, js.Pointer(&ret), 1349 ) 1350 1351 return 1352 } 1353 1354 // TryAlphaEnabled calls the method "AppWindow.alphaEnabled" 1355 // in a try/catch block and returns (_, err, ok = false) when it went through 1356 // the catch clause. 1357 func (this AppWindow) TryAlphaEnabled() (ret bool, exception js.Any, ok bool) { 1358 ok = js.True == bindings.TryAppWindowAlphaEnabled( 1359 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1360 ) 1361 1362 return 1363 } 1364 1365 // HasFuncSetVisibleOnAllWorkspaces returns true if the method "AppWindow.setVisibleOnAllWorkspaces" exists. 1366 func (this AppWindow) HasFuncSetVisibleOnAllWorkspaces() bool { 1367 return js.True == bindings.HasFuncAppWindowSetVisibleOnAllWorkspaces( 1368 this.ref, 1369 ) 1370 } 1371 1372 // FuncSetVisibleOnAllWorkspaces returns the method "AppWindow.setVisibleOnAllWorkspaces". 1373 func (this AppWindow) FuncSetVisibleOnAllWorkspaces() (fn js.Func[func(alwaysVisible bool)]) { 1374 bindings.FuncAppWindowSetVisibleOnAllWorkspaces( 1375 this.ref, js.Pointer(&fn), 1376 ) 1377 return 1378 } 1379 1380 // SetVisibleOnAllWorkspaces calls the method "AppWindow.setVisibleOnAllWorkspaces". 1381 func (this AppWindow) SetVisibleOnAllWorkspaces(alwaysVisible bool) (ret js.Void) { 1382 bindings.CallAppWindowSetVisibleOnAllWorkspaces( 1383 this.ref, js.Pointer(&ret), 1384 js.Bool(bool(alwaysVisible)), 1385 ) 1386 1387 return 1388 } 1389 1390 // TrySetVisibleOnAllWorkspaces calls the method "AppWindow.setVisibleOnAllWorkspaces" 1391 // in a try/catch block and returns (_, err, ok = false) when it went through 1392 // the catch clause. 1393 func (this AppWindow) TrySetVisibleOnAllWorkspaces(alwaysVisible bool) (ret js.Void, exception js.Any, ok bool) { 1394 ok = js.True == bindings.TryAppWindowSetVisibleOnAllWorkspaces( 1395 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1396 js.Bool(bool(alwaysVisible)), 1397 ) 1398 1399 return 1400 } 1401 1402 type BoundsSpecification struct { 1403 // Left is "BoundsSpecification.left" 1404 // 1405 // Optional 1406 // 1407 // NOTE: FFI_USE_Left MUST be set to true to make this field effective. 1408 Left int32 1409 // Top is "BoundsSpecification.top" 1410 // 1411 // Optional 1412 // 1413 // NOTE: FFI_USE_Top MUST be set to true to make this field effective. 1414 Top int32 1415 // Width is "BoundsSpecification.width" 1416 // 1417 // Optional 1418 // 1419 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 1420 Width int32 1421 // Height is "BoundsSpecification.height" 1422 // 1423 // Optional 1424 // 1425 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 1426 Height int32 1427 // MinWidth is "BoundsSpecification.minWidth" 1428 // 1429 // Optional 1430 // 1431 // NOTE: FFI_USE_MinWidth MUST be set to true to make this field effective. 1432 MinWidth int32 1433 // MinHeight is "BoundsSpecification.minHeight" 1434 // 1435 // Optional 1436 // 1437 // NOTE: FFI_USE_MinHeight MUST be set to true to make this field effective. 1438 MinHeight int32 1439 // MaxWidth is "BoundsSpecification.maxWidth" 1440 // 1441 // Optional 1442 // 1443 // NOTE: FFI_USE_MaxWidth MUST be set to true to make this field effective. 1444 MaxWidth int32 1445 // MaxHeight is "BoundsSpecification.maxHeight" 1446 // 1447 // Optional 1448 // 1449 // NOTE: FFI_USE_MaxHeight MUST be set to true to make this field effective. 1450 MaxHeight int32 1451 1452 FFI_USE_Left bool // for Left. 1453 FFI_USE_Top bool // for Top. 1454 FFI_USE_Width bool // for Width. 1455 FFI_USE_Height bool // for Height. 1456 FFI_USE_MinWidth bool // for MinWidth. 1457 FFI_USE_MinHeight bool // for MinHeight. 1458 FFI_USE_MaxWidth bool // for MaxWidth. 1459 FFI_USE_MaxHeight bool // for MaxHeight. 1460 1461 FFI_USE bool 1462 } 1463 1464 // FromRef calls UpdateFrom and returns a BoundsSpecification with all fields set. 1465 func (p BoundsSpecification) FromRef(ref js.Ref) BoundsSpecification { 1466 p.UpdateFrom(ref) 1467 return p 1468 } 1469 1470 // New creates a new BoundsSpecification in the application heap. 1471 func (p BoundsSpecification) New() js.Ref { 1472 return bindings.BoundsSpecificationJSLoad( 1473 js.Pointer(&p), js.True, 0, 1474 ) 1475 } 1476 1477 // UpdateFrom copies value of all fields of the heap object to p. 1478 func (p *BoundsSpecification) UpdateFrom(ref js.Ref) { 1479 bindings.BoundsSpecificationJSStore( 1480 js.Pointer(p), ref, 1481 ) 1482 } 1483 1484 // Update writes all fields of the p to the heap object referenced by ref. 1485 func (p *BoundsSpecification) Update(ref js.Ref) { 1486 bindings.BoundsSpecificationJSLoad( 1487 js.Pointer(p), js.False, ref, 1488 ) 1489 } 1490 1491 // FreeMembers frees fields with heap reference, if recursive is true 1492 // free all heap references reachable from p. 1493 func (p *BoundsSpecification) FreeMembers(recursive bool) { 1494 } 1495 1496 type CreateWindowCallbackFunc func(this js.Ref, createdWindow js.Object) js.Ref 1497 1498 func (fn CreateWindowCallbackFunc) Register() js.Func[func(createdWindow js.Object)] { 1499 return js.RegisterCallback[func(createdWindow js.Object)]( 1500 fn, abi.FuncPCABIInternal(fn), 1501 ) 1502 } 1503 1504 func (fn CreateWindowCallbackFunc) DispatchCallback( 1505 targetPC uintptr, ctx *js.CallbackContext, 1506 ) { 1507 args := ctx.Args() 1508 if len(args) != 1+1 /* js this */ || 1509 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1510 js.ThrowInvalidCallbackInvocation() 1511 } 1512 1513 if ctx.Return(fn( 1514 args[0], 1515 1516 js.Object{}.FromRef(args[0+1]), 1517 )) { 1518 return 1519 } 1520 1521 js.ThrowCallbackValueNotReturned() 1522 } 1523 1524 type CreateWindowCallback[T any] struct { 1525 Fn func(arg T, this js.Ref, createdWindow js.Object) js.Ref 1526 Arg T 1527 } 1528 1529 func (cb *CreateWindowCallback[T]) Register() js.Func[func(createdWindow js.Object)] { 1530 return js.RegisterCallback[func(createdWindow js.Object)]( 1531 cb, abi.FuncPCABIInternal(cb.Fn), 1532 ) 1533 } 1534 1535 func (cb *CreateWindowCallback[T]) DispatchCallback( 1536 targetPC uintptr, ctx *js.CallbackContext, 1537 ) { 1538 args := ctx.Args() 1539 if len(args) != 1+1 /* js this */ || 1540 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1541 js.ThrowInvalidCallbackInvocation() 1542 } 1543 1544 if ctx.Return(cb.Fn( 1545 cb.Arg, 1546 args[0], 1547 1548 js.Object{}.FromRef(args[0+1]), 1549 )) { 1550 return 1551 } 1552 1553 js.ThrowCallbackValueNotReturned() 1554 } 1555 1556 type WindowType uint32 1557 1558 const ( 1559 _ WindowType = iota 1560 1561 WindowType_SHELL 1562 WindowType_PANEL 1563 ) 1564 1565 func (WindowType) FromRef(str js.Ref) WindowType { 1566 return WindowType(bindings.ConstOfWindowType(str)) 1567 } 1568 1569 func (x WindowType) String() (string, bool) { 1570 switch x { 1571 case WindowType_SHELL: 1572 return "shell", true 1573 case WindowType_PANEL: 1574 return "panel", true 1575 default: 1576 return "", false 1577 } 1578 } 1579 1580 type FrameOptions struct { 1581 // Type is "FrameOptions.type" 1582 // 1583 // Optional 1584 Type js.String 1585 // Color is "FrameOptions.color" 1586 // 1587 // Optional 1588 Color js.String 1589 // ActiveColor is "FrameOptions.activeColor" 1590 // 1591 // Optional 1592 ActiveColor js.String 1593 // InactiveColor is "FrameOptions.inactiveColor" 1594 // 1595 // Optional 1596 InactiveColor js.String 1597 1598 FFI_USE bool 1599 } 1600 1601 // FromRef calls UpdateFrom and returns a FrameOptions with all fields set. 1602 func (p FrameOptions) FromRef(ref js.Ref) FrameOptions { 1603 p.UpdateFrom(ref) 1604 return p 1605 } 1606 1607 // New creates a new FrameOptions in the application heap. 1608 func (p FrameOptions) New() js.Ref { 1609 return bindings.FrameOptionsJSLoad( 1610 js.Pointer(&p), js.True, 0, 1611 ) 1612 } 1613 1614 // UpdateFrom copies value of all fields of the heap object to p. 1615 func (p *FrameOptions) UpdateFrom(ref js.Ref) { 1616 bindings.FrameOptionsJSStore( 1617 js.Pointer(p), ref, 1618 ) 1619 } 1620 1621 // Update writes all fields of the p to the heap object referenced by ref. 1622 func (p *FrameOptions) Update(ref js.Ref) { 1623 bindings.FrameOptionsJSLoad( 1624 js.Pointer(p), js.False, ref, 1625 ) 1626 } 1627 1628 // FreeMembers frees fields with heap reference, if recursive is true 1629 // free all heap references reachable from p. 1630 func (p *FrameOptions) FreeMembers(recursive bool) { 1631 js.Free( 1632 p.Type.Ref(), 1633 p.Color.Ref(), 1634 p.ActiveColor.Ref(), 1635 p.InactiveColor.Ref(), 1636 ) 1637 p.Type = p.Type.FromRef(js.Undefined) 1638 p.Color = p.Color.FromRef(js.Undefined) 1639 p.ActiveColor = p.ActiveColor.FromRef(js.Undefined) 1640 p.InactiveColor = p.InactiveColor.FromRef(js.Undefined) 1641 } 1642 1643 type OneOf_String_FrameOptions struct { 1644 ref js.Ref 1645 } 1646 1647 func (x OneOf_String_FrameOptions) Ref() js.Ref { 1648 return x.ref 1649 } 1650 1651 func (x OneOf_String_FrameOptions) Free() { 1652 x.ref.Free() 1653 } 1654 1655 func (x OneOf_String_FrameOptions) FromRef(ref js.Ref) OneOf_String_FrameOptions { 1656 return OneOf_String_FrameOptions{ 1657 ref: ref, 1658 } 1659 } 1660 1661 func (x OneOf_String_FrameOptions) String() js.String { 1662 return js.String{}.FromRef(x.ref) 1663 } 1664 1665 func (x OneOf_String_FrameOptions) FrameOptions() FrameOptions { 1666 var ret FrameOptions 1667 ret.UpdateFrom(x.ref) 1668 return ret 1669 } 1670 1671 type State uint32 1672 1673 const ( 1674 _ State = iota 1675 1676 State_NORMAL 1677 State_FULLSCREEN 1678 State_MAXIMIZED 1679 State_MINIMIZED 1680 ) 1681 1682 func (State) FromRef(str js.Ref) State { 1683 return State(bindings.ConstOfState(str)) 1684 } 1685 1686 func (x State) String() (string, bool) { 1687 switch x { 1688 case State_NORMAL: 1689 return "normal", true 1690 case State_FULLSCREEN: 1691 return "fullscreen", true 1692 case State_MAXIMIZED: 1693 return "maximized", true 1694 case State_MINIMIZED: 1695 return "minimized", true 1696 default: 1697 return "", false 1698 } 1699 } 1700 1701 type CreateWindowOptions struct { 1702 // Id is "CreateWindowOptions.id" 1703 // 1704 // Optional 1705 Id js.String 1706 // InnerBounds is "CreateWindowOptions.innerBounds" 1707 // 1708 // Optional 1709 // 1710 // NOTE: InnerBounds.FFI_USE MUST be set to true to get InnerBounds used. 1711 InnerBounds BoundsSpecification 1712 // OuterBounds is "CreateWindowOptions.outerBounds" 1713 // 1714 // Optional 1715 // 1716 // NOTE: OuterBounds.FFI_USE MUST be set to true to get OuterBounds used. 1717 OuterBounds BoundsSpecification 1718 // DefaultWidth is "CreateWindowOptions.defaultWidth" 1719 // 1720 // Optional 1721 // 1722 // NOTE: FFI_USE_DefaultWidth MUST be set to true to make this field effective. 1723 DefaultWidth int32 1724 // DefaultHeight is "CreateWindowOptions.defaultHeight" 1725 // 1726 // Optional 1727 // 1728 // NOTE: FFI_USE_DefaultHeight MUST be set to true to make this field effective. 1729 DefaultHeight int32 1730 // DefaultLeft is "CreateWindowOptions.defaultLeft" 1731 // 1732 // Optional 1733 // 1734 // NOTE: FFI_USE_DefaultLeft MUST be set to true to make this field effective. 1735 DefaultLeft int32 1736 // DefaultTop is "CreateWindowOptions.defaultTop" 1737 // 1738 // Optional 1739 // 1740 // NOTE: FFI_USE_DefaultTop MUST be set to true to make this field effective. 1741 DefaultTop int32 1742 // Width is "CreateWindowOptions.width" 1743 // 1744 // Optional 1745 // 1746 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 1747 Width int32 1748 // Height is "CreateWindowOptions.height" 1749 // 1750 // Optional 1751 // 1752 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 1753 Height int32 1754 // Left is "CreateWindowOptions.left" 1755 // 1756 // Optional 1757 // 1758 // NOTE: FFI_USE_Left MUST be set to true to make this field effective. 1759 Left int32 1760 // Top is "CreateWindowOptions.top" 1761 // 1762 // Optional 1763 // 1764 // NOTE: FFI_USE_Top MUST be set to true to make this field effective. 1765 Top int32 1766 // MinWidth is "CreateWindowOptions.minWidth" 1767 // 1768 // Optional 1769 // 1770 // NOTE: FFI_USE_MinWidth MUST be set to true to make this field effective. 1771 MinWidth int32 1772 // MinHeight is "CreateWindowOptions.minHeight" 1773 // 1774 // Optional 1775 // 1776 // NOTE: FFI_USE_MinHeight MUST be set to true to make this field effective. 1777 MinHeight int32 1778 // MaxWidth is "CreateWindowOptions.maxWidth" 1779 // 1780 // Optional 1781 // 1782 // NOTE: FFI_USE_MaxWidth MUST be set to true to make this field effective. 1783 MaxWidth int32 1784 // MaxHeight is "CreateWindowOptions.maxHeight" 1785 // 1786 // Optional 1787 // 1788 // NOTE: FFI_USE_MaxHeight MUST be set to true to make this field effective. 1789 MaxHeight int32 1790 // Type is "CreateWindowOptions.type" 1791 // 1792 // Optional 1793 Type WindowType 1794 // Ime is "CreateWindowOptions.ime" 1795 // 1796 // Optional 1797 // 1798 // NOTE: FFI_USE_Ime MUST be set to true to make this field effective. 1799 Ime bool 1800 // ShowInShelf is "CreateWindowOptions.showInShelf" 1801 // 1802 // Optional 1803 // 1804 // NOTE: FFI_USE_ShowInShelf MUST be set to true to make this field effective. 1805 ShowInShelf bool 1806 // Icon is "CreateWindowOptions.icon" 1807 // 1808 // Optional 1809 Icon js.String 1810 // Frame is "CreateWindowOptions.frame" 1811 // 1812 // Optional 1813 Frame OneOf_String_FrameOptions 1814 // Bounds is "CreateWindowOptions.bounds" 1815 // 1816 // Optional 1817 // 1818 // NOTE: Bounds.FFI_USE MUST be set to true to get Bounds used. 1819 Bounds ContentBounds 1820 // AlphaEnabled is "CreateWindowOptions.alphaEnabled" 1821 // 1822 // Optional 1823 // 1824 // NOTE: FFI_USE_AlphaEnabled MUST be set to true to make this field effective. 1825 AlphaEnabled bool 1826 // State is "CreateWindowOptions.state" 1827 // 1828 // Optional 1829 State State 1830 // Hidden is "CreateWindowOptions.hidden" 1831 // 1832 // Optional 1833 // 1834 // NOTE: FFI_USE_Hidden MUST be set to true to make this field effective. 1835 Hidden bool 1836 // Resizable is "CreateWindowOptions.resizable" 1837 // 1838 // Optional 1839 // 1840 // NOTE: FFI_USE_Resizable MUST be set to true to make this field effective. 1841 Resizable bool 1842 // Singleton is "CreateWindowOptions.singleton" 1843 // 1844 // Optional 1845 // 1846 // NOTE: FFI_USE_Singleton MUST be set to true to make this field effective. 1847 Singleton bool 1848 // AlwaysOnTop is "CreateWindowOptions.alwaysOnTop" 1849 // 1850 // Optional 1851 // 1852 // NOTE: FFI_USE_AlwaysOnTop MUST be set to true to make this field effective. 1853 AlwaysOnTop bool 1854 // Focused is "CreateWindowOptions.focused" 1855 // 1856 // Optional 1857 // 1858 // NOTE: FFI_USE_Focused MUST be set to true to make this field effective. 1859 Focused bool 1860 // VisibleOnAllWorkspaces is "CreateWindowOptions.visibleOnAllWorkspaces" 1861 // 1862 // Optional 1863 // 1864 // NOTE: FFI_USE_VisibleOnAllWorkspaces MUST be set to true to make this field effective. 1865 VisibleOnAllWorkspaces bool 1866 // LockScreenAction is "CreateWindowOptions.lockScreenAction" 1867 // 1868 // Optional 1869 LockScreenAction runtime.ActionType 1870 1871 FFI_USE_DefaultWidth bool // for DefaultWidth. 1872 FFI_USE_DefaultHeight bool // for DefaultHeight. 1873 FFI_USE_DefaultLeft bool // for DefaultLeft. 1874 FFI_USE_DefaultTop bool // for DefaultTop. 1875 FFI_USE_Width bool // for Width. 1876 FFI_USE_Height bool // for Height. 1877 FFI_USE_Left bool // for Left. 1878 FFI_USE_Top bool // for Top. 1879 FFI_USE_MinWidth bool // for MinWidth. 1880 FFI_USE_MinHeight bool // for MinHeight. 1881 FFI_USE_MaxWidth bool // for MaxWidth. 1882 FFI_USE_MaxHeight bool // for MaxHeight. 1883 FFI_USE_Ime bool // for Ime. 1884 FFI_USE_ShowInShelf bool // for ShowInShelf. 1885 FFI_USE_AlphaEnabled bool // for AlphaEnabled. 1886 FFI_USE_Hidden bool // for Hidden. 1887 FFI_USE_Resizable bool // for Resizable. 1888 FFI_USE_Singleton bool // for Singleton. 1889 FFI_USE_AlwaysOnTop bool // for AlwaysOnTop. 1890 FFI_USE_Focused bool // for Focused. 1891 FFI_USE_VisibleOnAllWorkspaces bool // for VisibleOnAllWorkspaces. 1892 1893 FFI_USE bool 1894 } 1895 1896 // FromRef calls UpdateFrom and returns a CreateWindowOptions with all fields set. 1897 func (p CreateWindowOptions) FromRef(ref js.Ref) CreateWindowOptions { 1898 p.UpdateFrom(ref) 1899 return p 1900 } 1901 1902 // New creates a new CreateWindowOptions in the application heap. 1903 func (p CreateWindowOptions) New() js.Ref { 1904 return bindings.CreateWindowOptionsJSLoad( 1905 js.Pointer(&p), js.True, 0, 1906 ) 1907 } 1908 1909 // UpdateFrom copies value of all fields of the heap object to p. 1910 func (p *CreateWindowOptions) UpdateFrom(ref js.Ref) { 1911 bindings.CreateWindowOptionsJSStore( 1912 js.Pointer(p), ref, 1913 ) 1914 } 1915 1916 // Update writes all fields of the p to the heap object referenced by ref. 1917 func (p *CreateWindowOptions) Update(ref js.Ref) { 1918 bindings.CreateWindowOptionsJSLoad( 1919 js.Pointer(p), js.False, ref, 1920 ) 1921 } 1922 1923 // FreeMembers frees fields with heap reference, if recursive is true 1924 // free all heap references reachable from p. 1925 func (p *CreateWindowOptions) FreeMembers(recursive bool) { 1926 js.Free( 1927 p.Id.Ref(), 1928 p.Icon.Ref(), 1929 p.Frame.Ref(), 1930 ) 1931 p.Id = p.Id.FromRef(js.Undefined) 1932 p.Icon = p.Icon.FromRef(js.Undefined) 1933 p.Frame = p.Frame.FromRef(js.Undefined) 1934 if recursive { 1935 p.InnerBounds.FreeMembers(true) 1936 p.OuterBounds.FreeMembers(true) 1937 p.Bounds.FreeMembers(true) 1938 } 1939 } 1940 1941 // HasFuncCanSetVisibleOnAllWorkspaces returns true if the function "WEBEXT.app.window.canSetVisibleOnAllWorkspaces" exists. 1942 func HasFuncCanSetVisibleOnAllWorkspaces() bool { 1943 return js.True == bindings.HasFuncCanSetVisibleOnAllWorkspaces() 1944 } 1945 1946 // FuncCanSetVisibleOnAllWorkspaces returns the function "WEBEXT.app.window.canSetVisibleOnAllWorkspaces". 1947 func FuncCanSetVisibleOnAllWorkspaces() (fn js.Func[func() bool]) { 1948 bindings.FuncCanSetVisibleOnAllWorkspaces( 1949 js.Pointer(&fn), 1950 ) 1951 return 1952 } 1953 1954 // CanSetVisibleOnAllWorkspaces calls the function "WEBEXT.app.window.canSetVisibleOnAllWorkspaces" directly. 1955 func CanSetVisibleOnAllWorkspaces() (ret bool) { 1956 bindings.CallCanSetVisibleOnAllWorkspaces( 1957 js.Pointer(&ret), 1958 ) 1959 1960 return 1961 } 1962 1963 // TryCanSetVisibleOnAllWorkspaces calls the function "WEBEXT.app.window.canSetVisibleOnAllWorkspaces" 1964 // in a try/catch block and returns (_, err, ok = false) when it went through 1965 // the catch clause. 1966 func TryCanSetVisibleOnAllWorkspaces() (ret bool, exception js.Any, ok bool) { 1967 ok = js.True == bindings.TryCanSetVisibleOnAllWorkspaces( 1968 js.Pointer(&ret), js.Pointer(&exception), 1969 ) 1970 1971 return 1972 } 1973 1974 // HasFuncCreate returns true if the function "WEBEXT.app.window.create" exists. 1975 func HasFuncCreate() bool { 1976 return js.True == bindings.HasFuncCreate() 1977 } 1978 1979 // FuncCreate returns the function "WEBEXT.app.window.create". 1980 func FuncCreate() (fn js.Func[func(url js.String, options CreateWindowOptions) js.Promise[js.Object]]) { 1981 bindings.FuncCreate( 1982 js.Pointer(&fn), 1983 ) 1984 return 1985 } 1986 1987 // Create calls the function "WEBEXT.app.window.create" directly. 1988 func Create(url js.String, options CreateWindowOptions) (ret js.Promise[js.Object]) { 1989 bindings.CallCreate( 1990 js.Pointer(&ret), 1991 url.Ref(), 1992 js.Pointer(&options), 1993 ) 1994 1995 return 1996 } 1997 1998 // TryCreate calls the function "WEBEXT.app.window.create" 1999 // in a try/catch block and returns (_, err, ok = false) when it went through 2000 // the catch clause. 2001 func TryCreate(url js.String, options CreateWindowOptions) (ret js.Promise[js.Object], exception js.Any, ok bool) { 2002 ok = js.True == bindings.TryCreate( 2003 js.Pointer(&ret), js.Pointer(&exception), 2004 url.Ref(), 2005 js.Pointer(&options), 2006 ) 2007 2008 return 2009 } 2010 2011 // HasFuncCurrent returns true if the function "WEBEXT.app.window.current" exists. 2012 func HasFuncCurrent() bool { 2013 return js.True == bindings.HasFuncCurrent() 2014 } 2015 2016 // FuncCurrent returns the function "WEBEXT.app.window.current". 2017 func FuncCurrent() (fn js.Func[func() AppWindow]) { 2018 bindings.FuncCurrent( 2019 js.Pointer(&fn), 2020 ) 2021 return 2022 } 2023 2024 // Current calls the function "WEBEXT.app.window.current" directly. 2025 func Current() (ret AppWindow) { 2026 bindings.CallCurrent( 2027 js.Pointer(&ret), 2028 ) 2029 2030 return 2031 } 2032 2033 // TryCurrent calls the function "WEBEXT.app.window.current" 2034 // in a try/catch block and returns (_, err, ok = false) when it went through 2035 // the catch clause. 2036 func TryCurrent() (ret AppWindow, exception js.Any, ok bool) { 2037 ok = js.True == bindings.TryCurrent( 2038 js.Pointer(&ret), js.Pointer(&exception), 2039 ) 2040 2041 return 2042 } 2043 2044 // HasFuncGet returns true if the function "WEBEXT.app.window.get" exists. 2045 func HasFuncGet() bool { 2046 return js.True == bindings.HasFuncGet() 2047 } 2048 2049 // FuncGet returns the function "WEBEXT.app.window.get". 2050 func FuncGet() (fn js.Func[func(id js.String) AppWindow]) { 2051 bindings.FuncGet( 2052 js.Pointer(&fn), 2053 ) 2054 return 2055 } 2056 2057 // Get calls the function "WEBEXT.app.window.get" directly. 2058 func Get(id js.String) (ret AppWindow) { 2059 bindings.CallGet( 2060 js.Pointer(&ret), 2061 id.Ref(), 2062 ) 2063 2064 return 2065 } 2066 2067 // TryGet calls the function "WEBEXT.app.window.get" 2068 // in a try/catch block and returns (_, err, ok = false) when it went through 2069 // the catch clause. 2070 func TryGet(id js.String) (ret AppWindow, exception js.Any, ok bool) { 2071 ok = js.True == bindings.TryGet( 2072 js.Pointer(&ret), js.Pointer(&exception), 2073 id.Ref(), 2074 ) 2075 2076 return 2077 } 2078 2079 // HasFuncGetAll returns true if the function "WEBEXT.app.window.getAll" exists. 2080 func HasFuncGetAll() bool { 2081 return js.True == bindings.HasFuncGetAll() 2082 } 2083 2084 // FuncGetAll returns the function "WEBEXT.app.window.getAll". 2085 func FuncGetAll() (fn js.Func[func() js.Array[AppWindow]]) { 2086 bindings.FuncGetAll( 2087 js.Pointer(&fn), 2088 ) 2089 return 2090 } 2091 2092 // GetAll calls the function "WEBEXT.app.window.getAll" directly. 2093 func GetAll() (ret js.Array[AppWindow]) { 2094 bindings.CallGetAll( 2095 js.Pointer(&ret), 2096 ) 2097 2098 return 2099 } 2100 2101 // TryGetAll calls the function "WEBEXT.app.window.getAll" 2102 // in a try/catch block and returns (_, err, ok = false) when it went through 2103 // the catch clause. 2104 func TryGetAll() (ret js.Array[AppWindow], exception js.Any, ok bool) { 2105 ok = js.True == bindings.TryGetAll( 2106 js.Pointer(&ret), js.Pointer(&exception), 2107 ) 2108 2109 return 2110 } 2111 2112 // HasFuncInitializeAppWindow returns true if the function "WEBEXT.app.window.initializeAppWindow" exists. 2113 func HasFuncInitializeAppWindow() bool { 2114 return js.True == bindings.HasFuncInitializeAppWindow() 2115 } 2116 2117 // FuncInitializeAppWindow returns the function "WEBEXT.app.window.initializeAppWindow". 2118 func FuncInitializeAppWindow() (fn js.Func[func(state js.Object)]) { 2119 bindings.FuncInitializeAppWindow( 2120 js.Pointer(&fn), 2121 ) 2122 return 2123 } 2124 2125 // InitializeAppWindow calls the function "WEBEXT.app.window.initializeAppWindow" directly. 2126 func InitializeAppWindow(state js.Object) (ret js.Void) { 2127 bindings.CallInitializeAppWindow( 2128 js.Pointer(&ret), 2129 state.Ref(), 2130 ) 2131 2132 return 2133 } 2134 2135 // TryInitializeAppWindow calls the function "WEBEXT.app.window.initializeAppWindow" 2136 // in a try/catch block and returns (_, err, ok = false) when it went through 2137 // the catch clause. 2138 func TryInitializeAppWindow(state js.Object) (ret js.Void, exception js.Any, ok bool) { 2139 ok = js.True == bindings.TryInitializeAppWindow( 2140 js.Pointer(&ret), js.Pointer(&exception), 2141 state.Ref(), 2142 ) 2143 2144 return 2145 } 2146 2147 type OnAlphaEnabledChangedEventCallbackFunc func(this js.Ref) js.Ref 2148 2149 func (fn OnAlphaEnabledChangedEventCallbackFunc) Register() js.Func[func()] { 2150 return js.RegisterCallback[func()]( 2151 fn, abi.FuncPCABIInternal(fn), 2152 ) 2153 } 2154 2155 func (fn OnAlphaEnabledChangedEventCallbackFunc) DispatchCallback( 2156 targetPC uintptr, ctx *js.CallbackContext, 2157 ) { 2158 args := ctx.Args() 2159 if len(args) != 0+1 /* js this */ || 2160 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2161 js.ThrowInvalidCallbackInvocation() 2162 } 2163 2164 if ctx.Return(fn( 2165 args[0], 2166 )) { 2167 return 2168 } 2169 2170 js.ThrowCallbackValueNotReturned() 2171 } 2172 2173 type OnAlphaEnabledChangedEventCallback[T any] struct { 2174 Fn func(arg T, this js.Ref) js.Ref 2175 Arg T 2176 } 2177 2178 func (cb *OnAlphaEnabledChangedEventCallback[T]) Register() js.Func[func()] { 2179 return js.RegisterCallback[func()]( 2180 cb, abi.FuncPCABIInternal(cb.Fn), 2181 ) 2182 } 2183 2184 func (cb *OnAlphaEnabledChangedEventCallback[T]) DispatchCallback( 2185 targetPC uintptr, ctx *js.CallbackContext, 2186 ) { 2187 args := ctx.Args() 2188 if len(args) != 0+1 /* js this */ || 2189 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2190 js.ThrowInvalidCallbackInvocation() 2191 } 2192 2193 if ctx.Return(cb.Fn( 2194 cb.Arg, 2195 args[0], 2196 )) { 2197 return 2198 } 2199 2200 js.ThrowCallbackValueNotReturned() 2201 } 2202 2203 // HasFuncOnAlphaEnabledChanged returns true if the function "WEBEXT.app.window.onAlphaEnabledChanged.addListener" exists. 2204 func HasFuncOnAlphaEnabledChanged() bool { 2205 return js.True == bindings.HasFuncOnAlphaEnabledChanged() 2206 } 2207 2208 // FuncOnAlphaEnabledChanged returns the function "WEBEXT.app.window.onAlphaEnabledChanged.addListener". 2209 func FuncOnAlphaEnabledChanged() (fn js.Func[func(callback js.Func[func()])]) { 2210 bindings.FuncOnAlphaEnabledChanged( 2211 js.Pointer(&fn), 2212 ) 2213 return 2214 } 2215 2216 // OnAlphaEnabledChanged calls the function "WEBEXT.app.window.onAlphaEnabledChanged.addListener" directly. 2217 func OnAlphaEnabledChanged(callback js.Func[func()]) (ret js.Void) { 2218 bindings.CallOnAlphaEnabledChanged( 2219 js.Pointer(&ret), 2220 callback.Ref(), 2221 ) 2222 2223 return 2224 } 2225 2226 // TryOnAlphaEnabledChanged calls the function "WEBEXT.app.window.onAlphaEnabledChanged.addListener" 2227 // in a try/catch block and returns (_, err, ok = false) when it went through 2228 // the catch clause. 2229 func TryOnAlphaEnabledChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2230 ok = js.True == bindings.TryOnAlphaEnabledChanged( 2231 js.Pointer(&ret), js.Pointer(&exception), 2232 callback.Ref(), 2233 ) 2234 2235 return 2236 } 2237 2238 // HasFuncOffAlphaEnabledChanged returns true if the function "WEBEXT.app.window.onAlphaEnabledChanged.removeListener" exists. 2239 func HasFuncOffAlphaEnabledChanged() bool { 2240 return js.True == bindings.HasFuncOffAlphaEnabledChanged() 2241 } 2242 2243 // FuncOffAlphaEnabledChanged returns the function "WEBEXT.app.window.onAlphaEnabledChanged.removeListener". 2244 func FuncOffAlphaEnabledChanged() (fn js.Func[func(callback js.Func[func()])]) { 2245 bindings.FuncOffAlphaEnabledChanged( 2246 js.Pointer(&fn), 2247 ) 2248 return 2249 } 2250 2251 // OffAlphaEnabledChanged calls the function "WEBEXT.app.window.onAlphaEnabledChanged.removeListener" directly. 2252 func OffAlphaEnabledChanged(callback js.Func[func()]) (ret js.Void) { 2253 bindings.CallOffAlphaEnabledChanged( 2254 js.Pointer(&ret), 2255 callback.Ref(), 2256 ) 2257 2258 return 2259 } 2260 2261 // TryOffAlphaEnabledChanged calls the function "WEBEXT.app.window.onAlphaEnabledChanged.removeListener" 2262 // in a try/catch block and returns (_, err, ok = false) when it went through 2263 // the catch clause. 2264 func TryOffAlphaEnabledChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2265 ok = js.True == bindings.TryOffAlphaEnabledChanged( 2266 js.Pointer(&ret), js.Pointer(&exception), 2267 callback.Ref(), 2268 ) 2269 2270 return 2271 } 2272 2273 // HasFuncHasOnAlphaEnabledChanged returns true if the function "WEBEXT.app.window.onAlphaEnabledChanged.hasListener" exists. 2274 func HasFuncHasOnAlphaEnabledChanged() bool { 2275 return js.True == bindings.HasFuncHasOnAlphaEnabledChanged() 2276 } 2277 2278 // FuncHasOnAlphaEnabledChanged returns the function "WEBEXT.app.window.onAlphaEnabledChanged.hasListener". 2279 func FuncHasOnAlphaEnabledChanged() (fn js.Func[func(callback js.Func[func()]) bool]) { 2280 bindings.FuncHasOnAlphaEnabledChanged( 2281 js.Pointer(&fn), 2282 ) 2283 return 2284 } 2285 2286 // HasOnAlphaEnabledChanged calls the function "WEBEXT.app.window.onAlphaEnabledChanged.hasListener" directly. 2287 func HasOnAlphaEnabledChanged(callback js.Func[func()]) (ret bool) { 2288 bindings.CallHasOnAlphaEnabledChanged( 2289 js.Pointer(&ret), 2290 callback.Ref(), 2291 ) 2292 2293 return 2294 } 2295 2296 // TryHasOnAlphaEnabledChanged calls the function "WEBEXT.app.window.onAlphaEnabledChanged.hasListener" 2297 // in a try/catch block and returns (_, err, ok = false) when it went through 2298 // the catch clause. 2299 func TryHasOnAlphaEnabledChanged(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 2300 ok = js.True == bindings.TryHasOnAlphaEnabledChanged( 2301 js.Pointer(&ret), js.Pointer(&exception), 2302 callback.Ref(), 2303 ) 2304 2305 return 2306 } 2307 2308 type OnBoundsChangedEventCallbackFunc func(this js.Ref) js.Ref 2309 2310 func (fn OnBoundsChangedEventCallbackFunc) Register() js.Func[func()] { 2311 return js.RegisterCallback[func()]( 2312 fn, abi.FuncPCABIInternal(fn), 2313 ) 2314 } 2315 2316 func (fn OnBoundsChangedEventCallbackFunc) DispatchCallback( 2317 targetPC uintptr, ctx *js.CallbackContext, 2318 ) { 2319 args := ctx.Args() 2320 if len(args) != 0+1 /* js this */ || 2321 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2322 js.ThrowInvalidCallbackInvocation() 2323 } 2324 2325 if ctx.Return(fn( 2326 args[0], 2327 )) { 2328 return 2329 } 2330 2331 js.ThrowCallbackValueNotReturned() 2332 } 2333 2334 type OnBoundsChangedEventCallback[T any] struct { 2335 Fn func(arg T, this js.Ref) js.Ref 2336 Arg T 2337 } 2338 2339 func (cb *OnBoundsChangedEventCallback[T]) Register() js.Func[func()] { 2340 return js.RegisterCallback[func()]( 2341 cb, abi.FuncPCABIInternal(cb.Fn), 2342 ) 2343 } 2344 2345 func (cb *OnBoundsChangedEventCallback[T]) DispatchCallback( 2346 targetPC uintptr, ctx *js.CallbackContext, 2347 ) { 2348 args := ctx.Args() 2349 if len(args) != 0+1 /* js this */ || 2350 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2351 js.ThrowInvalidCallbackInvocation() 2352 } 2353 2354 if ctx.Return(cb.Fn( 2355 cb.Arg, 2356 args[0], 2357 )) { 2358 return 2359 } 2360 2361 js.ThrowCallbackValueNotReturned() 2362 } 2363 2364 // HasFuncOnBoundsChanged returns true if the function "WEBEXT.app.window.onBoundsChanged.addListener" exists. 2365 func HasFuncOnBoundsChanged() bool { 2366 return js.True == bindings.HasFuncOnBoundsChanged() 2367 } 2368 2369 // FuncOnBoundsChanged returns the function "WEBEXT.app.window.onBoundsChanged.addListener". 2370 func FuncOnBoundsChanged() (fn js.Func[func(callback js.Func[func()])]) { 2371 bindings.FuncOnBoundsChanged( 2372 js.Pointer(&fn), 2373 ) 2374 return 2375 } 2376 2377 // OnBoundsChanged calls the function "WEBEXT.app.window.onBoundsChanged.addListener" directly. 2378 func OnBoundsChanged(callback js.Func[func()]) (ret js.Void) { 2379 bindings.CallOnBoundsChanged( 2380 js.Pointer(&ret), 2381 callback.Ref(), 2382 ) 2383 2384 return 2385 } 2386 2387 // TryOnBoundsChanged calls the function "WEBEXT.app.window.onBoundsChanged.addListener" 2388 // in a try/catch block and returns (_, err, ok = false) when it went through 2389 // the catch clause. 2390 func TryOnBoundsChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2391 ok = js.True == bindings.TryOnBoundsChanged( 2392 js.Pointer(&ret), js.Pointer(&exception), 2393 callback.Ref(), 2394 ) 2395 2396 return 2397 } 2398 2399 // HasFuncOffBoundsChanged returns true if the function "WEBEXT.app.window.onBoundsChanged.removeListener" exists. 2400 func HasFuncOffBoundsChanged() bool { 2401 return js.True == bindings.HasFuncOffBoundsChanged() 2402 } 2403 2404 // FuncOffBoundsChanged returns the function "WEBEXT.app.window.onBoundsChanged.removeListener". 2405 func FuncOffBoundsChanged() (fn js.Func[func(callback js.Func[func()])]) { 2406 bindings.FuncOffBoundsChanged( 2407 js.Pointer(&fn), 2408 ) 2409 return 2410 } 2411 2412 // OffBoundsChanged calls the function "WEBEXT.app.window.onBoundsChanged.removeListener" directly. 2413 func OffBoundsChanged(callback js.Func[func()]) (ret js.Void) { 2414 bindings.CallOffBoundsChanged( 2415 js.Pointer(&ret), 2416 callback.Ref(), 2417 ) 2418 2419 return 2420 } 2421 2422 // TryOffBoundsChanged calls the function "WEBEXT.app.window.onBoundsChanged.removeListener" 2423 // in a try/catch block and returns (_, err, ok = false) when it went through 2424 // the catch clause. 2425 func TryOffBoundsChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2426 ok = js.True == bindings.TryOffBoundsChanged( 2427 js.Pointer(&ret), js.Pointer(&exception), 2428 callback.Ref(), 2429 ) 2430 2431 return 2432 } 2433 2434 // HasFuncHasOnBoundsChanged returns true if the function "WEBEXT.app.window.onBoundsChanged.hasListener" exists. 2435 func HasFuncHasOnBoundsChanged() bool { 2436 return js.True == bindings.HasFuncHasOnBoundsChanged() 2437 } 2438 2439 // FuncHasOnBoundsChanged returns the function "WEBEXT.app.window.onBoundsChanged.hasListener". 2440 func FuncHasOnBoundsChanged() (fn js.Func[func(callback js.Func[func()]) bool]) { 2441 bindings.FuncHasOnBoundsChanged( 2442 js.Pointer(&fn), 2443 ) 2444 return 2445 } 2446 2447 // HasOnBoundsChanged calls the function "WEBEXT.app.window.onBoundsChanged.hasListener" directly. 2448 func HasOnBoundsChanged(callback js.Func[func()]) (ret bool) { 2449 bindings.CallHasOnBoundsChanged( 2450 js.Pointer(&ret), 2451 callback.Ref(), 2452 ) 2453 2454 return 2455 } 2456 2457 // TryHasOnBoundsChanged calls the function "WEBEXT.app.window.onBoundsChanged.hasListener" 2458 // in a try/catch block and returns (_, err, ok = false) when it went through 2459 // the catch clause. 2460 func TryHasOnBoundsChanged(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 2461 ok = js.True == bindings.TryHasOnBoundsChanged( 2462 js.Pointer(&ret), js.Pointer(&exception), 2463 callback.Ref(), 2464 ) 2465 2466 return 2467 } 2468 2469 type OnClosedEventCallbackFunc func(this js.Ref) js.Ref 2470 2471 func (fn OnClosedEventCallbackFunc) Register() js.Func[func()] { 2472 return js.RegisterCallback[func()]( 2473 fn, abi.FuncPCABIInternal(fn), 2474 ) 2475 } 2476 2477 func (fn OnClosedEventCallbackFunc) DispatchCallback( 2478 targetPC uintptr, ctx *js.CallbackContext, 2479 ) { 2480 args := ctx.Args() 2481 if len(args) != 0+1 /* js this */ || 2482 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2483 js.ThrowInvalidCallbackInvocation() 2484 } 2485 2486 if ctx.Return(fn( 2487 args[0], 2488 )) { 2489 return 2490 } 2491 2492 js.ThrowCallbackValueNotReturned() 2493 } 2494 2495 type OnClosedEventCallback[T any] struct { 2496 Fn func(arg T, this js.Ref) js.Ref 2497 Arg T 2498 } 2499 2500 func (cb *OnClosedEventCallback[T]) Register() js.Func[func()] { 2501 return js.RegisterCallback[func()]( 2502 cb, abi.FuncPCABIInternal(cb.Fn), 2503 ) 2504 } 2505 2506 func (cb *OnClosedEventCallback[T]) DispatchCallback( 2507 targetPC uintptr, ctx *js.CallbackContext, 2508 ) { 2509 args := ctx.Args() 2510 if len(args) != 0+1 /* js this */ || 2511 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2512 js.ThrowInvalidCallbackInvocation() 2513 } 2514 2515 if ctx.Return(cb.Fn( 2516 cb.Arg, 2517 args[0], 2518 )) { 2519 return 2520 } 2521 2522 js.ThrowCallbackValueNotReturned() 2523 } 2524 2525 // HasFuncOnClosed returns true if the function "WEBEXT.app.window.onClosed.addListener" exists. 2526 func HasFuncOnClosed() bool { 2527 return js.True == bindings.HasFuncOnClosed() 2528 } 2529 2530 // FuncOnClosed returns the function "WEBEXT.app.window.onClosed.addListener". 2531 func FuncOnClosed() (fn js.Func[func(callback js.Func[func()])]) { 2532 bindings.FuncOnClosed( 2533 js.Pointer(&fn), 2534 ) 2535 return 2536 } 2537 2538 // OnClosed calls the function "WEBEXT.app.window.onClosed.addListener" directly. 2539 func OnClosed(callback js.Func[func()]) (ret js.Void) { 2540 bindings.CallOnClosed( 2541 js.Pointer(&ret), 2542 callback.Ref(), 2543 ) 2544 2545 return 2546 } 2547 2548 // TryOnClosed calls the function "WEBEXT.app.window.onClosed.addListener" 2549 // in a try/catch block and returns (_, err, ok = false) when it went through 2550 // the catch clause. 2551 func TryOnClosed(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2552 ok = js.True == bindings.TryOnClosed( 2553 js.Pointer(&ret), js.Pointer(&exception), 2554 callback.Ref(), 2555 ) 2556 2557 return 2558 } 2559 2560 // HasFuncOffClosed returns true if the function "WEBEXT.app.window.onClosed.removeListener" exists. 2561 func HasFuncOffClosed() bool { 2562 return js.True == bindings.HasFuncOffClosed() 2563 } 2564 2565 // FuncOffClosed returns the function "WEBEXT.app.window.onClosed.removeListener". 2566 func FuncOffClosed() (fn js.Func[func(callback js.Func[func()])]) { 2567 bindings.FuncOffClosed( 2568 js.Pointer(&fn), 2569 ) 2570 return 2571 } 2572 2573 // OffClosed calls the function "WEBEXT.app.window.onClosed.removeListener" directly. 2574 func OffClosed(callback js.Func[func()]) (ret js.Void) { 2575 bindings.CallOffClosed( 2576 js.Pointer(&ret), 2577 callback.Ref(), 2578 ) 2579 2580 return 2581 } 2582 2583 // TryOffClosed calls the function "WEBEXT.app.window.onClosed.removeListener" 2584 // in a try/catch block and returns (_, err, ok = false) when it went through 2585 // the catch clause. 2586 func TryOffClosed(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2587 ok = js.True == bindings.TryOffClosed( 2588 js.Pointer(&ret), js.Pointer(&exception), 2589 callback.Ref(), 2590 ) 2591 2592 return 2593 } 2594 2595 // HasFuncHasOnClosed returns true if the function "WEBEXT.app.window.onClosed.hasListener" exists. 2596 func HasFuncHasOnClosed() bool { 2597 return js.True == bindings.HasFuncHasOnClosed() 2598 } 2599 2600 // FuncHasOnClosed returns the function "WEBEXT.app.window.onClosed.hasListener". 2601 func FuncHasOnClosed() (fn js.Func[func(callback js.Func[func()]) bool]) { 2602 bindings.FuncHasOnClosed( 2603 js.Pointer(&fn), 2604 ) 2605 return 2606 } 2607 2608 // HasOnClosed calls the function "WEBEXT.app.window.onClosed.hasListener" directly. 2609 func HasOnClosed(callback js.Func[func()]) (ret bool) { 2610 bindings.CallHasOnClosed( 2611 js.Pointer(&ret), 2612 callback.Ref(), 2613 ) 2614 2615 return 2616 } 2617 2618 // TryHasOnClosed calls the function "WEBEXT.app.window.onClosed.hasListener" 2619 // in a try/catch block and returns (_, err, ok = false) when it went through 2620 // the catch clause. 2621 func TryHasOnClosed(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 2622 ok = js.True == bindings.TryHasOnClosed( 2623 js.Pointer(&ret), js.Pointer(&exception), 2624 callback.Ref(), 2625 ) 2626 2627 return 2628 } 2629 2630 type OnFullscreenedEventCallbackFunc func(this js.Ref) js.Ref 2631 2632 func (fn OnFullscreenedEventCallbackFunc) Register() js.Func[func()] { 2633 return js.RegisterCallback[func()]( 2634 fn, abi.FuncPCABIInternal(fn), 2635 ) 2636 } 2637 2638 func (fn OnFullscreenedEventCallbackFunc) DispatchCallback( 2639 targetPC uintptr, ctx *js.CallbackContext, 2640 ) { 2641 args := ctx.Args() 2642 if len(args) != 0+1 /* js this */ || 2643 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2644 js.ThrowInvalidCallbackInvocation() 2645 } 2646 2647 if ctx.Return(fn( 2648 args[0], 2649 )) { 2650 return 2651 } 2652 2653 js.ThrowCallbackValueNotReturned() 2654 } 2655 2656 type OnFullscreenedEventCallback[T any] struct { 2657 Fn func(arg T, this js.Ref) js.Ref 2658 Arg T 2659 } 2660 2661 func (cb *OnFullscreenedEventCallback[T]) Register() js.Func[func()] { 2662 return js.RegisterCallback[func()]( 2663 cb, abi.FuncPCABIInternal(cb.Fn), 2664 ) 2665 } 2666 2667 func (cb *OnFullscreenedEventCallback[T]) DispatchCallback( 2668 targetPC uintptr, ctx *js.CallbackContext, 2669 ) { 2670 args := ctx.Args() 2671 if len(args) != 0+1 /* js this */ || 2672 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2673 js.ThrowInvalidCallbackInvocation() 2674 } 2675 2676 if ctx.Return(cb.Fn( 2677 cb.Arg, 2678 args[0], 2679 )) { 2680 return 2681 } 2682 2683 js.ThrowCallbackValueNotReturned() 2684 } 2685 2686 // HasFuncOnFullscreened returns true if the function "WEBEXT.app.window.onFullscreened.addListener" exists. 2687 func HasFuncOnFullscreened() bool { 2688 return js.True == bindings.HasFuncOnFullscreened() 2689 } 2690 2691 // FuncOnFullscreened returns the function "WEBEXT.app.window.onFullscreened.addListener". 2692 func FuncOnFullscreened() (fn js.Func[func(callback js.Func[func()])]) { 2693 bindings.FuncOnFullscreened( 2694 js.Pointer(&fn), 2695 ) 2696 return 2697 } 2698 2699 // OnFullscreened calls the function "WEBEXT.app.window.onFullscreened.addListener" directly. 2700 func OnFullscreened(callback js.Func[func()]) (ret js.Void) { 2701 bindings.CallOnFullscreened( 2702 js.Pointer(&ret), 2703 callback.Ref(), 2704 ) 2705 2706 return 2707 } 2708 2709 // TryOnFullscreened calls the function "WEBEXT.app.window.onFullscreened.addListener" 2710 // in a try/catch block and returns (_, err, ok = false) when it went through 2711 // the catch clause. 2712 func TryOnFullscreened(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2713 ok = js.True == bindings.TryOnFullscreened( 2714 js.Pointer(&ret), js.Pointer(&exception), 2715 callback.Ref(), 2716 ) 2717 2718 return 2719 } 2720 2721 // HasFuncOffFullscreened returns true if the function "WEBEXT.app.window.onFullscreened.removeListener" exists. 2722 func HasFuncOffFullscreened() bool { 2723 return js.True == bindings.HasFuncOffFullscreened() 2724 } 2725 2726 // FuncOffFullscreened returns the function "WEBEXT.app.window.onFullscreened.removeListener". 2727 func FuncOffFullscreened() (fn js.Func[func(callback js.Func[func()])]) { 2728 bindings.FuncOffFullscreened( 2729 js.Pointer(&fn), 2730 ) 2731 return 2732 } 2733 2734 // OffFullscreened calls the function "WEBEXT.app.window.onFullscreened.removeListener" directly. 2735 func OffFullscreened(callback js.Func[func()]) (ret js.Void) { 2736 bindings.CallOffFullscreened( 2737 js.Pointer(&ret), 2738 callback.Ref(), 2739 ) 2740 2741 return 2742 } 2743 2744 // TryOffFullscreened calls the function "WEBEXT.app.window.onFullscreened.removeListener" 2745 // in a try/catch block and returns (_, err, ok = false) when it went through 2746 // the catch clause. 2747 func TryOffFullscreened(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2748 ok = js.True == bindings.TryOffFullscreened( 2749 js.Pointer(&ret), js.Pointer(&exception), 2750 callback.Ref(), 2751 ) 2752 2753 return 2754 } 2755 2756 // HasFuncHasOnFullscreened returns true if the function "WEBEXT.app.window.onFullscreened.hasListener" exists. 2757 func HasFuncHasOnFullscreened() bool { 2758 return js.True == bindings.HasFuncHasOnFullscreened() 2759 } 2760 2761 // FuncHasOnFullscreened returns the function "WEBEXT.app.window.onFullscreened.hasListener". 2762 func FuncHasOnFullscreened() (fn js.Func[func(callback js.Func[func()]) bool]) { 2763 bindings.FuncHasOnFullscreened( 2764 js.Pointer(&fn), 2765 ) 2766 return 2767 } 2768 2769 // HasOnFullscreened calls the function "WEBEXT.app.window.onFullscreened.hasListener" directly. 2770 func HasOnFullscreened(callback js.Func[func()]) (ret bool) { 2771 bindings.CallHasOnFullscreened( 2772 js.Pointer(&ret), 2773 callback.Ref(), 2774 ) 2775 2776 return 2777 } 2778 2779 // TryHasOnFullscreened calls the function "WEBEXT.app.window.onFullscreened.hasListener" 2780 // in a try/catch block and returns (_, err, ok = false) when it went through 2781 // the catch clause. 2782 func TryHasOnFullscreened(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 2783 ok = js.True == bindings.TryHasOnFullscreened( 2784 js.Pointer(&ret), js.Pointer(&exception), 2785 callback.Ref(), 2786 ) 2787 2788 return 2789 } 2790 2791 type OnMaximizedEventCallbackFunc func(this js.Ref) js.Ref 2792 2793 func (fn OnMaximizedEventCallbackFunc) Register() js.Func[func()] { 2794 return js.RegisterCallback[func()]( 2795 fn, abi.FuncPCABIInternal(fn), 2796 ) 2797 } 2798 2799 func (fn OnMaximizedEventCallbackFunc) DispatchCallback( 2800 targetPC uintptr, ctx *js.CallbackContext, 2801 ) { 2802 args := ctx.Args() 2803 if len(args) != 0+1 /* js this */ || 2804 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2805 js.ThrowInvalidCallbackInvocation() 2806 } 2807 2808 if ctx.Return(fn( 2809 args[0], 2810 )) { 2811 return 2812 } 2813 2814 js.ThrowCallbackValueNotReturned() 2815 } 2816 2817 type OnMaximizedEventCallback[T any] struct { 2818 Fn func(arg T, this js.Ref) js.Ref 2819 Arg T 2820 } 2821 2822 func (cb *OnMaximizedEventCallback[T]) Register() js.Func[func()] { 2823 return js.RegisterCallback[func()]( 2824 cb, abi.FuncPCABIInternal(cb.Fn), 2825 ) 2826 } 2827 2828 func (cb *OnMaximizedEventCallback[T]) DispatchCallback( 2829 targetPC uintptr, ctx *js.CallbackContext, 2830 ) { 2831 args := ctx.Args() 2832 if len(args) != 0+1 /* js this */ || 2833 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2834 js.ThrowInvalidCallbackInvocation() 2835 } 2836 2837 if ctx.Return(cb.Fn( 2838 cb.Arg, 2839 args[0], 2840 )) { 2841 return 2842 } 2843 2844 js.ThrowCallbackValueNotReturned() 2845 } 2846 2847 // HasFuncOnMaximized returns true if the function "WEBEXT.app.window.onMaximized.addListener" exists. 2848 func HasFuncOnMaximized() bool { 2849 return js.True == bindings.HasFuncOnMaximized() 2850 } 2851 2852 // FuncOnMaximized returns the function "WEBEXT.app.window.onMaximized.addListener". 2853 func FuncOnMaximized() (fn js.Func[func(callback js.Func[func()])]) { 2854 bindings.FuncOnMaximized( 2855 js.Pointer(&fn), 2856 ) 2857 return 2858 } 2859 2860 // OnMaximized calls the function "WEBEXT.app.window.onMaximized.addListener" directly. 2861 func OnMaximized(callback js.Func[func()]) (ret js.Void) { 2862 bindings.CallOnMaximized( 2863 js.Pointer(&ret), 2864 callback.Ref(), 2865 ) 2866 2867 return 2868 } 2869 2870 // TryOnMaximized calls the function "WEBEXT.app.window.onMaximized.addListener" 2871 // in a try/catch block and returns (_, err, ok = false) when it went through 2872 // the catch clause. 2873 func TryOnMaximized(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2874 ok = js.True == bindings.TryOnMaximized( 2875 js.Pointer(&ret), js.Pointer(&exception), 2876 callback.Ref(), 2877 ) 2878 2879 return 2880 } 2881 2882 // HasFuncOffMaximized returns true if the function "WEBEXT.app.window.onMaximized.removeListener" exists. 2883 func HasFuncOffMaximized() bool { 2884 return js.True == bindings.HasFuncOffMaximized() 2885 } 2886 2887 // FuncOffMaximized returns the function "WEBEXT.app.window.onMaximized.removeListener". 2888 func FuncOffMaximized() (fn js.Func[func(callback js.Func[func()])]) { 2889 bindings.FuncOffMaximized( 2890 js.Pointer(&fn), 2891 ) 2892 return 2893 } 2894 2895 // OffMaximized calls the function "WEBEXT.app.window.onMaximized.removeListener" directly. 2896 func OffMaximized(callback js.Func[func()]) (ret js.Void) { 2897 bindings.CallOffMaximized( 2898 js.Pointer(&ret), 2899 callback.Ref(), 2900 ) 2901 2902 return 2903 } 2904 2905 // TryOffMaximized calls the function "WEBEXT.app.window.onMaximized.removeListener" 2906 // in a try/catch block and returns (_, err, ok = false) when it went through 2907 // the catch clause. 2908 func TryOffMaximized(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 2909 ok = js.True == bindings.TryOffMaximized( 2910 js.Pointer(&ret), js.Pointer(&exception), 2911 callback.Ref(), 2912 ) 2913 2914 return 2915 } 2916 2917 // HasFuncHasOnMaximized returns true if the function "WEBEXT.app.window.onMaximized.hasListener" exists. 2918 func HasFuncHasOnMaximized() bool { 2919 return js.True == bindings.HasFuncHasOnMaximized() 2920 } 2921 2922 // FuncHasOnMaximized returns the function "WEBEXT.app.window.onMaximized.hasListener". 2923 func FuncHasOnMaximized() (fn js.Func[func(callback js.Func[func()]) bool]) { 2924 bindings.FuncHasOnMaximized( 2925 js.Pointer(&fn), 2926 ) 2927 return 2928 } 2929 2930 // HasOnMaximized calls the function "WEBEXT.app.window.onMaximized.hasListener" directly. 2931 func HasOnMaximized(callback js.Func[func()]) (ret bool) { 2932 bindings.CallHasOnMaximized( 2933 js.Pointer(&ret), 2934 callback.Ref(), 2935 ) 2936 2937 return 2938 } 2939 2940 // TryHasOnMaximized calls the function "WEBEXT.app.window.onMaximized.hasListener" 2941 // in a try/catch block and returns (_, err, ok = false) when it went through 2942 // the catch clause. 2943 func TryHasOnMaximized(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 2944 ok = js.True == bindings.TryHasOnMaximized( 2945 js.Pointer(&ret), js.Pointer(&exception), 2946 callback.Ref(), 2947 ) 2948 2949 return 2950 } 2951 2952 type OnMinimizedEventCallbackFunc func(this js.Ref) js.Ref 2953 2954 func (fn OnMinimizedEventCallbackFunc) Register() js.Func[func()] { 2955 return js.RegisterCallback[func()]( 2956 fn, abi.FuncPCABIInternal(fn), 2957 ) 2958 } 2959 2960 func (fn OnMinimizedEventCallbackFunc) DispatchCallback( 2961 targetPC uintptr, ctx *js.CallbackContext, 2962 ) { 2963 args := ctx.Args() 2964 if len(args) != 0+1 /* js this */ || 2965 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2966 js.ThrowInvalidCallbackInvocation() 2967 } 2968 2969 if ctx.Return(fn( 2970 args[0], 2971 )) { 2972 return 2973 } 2974 2975 js.ThrowCallbackValueNotReturned() 2976 } 2977 2978 type OnMinimizedEventCallback[T any] struct { 2979 Fn func(arg T, this js.Ref) js.Ref 2980 Arg T 2981 } 2982 2983 func (cb *OnMinimizedEventCallback[T]) Register() js.Func[func()] { 2984 return js.RegisterCallback[func()]( 2985 cb, abi.FuncPCABIInternal(cb.Fn), 2986 ) 2987 } 2988 2989 func (cb *OnMinimizedEventCallback[T]) DispatchCallback( 2990 targetPC uintptr, ctx *js.CallbackContext, 2991 ) { 2992 args := ctx.Args() 2993 if len(args) != 0+1 /* js this */ || 2994 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2995 js.ThrowInvalidCallbackInvocation() 2996 } 2997 2998 if ctx.Return(cb.Fn( 2999 cb.Arg, 3000 args[0], 3001 )) { 3002 return 3003 } 3004 3005 js.ThrowCallbackValueNotReturned() 3006 } 3007 3008 // HasFuncOnMinimized returns true if the function "WEBEXT.app.window.onMinimized.addListener" exists. 3009 func HasFuncOnMinimized() bool { 3010 return js.True == bindings.HasFuncOnMinimized() 3011 } 3012 3013 // FuncOnMinimized returns the function "WEBEXT.app.window.onMinimized.addListener". 3014 func FuncOnMinimized() (fn js.Func[func(callback js.Func[func()])]) { 3015 bindings.FuncOnMinimized( 3016 js.Pointer(&fn), 3017 ) 3018 return 3019 } 3020 3021 // OnMinimized calls the function "WEBEXT.app.window.onMinimized.addListener" directly. 3022 func OnMinimized(callback js.Func[func()]) (ret js.Void) { 3023 bindings.CallOnMinimized( 3024 js.Pointer(&ret), 3025 callback.Ref(), 3026 ) 3027 3028 return 3029 } 3030 3031 // TryOnMinimized calls the function "WEBEXT.app.window.onMinimized.addListener" 3032 // in a try/catch block and returns (_, err, ok = false) when it went through 3033 // the catch clause. 3034 func TryOnMinimized(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 3035 ok = js.True == bindings.TryOnMinimized( 3036 js.Pointer(&ret), js.Pointer(&exception), 3037 callback.Ref(), 3038 ) 3039 3040 return 3041 } 3042 3043 // HasFuncOffMinimized returns true if the function "WEBEXT.app.window.onMinimized.removeListener" exists. 3044 func HasFuncOffMinimized() bool { 3045 return js.True == bindings.HasFuncOffMinimized() 3046 } 3047 3048 // FuncOffMinimized returns the function "WEBEXT.app.window.onMinimized.removeListener". 3049 func FuncOffMinimized() (fn js.Func[func(callback js.Func[func()])]) { 3050 bindings.FuncOffMinimized( 3051 js.Pointer(&fn), 3052 ) 3053 return 3054 } 3055 3056 // OffMinimized calls the function "WEBEXT.app.window.onMinimized.removeListener" directly. 3057 func OffMinimized(callback js.Func[func()]) (ret js.Void) { 3058 bindings.CallOffMinimized( 3059 js.Pointer(&ret), 3060 callback.Ref(), 3061 ) 3062 3063 return 3064 } 3065 3066 // TryOffMinimized calls the function "WEBEXT.app.window.onMinimized.removeListener" 3067 // in a try/catch block and returns (_, err, ok = false) when it went through 3068 // the catch clause. 3069 func TryOffMinimized(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 3070 ok = js.True == bindings.TryOffMinimized( 3071 js.Pointer(&ret), js.Pointer(&exception), 3072 callback.Ref(), 3073 ) 3074 3075 return 3076 } 3077 3078 // HasFuncHasOnMinimized returns true if the function "WEBEXT.app.window.onMinimized.hasListener" exists. 3079 func HasFuncHasOnMinimized() bool { 3080 return js.True == bindings.HasFuncHasOnMinimized() 3081 } 3082 3083 // FuncHasOnMinimized returns the function "WEBEXT.app.window.onMinimized.hasListener". 3084 func FuncHasOnMinimized() (fn js.Func[func(callback js.Func[func()]) bool]) { 3085 bindings.FuncHasOnMinimized( 3086 js.Pointer(&fn), 3087 ) 3088 return 3089 } 3090 3091 // HasOnMinimized calls the function "WEBEXT.app.window.onMinimized.hasListener" directly. 3092 func HasOnMinimized(callback js.Func[func()]) (ret bool) { 3093 bindings.CallHasOnMinimized( 3094 js.Pointer(&ret), 3095 callback.Ref(), 3096 ) 3097 3098 return 3099 } 3100 3101 // TryHasOnMinimized calls the function "WEBEXT.app.window.onMinimized.hasListener" 3102 // in a try/catch block and returns (_, err, ok = false) when it went through 3103 // the catch clause. 3104 func TryHasOnMinimized(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 3105 ok = js.True == bindings.TryHasOnMinimized( 3106 js.Pointer(&ret), js.Pointer(&exception), 3107 callback.Ref(), 3108 ) 3109 3110 return 3111 } 3112 3113 type OnRestoredEventCallbackFunc func(this js.Ref) js.Ref 3114 3115 func (fn OnRestoredEventCallbackFunc) Register() js.Func[func()] { 3116 return js.RegisterCallback[func()]( 3117 fn, abi.FuncPCABIInternal(fn), 3118 ) 3119 } 3120 3121 func (fn OnRestoredEventCallbackFunc) DispatchCallback( 3122 targetPC uintptr, ctx *js.CallbackContext, 3123 ) { 3124 args := ctx.Args() 3125 if len(args) != 0+1 /* js this */ || 3126 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3127 js.ThrowInvalidCallbackInvocation() 3128 } 3129 3130 if ctx.Return(fn( 3131 args[0], 3132 )) { 3133 return 3134 } 3135 3136 js.ThrowCallbackValueNotReturned() 3137 } 3138 3139 type OnRestoredEventCallback[T any] struct { 3140 Fn func(arg T, this js.Ref) js.Ref 3141 Arg T 3142 } 3143 3144 func (cb *OnRestoredEventCallback[T]) Register() js.Func[func()] { 3145 return js.RegisterCallback[func()]( 3146 cb, abi.FuncPCABIInternal(cb.Fn), 3147 ) 3148 } 3149 3150 func (cb *OnRestoredEventCallback[T]) DispatchCallback( 3151 targetPC uintptr, ctx *js.CallbackContext, 3152 ) { 3153 args := ctx.Args() 3154 if len(args) != 0+1 /* js this */ || 3155 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3156 js.ThrowInvalidCallbackInvocation() 3157 } 3158 3159 if ctx.Return(cb.Fn( 3160 cb.Arg, 3161 args[0], 3162 )) { 3163 return 3164 } 3165 3166 js.ThrowCallbackValueNotReturned() 3167 } 3168 3169 // HasFuncOnRestored returns true if the function "WEBEXT.app.window.onRestored.addListener" exists. 3170 func HasFuncOnRestored() bool { 3171 return js.True == bindings.HasFuncOnRestored() 3172 } 3173 3174 // FuncOnRestored returns the function "WEBEXT.app.window.onRestored.addListener". 3175 func FuncOnRestored() (fn js.Func[func(callback js.Func[func()])]) { 3176 bindings.FuncOnRestored( 3177 js.Pointer(&fn), 3178 ) 3179 return 3180 } 3181 3182 // OnRestored calls the function "WEBEXT.app.window.onRestored.addListener" directly. 3183 func OnRestored(callback js.Func[func()]) (ret js.Void) { 3184 bindings.CallOnRestored( 3185 js.Pointer(&ret), 3186 callback.Ref(), 3187 ) 3188 3189 return 3190 } 3191 3192 // TryOnRestored calls the function "WEBEXT.app.window.onRestored.addListener" 3193 // in a try/catch block and returns (_, err, ok = false) when it went through 3194 // the catch clause. 3195 func TryOnRestored(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 3196 ok = js.True == bindings.TryOnRestored( 3197 js.Pointer(&ret), js.Pointer(&exception), 3198 callback.Ref(), 3199 ) 3200 3201 return 3202 } 3203 3204 // HasFuncOffRestored returns true if the function "WEBEXT.app.window.onRestored.removeListener" exists. 3205 func HasFuncOffRestored() bool { 3206 return js.True == bindings.HasFuncOffRestored() 3207 } 3208 3209 // FuncOffRestored returns the function "WEBEXT.app.window.onRestored.removeListener". 3210 func FuncOffRestored() (fn js.Func[func(callback js.Func[func()])]) { 3211 bindings.FuncOffRestored( 3212 js.Pointer(&fn), 3213 ) 3214 return 3215 } 3216 3217 // OffRestored calls the function "WEBEXT.app.window.onRestored.removeListener" directly. 3218 func OffRestored(callback js.Func[func()]) (ret js.Void) { 3219 bindings.CallOffRestored( 3220 js.Pointer(&ret), 3221 callback.Ref(), 3222 ) 3223 3224 return 3225 } 3226 3227 // TryOffRestored calls the function "WEBEXT.app.window.onRestored.removeListener" 3228 // in a try/catch block and returns (_, err, ok = false) when it went through 3229 // the catch clause. 3230 func TryOffRestored(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 3231 ok = js.True == bindings.TryOffRestored( 3232 js.Pointer(&ret), js.Pointer(&exception), 3233 callback.Ref(), 3234 ) 3235 3236 return 3237 } 3238 3239 // HasFuncHasOnRestored returns true if the function "WEBEXT.app.window.onRestored.hasListener" exists. 3240 func HasFuncHasOnRestored() bool { 3241 return js.True == bindings.HasFuncHasOnRestored() 3242 } 3243 3244 // FuncHasOnRestored returns the function "WEBEXT.app.window.onRestored.hasListener". 3245 func FuncHasOnRestored() (fn js.Func[func(callback js.Func[func()]) bool]) { 3246 bindings.FuncHasOnRestored( 3247 js.Pointer(&fn), 3248 ) 3249 return 3250 } 3251 3252 // HasOnRestored calls the function "WEBEXT.app.window.onRestored.hasListener" directly. 3253 func HasOnRestored(callback js.Func[func()]) (ret bool) { 3254 bindings.CallHasOnRestored( 3255 js.Pointer(&ret), 3256 callback.Ref(), 3257 ) 3258 3259 return 3260 } 3261 3262 // TryHasOnRestored calls the function "WEBEXT.app.window.onRestored.hasListener" 3263 // in a try/catch block and returns (_, err, ok = false) when it went through 3264 // the catch clause. 3265 func TryHasOnRestored(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 3266 ok = js.True == bindings.TryHasOnRestored( 3267 js.Pointer(&ret), js.Pointer(&exception), 3268 callback.Ref(), 3269 ) 3270 3271 return 3272 }