github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/system/display/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package display 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/system/display/bindings" 10 ) 11 12 type ActiveState uint32 13 14 const ( 15 _ ActiveState = iota 16 17 ActiveState_ACTIVE 18 ActiveState_INACTIVE 19 ) 20 21 func (ActiveState) FromRef(str js.Ref) ActiveState { 22 return ActiveState(bindings.ConstOfActiveState(str)) 23 } 24 25 func (x ActiveState) String() (string, bool) { 26 switch x { 27 case ActiveState_ACTIVE: 28 return "active", true 29 case ActiveState_INACTIVE: 30 return "inactive", true 31 default: 32 return "", false 33 } 34 } 35 36 type Bounds struct { 37 // Left is "Bounds.left" 38 // 39 // Optional 40 // 41 // NOTE: FFI_USE_Left MUST be set to true to make this field effective. 42 Left int32 43 // Top is "Bounds.top" 44 // 45 // Optional 46 // 47 // NOTE: FFI_USE_Top MUST be set to true to make this field effective. 48 Top int32 49 // Width is "Bounds.width" 50 // 51 // Optional 52 // 53 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 54 Width int32 55 // Height is "Bounds.height" 56 // 57 // Optional 58 // 59 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 60 Height int32 61 62 FFI_USE_Left bool // for Left. 63 FFI_USE_Top bool // for Top. 64 FFI_USE_Width bool // for Width. 65 FFI_USE_Height bool // for Height. 66 67 FFI_USE bool 68 } 69 70 // FromRef calls UpdateFrom and returns a Bounds with all fields set. 71 func (p Bounds) FromRef(ref js.Ref) Bounds { 72 p.UpdateFrom(ref) 73 return p 74 } 75 76 // New creates a new Bounds in the application heap. 77 func (p Bounds) New() js.Ref { 78 return bindings.BoundsJSLoad( 79 js.Pointer(&p), js.True, 0, 80 ) 81 } 82 83 // UpdateFrom copies value of all fields of the heap object to p. 84 func (p *Bounds) UpdateFrom(ref js.Ref) { 85 bindings.BoundsJSStore( 86 js.Pointer(p), ref, 87 ) 88 } 89 90 // Update writes all fields of the p to the heap object referenced by ref. 91 func (p *Bounds) Update(ref js.Ref) { 92 bindings.BoundsJSLoad( 93 js.Pointer(p), js.False, ref, 94 ) 95 } 96 97 // FreeMembers frees fields with heap reference, if recursive is true 98 // free all heap references reachable from p. 99 func (p *Bounds) FreeMembers(recursive bool) { 100 } 101 102 type DisplayInfoCallbackFunc func(this js.Ref, displayInfo js.Array[DisplayUnitInfo]) js.Ref 103 104 func (fn DisplayInfoCallbackFunc) Register() js.Func[func(displayInfo js.Array[DisplayUnitInfo])] { 105 return js.RegisterCallback[func(displayInfo js.Array[DisplayUnitInfo])]( 106 fn, abi.FuncPCABIInternal(fn), 107 ) 108 } 109 110 func (fn DisplayInfoCallbackFunc) DispatchCallback( 111 targetPC uintptr, ctx *js.CallbackContext, 112 ) { 113 args := ctx.Args() 114 if len(args) != 1+1 /* js this */ || 115 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 116 js.ThrowInvalidCallbackInvocation() 117 } 118 119 if ctx.Return(fn( 120 args[0], 121 122 js.Array[DisplayUnitInfo]{}.FromRef(args[0+1]), 123 )) { 124 return 125 } 126 127 js.ThrowCallbackValueNotReturned() 128 } 129 130 type DisplayInfoCallback[T any] struct { 131 Fn func(arg T, this js.Ref, displayInfo js.Array[DisplayUnitInfo]) js.Ref 132 Arg T 133 } 134 135 func (cb *DisplayInfoCallback[T]) Register() js.Func[func(displayInfo js.Array[DisplayUnitInfo])] { 136 return js.RegisterCallback[func(displayInfo js.Array[DisplayUnitInfo])]( 137 cb, abi.FuncPCABIInternal(cb.Fn), 138 ) 139 } 140 141 func (cb *DisplayInfoCallback[T]) DispatchCallback( 142 targetPC uintptr, ctx *js.CallbackContext, 143 ) { 144 args := ctx.Args() 145 if len(args) != 1+1 /* js this */ || 146 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 147 js.ThrowInvalidCallbackInvocation() 148 } 149 150 if ctx.Return(cb.Fn( 151 cb.Arg, 152 args[0], 153 154 js.Array[DisplayUnitInfo]{}.FromRef(args[0+1]), 155 )) { 156 return 157 } 158 159 js.ThrowCallbackValueNotReturned() 160 } 161 162 type Edid struct { 163 // ManufacturerId is "Edid.manufacturerId" 164 // 165 // Optional 166 ManufacturerId js.String 167 // ProductId is "Edid.productId" 168 // 169 // Optional 170 ProductId js.String 171 // YearOfManufacture is "Edid.yearOfManufacture" 172 // 173 // Optional 174 // 175 // NOTE: FFI_USE_YearOfManufacture MUST be set to true to make this field effective. 176 YearOfManufacture int32 177 178 FFI_USE_YearOfManufacture bool // for YearOfManufacture. 179 180 FFI_USE bool 181 } 182 183 // FromRef calls UpdateFrom and returns a Edid with all fields set. 184 func (p Edid) FromRef(ref js.Ref) Edid { 185 p.UpdateFrom(ref) 186 return p 187 } 188 189 // New creates a new Edid in the application heap. 190 func (p Edid) New() js.Ref { 191 return bindings.EdidJSLoad( 192 js.Pointer(&p), js.True, 0, 193 ) 194 } 195 196 // UpdateFrom copies value of all fields of the heap object to p. 197 func (p *Edid) UpdateFrom(ref js.Ref) { 198 bindings.EdidJSStore( 199 js.Pointer(p), ref, 200 ) 201 } 202 203 // Update writes all fields of the p to the heap object referenced by ref. 204 func (p *Edid) Update(ref js.Ref) { 205 bindings.EdidJSLoad( 206 js.Pointer(p), js.False, ref, 207 ) 208 } 209 210 // FreeMembers frees fields with heap reference, if recursive is true 211 // free all heap references reachable from p. 212 func (p *Edid) FreeMembers(recursive bool) { 213 js.Free( 214 p.ManufacturerId.Ref(), 215 p.ProductId.Ref(), 216 ) 217 p.ManufacturerId = p.ManufacturerId.FromRef(js.Undefined) 218 p.ProductId = p.ProductId.FromRef(js.Undefined) 219 } 220 221 type Insets struct { 222 // Left is "Insets.left" 223 // 224 // Optional 225 // 226 // NOTE: FFI_USE_Left MUST be set to true to make this field effective. 227 Left int32 228 // Top is "Insets.top" 229 // 230 // Optional 231 // 232 // NOTE: FFI_USE_Top MUST be set to true to make this field effective. 233 Top int32 234 // Right is "Insets.right" 235 // 236 // Optional 237 // 238 // NOTE: FFI_USE_Right MUST be set to true to make this field effective. 239 Right int32 240 // Bottom is "Insets.bottom" 241 // 242 // Optional 243 // 244 // NOTE: FFI_USE_Bottom MUST be set to true to make this field effective. 245 Bottom int32 246 247 FFI_USE_Left bool // for Left. 248 FFI_USE_Top bool // for Top. 249 FFI_USE_Right bool // for Right. 250 FFI_USE_Bottom bool // for Bottom. 251 252 FFI_USE bool 253 } 254 255 // FromRef calls UpdateFrom and returns a Insets with all fields set. 256 func (p Insets) FromRef(ref js.Ref) Insets { 257 p.UpdateFrom(ref) 258 return p 259 } 260 261 // New creates a new Insets in the application heap. 262 func (p Insets) New() js.Ref { 263 return bindings.InsetsJSLoad( 264 js.Pointer(&p), js.True, 0, 265 ) 266 } 267 268 // UpdateFrom copies value of all fields of the heap object to p. 269 func (p *Insets) UpdateFrom(ref js.Ref) { 270 bindings.InsetsJSStore( 271 js.Pointer(p), ref, 272 ) 273 } 274 275 // Update writes all fields of the p to the heap object referenced by ref. 276 func (p *Insets) Update(ref js.Ref) { 277 bindings.InsetsJSLoad( 278 js.Pointer(p), js.False, ref, 279 ) 280 } 281 282 // FreeMembers frees fields with heap reference, if recursive is true 283 // free all heap references reachable from p. 284 func (p *Insets) FreeMembers(recursive bool) { 285 } 286 287 type DisplayMode struct { 288 // Width is "DisplayMode.width" 289 // 290 // Optional 291 // 292 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 293 Width int32 294 // Height is "DisplayMode.height" 295 // 296 // Optional 297 // 298 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 299 Height int32 300 // WidthInNativePixels is "DisplayMode.widthInNativePixels" 301 // 302 // Optional 303 // 304 // NOTE: FFI_USE_WidthInNativePixels MUST be set to true to make this field effective. 305 WidthInNativePixels int32 306 // HeightInNativePixels is "DisplayMode.heightInNativePixels" 307 // 308 // Optional 309 // 310 // NOTE: FFI_USE_HeightInNativePixels MUST be set to true to make this field effective. 311 HeightInNativePixels int32 312 // UiScale is "DisplayMode.uiScale" 313 // 314 // Optional 315 // 316 // NOTE: FFI_USE_UiScale MUST be set to true to make this field effective. 317 UiScale float64 318 // DeviceScaleFactor is "DisplayMode.deviceScaleFactor" 319 // 320 // Optional 321 // 322 // NOTE: FFI_USE_DeviceScaleFactor MUST be set to true to make this field effective. 323 DeviceScaleFactor float64 324 // RefreshRate is "DisplayMode.refreshRate" 325 // 326 // Optional 327 // 328 // NOTE: FFI_USE_RefreshRate MUST be set to true to make this field effective. 329 RefreshRate float64 330 // IsNative is "DisplayMode.isNative" 331 // 332 // Optional 333 // 334 // NOTE: FFI_USE_IsNative MUST be set to true to make this field effective. 335 IsNative bool 336 // IsSelected is "DisplayMode.isSelected" 337 // 338 // Optional 339 // 340 // NOTE: FFI_USE_IsSelected MUST be set to true to make this field effective. 341 IsSelected bool 342 // IsInterlaced is "DisplayMode.isInterlaced" 343 // 344 // Optional 345 // 346 // NOTE: FFI_USE_IsInterlaced MUST be set to true to make this field effective. 347 IsInterlaced bool 348 349 FFI_USE_Width bool // for Width. 350 FFI_USE_Height bool // for Height. 351 FFI_USE_WidthInNativePixels bool // for WidthInNativePixels. 352 FFI_USE_HeightInNativePixels bool // for HeightInNativePixels. 353 FFI_USE_UiScale bool // for UiScale. 354 FFI_USE_DeviceScaleFactor bool // for DeviceScaleFactor. 355 FFI_USE_RefreshRate bool // for RefreshRate. 356 FFI_USE_IsNative bool // for IsNative. 357 FFI_USE_IsSelected bool // for IsSelected. 358 FFI_USE_IsInterlaced bool // for IsInterlaced. 359 360 FFI_USE bool 361 } 362 363 // FromRef calls UpdateFrom and returns a DisplayMode with all fields set. 364 func (p DisplayMode) FromRef(ref js.Ref) DisplayMode { 365 p.UpdateFrom(ref) 366 return p 367 } 368 369 // New creates a new DisplayMode in the application heap. 370 func (p DisplayMode) New() js.Ref { 371 return bindings.DisplayModeJSLoad( 372 js.Pointer(&p), js.True, 0, 373 ) 374 } 375 376 // UpdateFrom copies value of all fields of the heap object to p. 377 func (p *DisplayMode) UpdateFrom(ref js.Ref) { 378 bindings.DisplayModeJSStore( 379 js.Pointer(p), ref, 380 ) 381 } 382 383 // Update writes all fields of the p to the heap object referenced by ref. 384 func (p *DisplayMode) Update(ref js.Ref) { 385 bindings.DisplayModeJSLoad( 386 js.Pointer(p), js.False, ref, 387 ) 388 } 389 390 // FreeMembers frees fields with heap reference, if recursive is true 391 // free all heap references reachable from p. 392 func (p *DisplayMode) FreeMembers(recursive bool) { 393 } 394 395 type DisplayUnitInfo struct { 396 // Id is "DisplayUnitInfo.id" 397 // 398 // Optional 399 Id js.String 400 // Name is "DisplayUnitInfo.name" 401 // 402 // Optional 403 Name js.String 404 // Edid is "DisplayUnitInfo.edid" 405 // 406 // Optional 407 // 408 // NOTE: Edid.FFI_USE MUST be set to true to get Edid used. 409 Edid Edid 410 // MirroringSourceId is "DisplayUnitInfo.mirroringSourceId" 411 // 412 // Optional 413 MirroringSourceId js.String 414 // MirroringDestinationIds is "DisplayUnitInfo.mirroringDestinationIds" 415 // 416 // Optional 417 MirroringDestinationIds js.Array[js.String] 418 // IsPrimary is "DisplayUnitInfo.isPrimary" 419 // 420 // Optional 421 // 422 // NOTE: FFI_USE_IsPrimary MUST be set to true to make this field effective. 423 IsPrimary bool 424 // IsInternal is "DisplayUnitInfo.isInternal" 425 // 426 // Optional 427 // 428 // NOTE: FFI_USE_IsInternal MUST be set to true to make this field effective. 429 IsInternal bool 430 // IsEnabled is "DisplayUnitInfo.isEnabled" 431 // 432 // Optional 433 // 434 // NOTE: FFI_USE_IsEnabled MUST be set to true to make this field effective. 435 IsEnabled bool 436 // ActiveState is "DisplayUnitInfo.activeState" 437 // 438 // Optional 439 ActiveState ActiveState 440 // IsUnified is "DisplayUnitInfo.isUnified" 441 // 442 // Optional 443 // 444 // NOTE: FFI_USE_IsUnified MUST be set to true to make this field effective. 445 IsUnified bool 446 // IsAutoRotationAllowed is "DisplayUnitInfo.isAutoRotationAllowed" 447 // 448 // Optional 449 // 450 // NOTE: FFI_USE_IsAutoRotationAllowed MUST be set to true to make this field effective. 451 IsAutoRotationAllowed bool 452 // DpiX is "DisplayUnitInfo.dpiX" 453 // 454 // Optional 455 // 456 // NOTE: FFI_USE_DpiX MUST be set to true to make this field effective. 457 DpiX float64 458 // DpiY is "DisplayUnitInfo.dpiY" 459 // 460 // Optional 461 // 462 // NOTE: FFI_USE_DpiY MUST be set to true to make this field effective. 463 DpiY float64 464 // Rotation is "DisplayUnitInfo.rotation" 465 // 466 // Optional 467 // 468 // NOTE: FFI_USE_Rotation MUST be set to true to make this field effective. 469 Rotation int32 470 // Bounds is "DisplayUnitInfo.bounds" 471 // 472 // Optional 473 // 474 // NOTE: Bounds.FFI_USE MUST be set to true to get Bounds used. 475 Bounds Bounds 476 // Overscan is "DisplayUnitInfo.overscan" 477 // 478 // Optional 479 // 480 // NOTE: Overscan.FFI_USE MUST be set to true to get Overscan used. 481 Overscan Insets 482 // WorkArea is "DisplayUnitInfo.workArea" 483 // 484 // Optional 485 // 486 // NOTE: WorkArea.FFI_USE MUST be set to true to get WorkArea used. 487 WorkArea Bounds 488 // Modes is "DisplayUnitInfo.modes" 489 // 490 // Optional 491 Modes js.Array[DisplayMode] 492 // HasTouchSupport is "DisplayUnitInfo.hasTouchSupport" 493 // 494 // Optional 495 // 496 // NOTE: FFI_USE_HasTouchSupport MUST be set to true to make this field effective. 497 HasTouchSupport bool 498 // HasAccelerometerSupport is "DisplayUnitInfo.hasAccelerometerSupport" 499 // 500 // Optional 501 // 502 // NOTE: FFI_USE_HasAccelerometerSupport MUST be set to true to make this field effective. 503 HasAccelerometerSupport bool 504 // AvailableDisplayZoomFactors is "DisplayUnitInfo.availableDisplayZoomFactors" 505 // 506 // Optional 507 AvailableDisplayZoomFactors js.Array[float64] 508 // DisplayZoomFactor is "DisplayUnitInfo.displayZoomFactor" 509 // 510 // Optional 511 // 512 // NOTE: FFI_USE_DisplayZoomFactor MUST be set to true to make this field effective. 513 DisplayZoomFactor float64 514 515 FFI_USE_IsPrimary bool // for IsPrimary. 516 FFI_USE_IsInternal bool // for IsInternal. 517 FFI_USE_IsEnabled bool // for IsEnabled. 518 FFI_USE_IsUnified bool // for IsUnified. 519 FFI_USE_IsAutoRotationAllowed bool // for IsAutoRotationAllowed. 520 FFI_USE_DpiX bool // for DpiX. 521 FFI_USE_DpiY bool // for DpiY. 522 FFI_USE_Rotation bool // for Rotation. 523 FFI_USE_HasTouchSupport bool // for HasTouchSupport. 524 FFI_USE_HasAccelerometerSupport bool // for HasAccelerometerSupport. 525 FFI_USE_DisplayZoomFactor bool // for DisplayZoomFactor. 526 527 FFI_USE bool 528 } 529 530 // FromRef calls UpdateFrom and returns a DisplayUnitInfo with all fields set. 531 func (p DisplayUnitInfo) FromRef(ref js.Ref) DisplayUnitInfo { 532 p.UpdateFrom(ref) 533 return p 534 } 535 536 // New creates a new DisplayUnitInfo in the application heap. 537 func (p DisplayUnitInfo) New() js.Ref { 538 return bindings.DisplayUnitInfoJSLoad( 539 js.Pointer(&p), js.True, 0, 540 ) 541 } 542 543 // UpdateFrom copies value of all fields of the heap object to p. 544 func (p *DisplayUnitInfo) UpdateFrom(ref js.Ref) { 545 bindings.DisplayUnitInfoJSStore( 546 js.Pointer(p), ref, 547 ) 548 } 549 550 // Update writes all fields of the p to the heap object referenced by ref. 551 func (p *DisplayUnitInfo) Update(ref js.Ref) { 552 bindings.DisplayUnitInfoJSLoad( 553 js.Pointer(p), js.False, ref, 554 ) 555 } 556 557 // FreeMembers frees fields with heap reference, if recursive is true 558 // free all heap references reachable from p. 559 func (p *DisplayUnitInfo) FreeMembers(recursive bool) { 560 js.Free( 561 p.Id.Ref(), 562 p.Name.Ref(), 563 p.MirroringSourceId.Ref(), 564 p.MirroringDestinationIds.Ref(), 565 p.Modes.Ref(), 566 p.AvailableDisplayZoomFactors.Ref(), 567 ) 568 p.Id = p.Id.FromRef(js.Undefined) 569 p.Name = p.Name.FromRef(js.Undefined) 570 p.MirroringSourceId = p.MirroringSourceId.FromRef(js.Undefined) 571 p.MirroringDestinationIds = p.MirroringDestinationIds.FromRef(js.Undefined) 572 p.Modes = p.Modes.FromRef(js.Undefined) 573 p.AvailableDisplayZoomFactors = p.AvailableDisplayZoomFactors.FromRef(js.Undefined) 574 if recursive { 575 p.Edid.FreeMembers(true) 576 p.Bounds.FreeMembers(true) 577 p.Overscan.FreeMembers(true) 578 p.WorkArea.FreeMembers(true) 579 } 580 } 581 582 type LayoutPosition uint32 583 584 const ( 585 _ LayoutPosition = iota 586 587 LayoutPosition_TOP 588 LayoutPosition_RIGHT 589 LayoutPosition_BOTTOM 590 LayoutPosition_LEFT 591 ) 592 593 func (LayoutPosition) FromRef(str js.Ref) LayoutPosition { 594 return LayoutPosition(bindings.ConstOfLayoutPosition(str)) 595 } 596 597 func (x LayoutPosition) String() (string, bool) { 598 switch x { 599 case LayoutPosition_TOP: 600 return "top", true 601 case LayoutPosition_RIGHT: 602 return "right", true 603 case LayoutPosition_BOTTOM: 604 return "bottom", true 605 case LayoutPosition_LEFT: 606 return "left", true 607 default: 608 return "", false 609 } 610 } 611 612 type DisplayLayout struct { 613 // Id is "DisplayLayout.id" 614 // 615 // Optional 616 Id js.String 617 // ParentId is "DisplayLayout.parentId" 618 // 619 // Optional 620 ParentId js.String 621 // Position is "DisplayLayout.position" 622 // 623 // Optional 624 Position LayoutPosition 625 // Offset is "DisplayLayout.offset" 626 // 627 // Optional 628 // 629 // NOTE: FFI_USE_Offset MUST be set to true to make this field effective. 630 Offset int32 631 632 FFI_USE_Offset bool // for Offset. 633 634 FFI_USE bool 635 } 636 637 // FromRef calls UpdateFrom and returns a DisplayLayout with all fields set. 638 func (p DisplayLayout) FromRef(ref js.Ref) DisplayLayout { 639 p.UpdateFrom(ref) 640 return p 641 } 642 643 // New creates a new DisplayLayout in the application heap. 644 func (p DisplayLayout) New() js.Ref { 645 return bindings.DisplayLayoutJSLoad( 646 js.Pointer(&p), js.True, 0, 647 ) 648 } 649 650 // UpdateFrom copies value of all fields of the heap object to p. 651 func (p *DisplayLayout) UpdateFrom(ref js.Ref) { 652 bindings.DisplayLayoutJSStore( 653 js.Pointer(p), ref, 654 ) 655 } 656 657 // Update writes all fields of the p to the heap object referenced by ref. 658 func (p *DisplayLayout) Update(ref js.Ref) { 659 bindings.DisplayLayoutJSLoad( 660 js.Pointer(p), js.False, ref, 661 ) 662 } 663 664 // FreeMembers frees fields with heap reference, if recursive is true 665 // free all heap references reachable from p. 666 func (p *DisplayLayout) FreeMembers(recursive bool) { 667 js.Free( 668 p.Id.Ref(), 669 p.ParentId.Ref(), 670 ) 671 p.Id = p.Id.FromRef(js.Undefined) 672 p.ParentId = p.ParentId.FromRef(js.Undefined) 673 } 674 675 type DisplayLayoutCallbackFunc func(this js.Ref, layouts js.Array[DisplayLayout]) js.Ref 676 677 func (fn DisplayLayoutCallbackFunc) Register() js.Func[func(layouts js.Array[DisplayLayout])] { 678 return js.RegisterCallback[func(layouts js.Array[DisplayLayout])]( 679 fn, abi.FuncPCABIInternal(fn), 680 ) 681 } 682 683 func (fn DisplayLayoutCallbackFunc) DispatchCallback( 684 targetPC uintptr, ctx *js.CallbackContext, 685 ) { 686 args := ctx.Args() 687 if len(args) != 1+1 /* js this */ || 688 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 689 js.ThrowInvalidCallbackInvocation() 690 } 691 692 if ctx.Return(fn( 693 args[0], 694 695 js.Array[DisplayLayout]{}.FromRef(args[0+1]), 696 )) { 697 return 698 } 699 700 js.ThrowCallbackValueNotReturned() 701 } 702 703 type DisplayLayoutCallback[T any] struct { 704 Fn func(arg T, this js.Ref, layouts js.Array[DisplayLayout]) js.Ref 705 Arg T 706 } 707 708 func (cb *DisplayLayoutCallback[T]) Register() js.Func[func(layouts js.Array[DisplayLayout])] { 709 return js.RegisterCallback[func(layouts js.Array[DisplayLayout])]( 710 cb, abi.FuncPCABIInternal(cb.Fn), 711 ) 712 } 713 714 func (cb *DisplayLayoutCallback[T]) DispatchCallback( 715 targetPC uintptr, ctx *js.CallbackContext, 716 ) { 717 args := ctx.Args() 718 if len(args) != 1+1 /* js this */ || 719 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 720 js.ThrowInvalidCallbackInvocation() 721 } 722 723 if ctx.Return(cb.Fn( 724 cb.Arg, 725 args[0], 726 727 js.Array[DisplayLayout]{}.FromRef(args[0+1]), 728 )) { 729 return 730 } 731 732 js.ThrowCallbackValueNotReturned() 733 } 734 735 type DisplayProperties struct { 736 // IsUnified is "DisplayProperties.isUnified" 737 // 738 // Optional 739 // 740 // NOTE: FFI_USE_IsUnified MUST be set to true to make this field effective. 741 IsUnified bool 742 // MirroringSourceId is "DisplayProperties.mirroringSourceId" 743 // 744 // Optional 745 MirroringSourceId js.String 746 // IsPrimary is "DisplayProperties.isPrimary" 747 // 748 // Optional 749 // 750 // NOTE: FFI_USE_IsPrimary MUST be set to true to make this field effective. 751 IsPrimary bool 752 // Overscan is "DisplayProperties.overscan" 753 // 754 // Optional 755 // 756 // NOTE: Overscan.FFI_USE MUST be set to true to get Overscan used. 757 Overscan Insets 758 // Rotation is "DisplayProperties.rotation" 759 // 760 // Optional 761 // 762 // NOTE: FFI_USE_Rotation MUST be set to true to make this field effective. 763 Rotation int32 764 // BoundsOriginX is "DisplayProperties.boundsOriginX" 765 // 766 // Optional 767 // 768 // NOTE: FFI_USE_BoundsOriginX MUST be set to true to make this field effective. 769 BoundsOriginX int32 770 // BoundsOriginY is "DisplayProperties.boundsOriginY" 771 // 772 // Optional 773 // 774 // NOTE: FFI_USE_BoundsOriginY MUST be set to true to make this field effective. 775 BoundsOriginY int32 776 // DisplayMode is "DisplayProperties.displayMode" 777 // 778 // Optional 779 // 780 // NOTE: DisplayMode.FFI_USE MUST be set to true to get DisplayMode used. 781 DisplayMode DisplayMode 782 // DisplayZoomFactor is "DisplayProperties.displayZoomFactor" 783 // 784 // Optional 785 // 786 // NOTE: FFI_USE_DisplayZoomFactor MUST be set to true to make this field effective. 787 DisplayZoomFactor float64 788 789 FFI_USE_IsUnified bool // for IsUnified. 790 FFI_USE_IsPrimary bool // for IsPrimary. 791 FFI_USE_Rotation bool // for Rotation. 792 FFI_USE_BoundsOriginX bool // for BoundsOriginX. 793 FFI_USE_BoundsOriginY bool // for BoundsOriginY. 794 FFI_USE_DisplayZoomFactor bool // for DisplayZoomFactor. 795 796 FFI_USE bool 797 } 798 799 // FromRef calls UpdateFrom and returns a DisplayProperties with all fields set. 800 func (p DisplayProperties) FromRef(ref js.Ref) DisplayProperties { 801 p.UpdateFrom(ref) 802 return p 803 } 804 805 // New creates a new DisplayProperties in the application heap. 806 func (p DisplayProperties) New() js.Ref { 807 return bindings.DisplayPropertiesJSLoad( 808 js.Pointer(&p), js.True, 0, 809 ) 810 } 811 812 // UpdateFrom copies value of all fields of the heap object to p. 813 func (p *DisplayProperties) UpdateFrom(ref js.Ref) { 814 bindings.DisplayPropertiesJSStore( 815 js.Pointer(p), ref, 816 ) 817 } 818 819 // Update writes all fields of the p to the heap object referenced by ref. 820 func (p *DisplayProperties) Update(ref js.Ref) { 821 bindings.DisplayPropertiesJSLoad( 822 js.Pointer(p), js.False, ref, 823 ) 824 } 825 826 // FreeMembers frees fields with heap reference, if recursive is true 827 // free all heap references reachable from p. 828 func (p *DisplayProperties) FreeMembers(recursive bool) { 829 js.Free( 830 p.MirroringSourceId.Ref(), 831 ) 832 p.MirroringSourceId = p.MirroringSourceId.FromRef(js.Undefined) 833 if recursive { 834 p.Overscan.FreeMembers(true) 835 p.DisplayMode.FreeMembers(true) 836 } 837 } 838 839 type GetInfoFlags struct { 840 // SingleUnified is "GetInfoFlags.singleUnified" 841 // 842 // Optional 843 // 844 // NOTE: FFI_USE_SingleUnified MUST be set to true to make this field effective. 845 SingleUnified bool 846 847 FFI_USE_SingleUnified bool // for SingleUnified. 848 849 FFI_USE bool 850 } 851 852 // FromRef calls UpdateFrom and returns a GetInfoFlags with all fields set. 853 func (p GetInfoFlags) FromRef(ref js.Ref) GetInfoFlags { 854 p.UpdateFrom(ref) 855 return p 856 } 857 858 // New creates a new GetInfoFlags in the application heap. 859 func (p GetInfoFlags) New() js.Ref { 860 return bindings.GetInfoFlagsJSLoad( 861 js.Pointer(&p), js.True, 0, 862 ) 863 } 864 865 // UpdateFrom copies value of all fields of the heap object to p. 866 func (p *GetInfoFlags) UpdateFrom(ref js.Ref) { 867 bindings.GetInfoFlagsJSStore( 868 js.Pointer(p), ref, 869 ) 870 } 871 872 // Update writes all fields of the p to the heap object referenced by ref. 873 func (p *GetInfoFlags) Update(ref js.Ref) { 874 bindings.GetInfoFlagsJSLoad( 875 js.Pointer(p), js.False, ref, 876 ) 877 } 878 879 // FreeMembers frees fields with heap reference, if recursive is true 880 // free all heap references reachable from p. 881 func (p *GetInfoFlags) FreeMembers(recursive bool) { 882 } 883 884 type MirrorMode uint32 885 886 const ( 887 _ MirrorMode = iota 888 889 MirrorMode_OFF 890 MirrorMode_NORMAL 891 MirrorMode_MIXED 892 ) 893 894 func (MirrorMode) FromRef(str js.Ref) MirrorMode { 895 return MirrorMode(bindings.ConstOfMirrorMode(str)) 896 } 897 898 func (x MirrorMode) String() (string, bool) { 899 switch x { 900 case MirrorMode_OFF: 901 return "off", true 902 case MirrorMode_NORMAL: 903 return "normal", true 904 case MirrorMode_MIXED: 905 return "mixed", true 906 default: 907 return "", false 908 } 909 } 910 911 type MirrorModeInfo struct { 912 // Mode is "MirrorModeInfo.mode" 913 // 914 // Optional 915 Mode MirrorMode 916 // MirroringSourceId is "MirrorModeInfo.mirroringSourceId" 917 // 918 // Optional 919 MirroringSourceId js.String 920 // MirroringDestinationIds is "MirrorModeInfo.mirroringDestinationIds" 921 // 922 // Optional 923 MirroringDestinationIds js.Array[js.String] 924 925 FFI_USE bool 926 } 927 928 // FromRef calls UpdateFrom and returns a MirrorModeInfo with all fields set. 929 func (p MirrorModeInfo) FromRef(ref js.Ref) MirrorModeInfo { 930 p.UpdateFrom(ref) 931 return p 932 } 933 934 // New creates a new MirrorModeInfo in the application heap. 935 func (p MirrorModeInfo) New() js.Ref { 936 return bindings.MirrorModeInfoJSLoad( 937 js.Pointer(&p), js.True, 0, 938 ) 939 } 940 941 // UpdateFrom copies value of all fields of the heap object to p. 942 func (p *MirrorModeInfo) UpdateFrom(ref js.Ref) { 943 bindings.MirrorModeInfoJSStore( 944 js.Pointer(p), ref, 945 ) 946 } 947 948 // Update writes all fields of the p to the heap object referenced by ref. 949 func (p *MirrorModeInfo) Update(ref js.Ref) { 950 bindings.MirrorModeInfoJSLoad( 951 js.Pointer(p), js.False, ref, 952 ) 953 } 954 955 // FreeMembers frees fields with heap reference, if recursive is true 956 // free all heap references reachable from p. 957 func (p *MirrorModeInfo) FreeMembers(recursive bool) { 958 js.Free( 959 p.MirroringSourceId.Ref(), 960 p.MirroringDestinationIds.Ref(), 961 ) 962 p.MirroringSourceId = p.MirroringSourceId.FromRef(js.Undefined) 963 p.MirroringDestinationIds = p.MirroringDestinationIds.FromRef(js.Undefined) 964 } 965 966 type NativeTouchCalibrationCallbackFunc func(this js.Ref, success bool) js.Ref 967 968 func (fn NativeTouchCalibrationCallbackFunc) Register() js.Func[func(success bool)] { 969 return js.RegisterCallback[func(success bool)]( 970 fn, abi.FuncPCABIInternal(fn), 971 ) 972 } 973 974 func (fn NativeTouchCalibrationCallbackFunc) DispatchCallback( 975 targetPC uintptr, ctx *js.CallbackContext, 976 ) { 977 args := ctx.Args() 978 if len(args) != 1+1 /* js this */ || 979 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 980 js.ThrowInvalidCallbackInvocation() 981 } 982 983 if ctx.Return(fn( 984 args[0], 985 986 args[0+1] == js.True, 987 )) { 988 return 989 } 990 991 js.ThrowCallbackValueNotReturned() 992 } 993 994 type NativeTouchCalibrationCallback[T any] struct { 995 Fn func(arg T, this js.Ref, success bool) js.Ref 996 Arg T 997 } 998 999 func (cb *NativeTouchCalibrationCallback[T]) Register() js.Func[func(success bool)] { 1000 return js.RegisterCallback[func(success bool)]( 1001 cb, abi.FuncPCABIInternal(cb.Fn), 1002 ) 1003 } 1004 1005 func (cb *NativeTouchCalibrationCallback[T]) DispatchCallback( 1006 targetPC uintptr, ctx *js.CallbackContext, 1007 ) { 1008 args := ctx.Args() 1009 if len(args) != 1+1 /* js this */ || 1010 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1011 js.ThrowInvalidCallbackInvocation() 1012 } 1013 1014 if ctx.Return(cb.Fn( 1015 cb.Arg, 1016 args[0], 1017 1018 args[0+1] == js.True, 1019 )) { 1020 return 1021 } 1022 1023 js.ThrowCallbackValueNotReturned() 1024 } 1025 1026 type Point struct { 1027 // X is "Point.x" 1028 // 1029 // Optional 1030 // 1031 // NOTE: FFI_USE_X MUST be set to true to make this field effective. 1032 X int32 1033 // Y is "Point.y" 1034 // 1035 // Optional 1036 // 1037 // NOTE: FFI_USE_Y MUST be set to true to make this field effective. 1038 Y int32 1039 1040 FFI_USE_X bool // for X. 1041 FFI_USE_Y bool // for Y. 1042 1043 FFI_USE bool 1044 } 1045 1046 // FromRef calls UpdateFrom and returns a Point with all fields set. 1047 func (p Point) FromRef(ref js.Ref) Point { 1048 p.UpdateFrom(ref) 1049 return p 1050 } 1051 1052 // New creates a new Point in the application heap. 1053 func (p Point) New() js.Ref { 1054 return bindings.PointJSLoad( 1055 js.Pointer(&p), js.True, 0, 1056 ) 1057 } 1058 1059 // UpdateFrom copies value of all fields of the heap object to p. 1060 func (p *Point) UpdateFrom(ref js.Ref) { 1061 bindings.PointJSStore( 1062 js.Pointer(p), ref, 1063 ) 1064 } 1065 1066 // Update writes all fields of the p to the heap object referenced by ref. 1067 func (p *Point) Update(ref js.Ref) { 1068 bindings.PointJSLoad( 1069 js.Pointer(p), js.False, ref, 1070 ) 1071 } 1072 1073 // FreeMembers frees fields with heap reference, if recursive is true 1074 // free all heap references reachable from p. 1075 func (p *Point) FreeMembers(recursive bool) { 1076 } 1077 1078 type SetDisplayLayoutCallbackFunc func(this js.Ref) js.Ref 1079 1080 func (fn SetDisplayLayoutCallbackFunc) Register() js.Func[func()] { 1081 return js.RegisterCallback[func()]( 1082 fn, abi.FuncPCABIInternal(fn), 1083 ) 1084 } 1085 1086 func (fn SetDisplayLayoutCallbackFunc) DispatchCallback( 1087 targetPC uintptr, ctx *js.CallbackContext, 1088 ) { 1089 args := ctx.Args() 1090 if len(args) != 0+1 /* js this */ || 1091 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1092 js.ThrowInvalidCallbackInvocation() 1093 } 1094 1095 if ctx.Return(fn( 1096 args[0], 1097 )) { 1098 return 1099 } 1100 1101 js.ThrowCallbackValueNotReturned() 1102 } 1103 1104 type SetDisplayLayoutCallback[T any] struct { 1105 Fn func(arg T, this js.Ref) js.Ref 1106 Arg T 1107 } 1108 1109 func (cb *SetDisplayLayoutCallback[T]) Register() js.Func[func()] { 1110 return js.RegisterCallback[func()]( 1111 cb, abi.FuncPCABIInternal(cb.Fn), 1112 ) 1113 } 1114 1115 func (cb *SetDisplayLayoutCallback[T]) DispatchCallback( 1116 targetPC uintptr, ctx *js.CallbackContext, 1117 ) { 1118 args := ctx.Args() 1119 if len(args) != 0+1 /* js this */ || 1120 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1121 js.ThrowInvalidCallbackInvocation() 1122 } 1123 1124 if ctx.Return(cb.Fn( 1125 cb.Arg, 1126 args[0], 1127 )) { 1128 return 1129 } 1130 1131 js.ThrowCallbackValueNotReturned() 1132 } 1133 1134 type SetDisplayUnitInfoCallbackFunc func(this js.Ref) js.Ref 1135 1136 func (fn SetDisplayUnitInfoCallbackFunc) Register() js.Func[func()] { 1137 return js.RegisterCallback[func()]( 1138 fn, abi.FuncPCABIInternal(fn), 1139 ) 1140 } 1141 1142 func (fn SetDisplayUnitInfoCallbackFunc) DispatchCallback( 1143 targetPC uintptr, ctx *js.CallbackContext, 1144 ) { 1145 args := ctx.Args() 1146 if len(args) != 0+1 /* js this */ || 1147 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1148 js.ThrowInvalidCallbackInvocation() 1149 } 1150 1151 if ctx.Return(fn( 1152 args[0], 1153 )) { 1154 return 1155 } 1156 1157 js.ThrowCallbackValueNotReturned() 1158 } 1159 1160 type SetDisplayUnitInfoCallback[T any] struct { 1161 Fn func(arg T, this js.Ref) js.Ref 1162 Arg T 1163 } 1164 1165 func (cb *SetDisplayUnitInfoCallback[T]) Register() js.Func[func()] { 1166 return js.RegisterCallback[func()]( 1167 cb, abi.FuncPCABIInternal(cb.Fn), 1168 ) 1169 } 1170 1171 func (cb *SetDisplayUnitInfoCallback[T]) DispatchCallback( 1172 targetPC uintptr, ctx *js.CallbackContext, 1173 ) { 1174 args := ctx.Args() 1175 if len(args) != 0+1 /* js this */ || 1176 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1177 js.ThrowInvalidCallbackInvocation() 1178 } 1179 1180 if ctx.Return(cb.Fn( 1181 cb.Arg, 1182 args[0], 1183 )) { 1184 return 1185 } 1186 1187 js.ThrowCallbackValueNotReturned() 1188 } 1189 1190 type SetMirrorModeCallbackFunc func(this js.Ref) js.Ref 1191 1192 func (fn SetMirrorModeCallbackFunc) Register() js.Func[func()] { 1193 return js.RegisterCallback[func()]( 1194 fn, abi.FuncPCABIInternal(fn), 1195 ) 1196 } 1197 1198 func (fn SetMirrorModeCallbackFunc) DispatchCallback( 1199 targetPC uintptr, ctx *js.CallbackContext, 1200 ) { 1201 args := ctx.Args() 1202 if len(args) != 0+1 /* js this */ || 1203 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1204 js.ThrowInvalidCallbackInvocation() 1205 } 1206 1207 if ctx.Return(fn( 1208 args[0], 1209 )) { 1210 return 1211 } 1212 1213 js.ThrowCallbackValueNotReturned() 1214 } 1215 1216 type SetMirrorModeCallback[T any] struct { 1217 Fn func(arg T, this js.Ref) js.Ref 1218 Arg T 1219 } 1220 1221 func (cb *SetMirrorModeCallback[T]) Register() js.Func[func()] { 1222 return js.RegisterCallback[func()]( 1223 cb, abi.FuncPCABIInternal(cb.Fn), 1224 ) 1225 } 1226 1227 func (cb *SetMirrorModeCallback[T]) DispatchCallback( 1228 targetPC uintptr, ctx *js.CallbackContext, 1229 ) { 1230 args := ctx.Args() 1231 if len(args) != 0+1 /* js this */ || 1232 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1233 js.ThrowInvalidCallbackInvocation() 1234 } 1235 1236 if ctx.Return(cb.Fn( 1237 cb.Arg, 1238 args[0], 1239 )) { 1240 return 1241 } 1242 1243 js.ThrowCallbackValueNotReturned() 1244 } 1245 1246 type TouchCalibrationPair struct { 1247 // DisplayPoint is "TouchCalibrationPair.displayPoint" 1248 // 1249 // Optional 1250 // 1251 // NOTE: DisplayPoint.FFI_USE MUST be set to true to get DisplayPoint used. 1252 DisplayPoint Point 1253 // TouchPoint is "TouchCalibrationPair.touchPoint" 1254 // 1255 // Optional 1256 // 1257 // NOTE: TouchPoint.FFI_USE MUST be set to true to get TouchPoint used. 1258 TouchPoint Point 1259 1260 FFI_USE bool 1261 } 1262 1263 // FromRef calls UpdateFrom and returns a TouchCalibrationPair with all fields set. 1264 func (p TouchCalibrationPair) FromRef(ref js.Ref) TouchCalibrationPair { 1265 p.UpdateFrom(ref) 1266 return p 1267 } 1268 1269 // New creates a new TouchCalibrationPair in the application heap. 1270 func (p TouchCalibrationPair) New() js.Ref { 1271 return bindings.TouchCalibrationPairJSLoad( 1272 js.Pointer(&p), js.True, 0, 1273 ) 1274 } 1275 1276 // UpdateFrom copies value of all fields of the heap object to p. 1277 func (p *TouchCalibrationPair) UpdateFrom(ref js.Ref) { 1278 bindings.TouchCalibrationPairJSStore( 1279 js.Pointer(p), ref, 1280 ) 1281 } 1282 1283 // Update writes all fields of the p to the heap object referenced by ref. 1284 func (p *TouchCalibrationPair) Update(ref js.Ref) { 1285 bindings.TouchCalibrationPairJSLoad( 1286 js.Pointer(p), js.False, ref, 1287 ) 1288 } 1289 1290 // FreeMembers frees fields with heap reference, if recursive is true 1291 // free all heap references reachable from p. 1292 func (p *TouchCalibrationPair) FreeMembers(recursive bool) { 1293 if recursive { 1294 p.DisplayPoint.FreeMembers(true) 1295 p.TouchPoint.FreeMembers(true) 1296 } 1297 } 1298 1299 type TouchCalibrationPairQuad struct { 1300 // Pair1 is "TouchCalibrationPairQuad.pair1" 1301 // 1302 // Optional 1303 // 1304 // NOTE: Pair1.FFI_USE MUST be set to true to get Pair1 used. 1305 Pair1 TouchCalibrationPair 1306 // Pair2 is "TouchCalibrationPairQuad.pair2" 1307 // 1308 // Optional 1309 // 1310 // NOTE: Pair2.FFI_USE MUST be set to true to get Pair2 used. 1311 Pair2 TouchCalibrationPair 1312 // Pair3 is "TouchCalibrationPairQuad.pair3" 1313 // 1314 // Optional 1315 // 1316 // NOTE: Pair3.FFI_USE MUST be set to true to get Pair3 used. 1317 Pair3 TouchCalibrationPair 1318 // Pair4 is "TouchCalibrationPairQuad.pair4" 1319 // 1320 // Optional 1321 // 1322 // NOTE: Pair4.FFI_USE MUST be set to true to get Pair4 used. 1323 Pair4 TouchCalibrationPair 1324 1325 FFI_USE bool 1326 } 1327 1328 // FromRef calls UpdateFrom and returns a TouchCalibrationPairQuad with all fields set. 1329 func (p TouchCalibrationPairQuad) FromRef(ref js.Ref) TouchCalibrationPairQuad { 1330 p.UpdateFrom(ref) 1331 return p 1332 } 1333 1334 // New creates a new TouchCalibrationPairQuad in the application heap. 1335 func (p TouchCalibrationPairQuad) New() js.Ref { 1336 return bindings.TouchCalibrationPairQuadJSLoad( 1337 js.Pointer(&p), js.True, 0, 1338 ) 1339 } 1340 1341 // UpdateFrom copies value of all fields of the heap object to p. 1342 func (p *TouchCalibrationPairQuad) UpdateFrom(ref js.Ref) { 1343 bindings.TouchCalibrationPairQuadJSStore( 1344 js.Pointer(p), ref, 1345 ) 1346 } 1347 1348 // Update writes all fields of the p to the heap object referenced by ref. 1349 func (p *TouchCalibrationPairQuad) Update(ref js.Ref) { 1350 bindings.TouchCalibrationPairQuadJSLoad( 1351 js.Pointer(p), js.False, ref, 1352 ) 1353 } 1354 1355 // FreeMembers frees fields with heap reference, if recursive is true 1356 // free all heap references reachable from p. 1357 func (p *TouchCalibrationPairQuad) FreeMembers(recursive bool) { 1358 if recursive { 1359 p.Pair1.FreeMembers(true) 1360 p.Pair2.FreeMembers(true) 1361 p.Pair3.FreeMembers(true) 1362 p.Pair4.FreeMembers(true) 1363 } 1364 } 1365 1366 // HasFuncClearTouchCalibration returns true if the function "WEBEXT.system.display.clearTouchCalibration" exists. 1367 func HasFuncClearTouchCalibration() bool { 1368 return js.True == bindings.HasFuncClearTouchCalibration() 1369 } 1370 1371 // FuncClearTouchCalibration returns the function "WEBEXT.system.display.clearTouchCalibration". 1372 func FuncClearTouchCalibration() (fn js.Func[func(id js.String)]) { 1373 bindings.FuncClearTouchCalibration( 1374 js.Pointer(&fn), 1375 ) 1376 return 1377 } 1378 1379 // ClearTouchCalibration calls the function "WEBEXT.system.display.clearTouchCalibration" directly. 1380 func ClearTouchCalibration(id js.String) (ret js.Void) { 1381 bindings.CallClearTouchCalibration( 1382 js.Pointer(&ret), 1383 id.Ref(), 1384 ) 1385 1386 return 1387 } 1388 1389 // TryClearTouchCalibration calls the function "WEBEXT.system.display.clearTouchCalibration" 1390 // in a try/catch block and returns (_, err, ok = false) when it went through 1391 // the catch clause. 1392 func TryClearTouchCalibration(id js.String) (ret js.Void, exception js.Any, ok bool) { 1393 ok = js.True == bindings.TryClearTouchCalibration( 1394 js.Pointer(&ret), js.Pointer(&exception), 1395 id.Ref(), 1396 ) 1397 1398 return 1399 } 1400 1401 // HasFuncCompleteCustomTouchCalibration returns true if the function "WEBEXT.system.display.completeCustomTouchCalibration" exists. 1402 func HasFuncCompleteCustomTouchCalibration() bool { 1403 return js.True == bindings.HasFuncCompleteCustomTouchCalibration() 1404 } 1405 1406 // FuncCompleteCustomTouchCalibration returns the function "WEBEXT.system.display.completeCustomTouchCalibration". 1407 func FuncCompleteCustomTouchCalibration() (fn js.Func[func(pairs TouchCalibrationPairQuad, bounds Bounds)]) { 1408 bindings.FuncCompleteCustomTouchCalibration( 1409 js.Pointer(&fn), 1410 ) 1411 return 1412 } 1413 1414 // CompleteCustomTouchCalibration calls the function "WEBEXT.system.display.completeCustomTouchCalibration" directly. 1415 func CompleteCustomTouchCalibration(pairs TouchCalibrationPairQuad, bounds Bounds) (ret js.Void) { 1416 bindings.CallCompleteCustomTouchCalibration( 1417 js.Pointer(&ret), 1418 js.Pointer(&pairs), 1419 js.Pointer(&bounds), 1420 ) 1421 1422 return 1423 } 1424 1425 // TryCompleteCustomTouchCalibration calls the function "WEBEXT.system.display.completeCustomTouchCalibration" 1426 // in a try/catch block and returns (_, err, ok = false) when it went through 1427 // the catch clause. 1428 func TryCompleteCustomTouchCalibration(pairs TouchCalibrationPairQuad, bounds Bounds) (ret js.Void, exception js.Any, ok bool) { 1429 ok = js.True == bindings.TryCompleteCustomTouchCalibration( 1430 js.Pointer(&ret), js.Pointer(&exception), 1431 js.Pointer(&pairs), 1432 js.Pointer(&bounds), 1433 ) 1434 1435 return 1436 } 1437 1438 // HasFuncEnableUnifiedDesktop returns true if the function "WEBEXT.system.display.enableUnifiedDesktop" exists. 1439 func HasFuncEnableUnifiedDesktop() bool { 1440 return js.True == bindings.HasFuncEnableUnifiedDesktop() 1441 } 1442 1443 // FuncEnableUnifiedDesktop returns the function "WEBEXT.system.display.enableUnifiedDesktop". 1444 func FuncEnableUnifiedDesktop() (fn js.Func[func(enabled bool)]) { 1445 bindings.FuncEnableUnifiedDesktop( 1446 js.Pointer(&fn), 1447 ) 1448 return 1449 } 1450 1451 // EnableUnifiedDesktop calls the function "WEBEXT.system.display.enableUnifiedDesktop" directly. 1452 func EnableUnifiedDesktop(enabled bool) (ret js.Void) { 1453 bindings.CallEnableUnifiedDesktop( 1454 js.Pointer(&ret), 1455 js.Bool(bool(enabled)), 1456 ) 1457 1458 return 1459 } 1460 1461 // TryEnableUnifiedDesktop calls the function "WEBEXT.system.display.enableUnifiedDesktop" 1462 // in a try/catch block and returns (_, err, ok = false) when it went through 1463 // the catch clause. 1464 func TryEnableUnifiedDesktop(enabled bool) (ret js.Void, exception js.Any, ok bool) { 1465 ok = js.True == bindings.TryEnableUnifiedDesktop( 1466 js.Pointer(&ret), js.Pointer(&exception), 1467 js.Bool(bool(enabled)), 1468 ) 1469 1470 return 1471 } 1472 1473 // HasFuncGetDisplayLayout returns true if the function "WEBEXT.system.display.getDisplayLayout" exists. 1474 func HasFuncGetDisplayLayout() bool { 1475 return js.True == bindings.HasFuncGetDisplayLayout() 1476 } 1477 1478 // FuncGetDisplayLayout returns the function "WEBEXT.system.display.getDisplayLayout". 1479 func FuncGetDisplayLayout() (fn js.Func[func() js.Promise[js.Array[DisplayLayout]]]) { 1480 bindings.FuncGetDisplayLayout( 1481 js.Pointer(&fn), 1482 ) 1483 return 1484 } 1485 1486 // GetDisplayLayout calls the function "WEBEXT.system.display.getDisplayLayout" directly. 1487 func GetDisplayLayout() (ret js.Promise[js.Array[DisplayLayout]]) { 1488 bindings.CallGetDisplayLayout( 1489 js.Pointer(&ret), 1490 ) 1491 1492 return 1493 } 1494 1495 // TryGetDisplayLayout calls the function "WEBEXT.system.display.getDisplayLayout" 1496 // in a try/catch block and returns (_, err, ok = false) when it went through 1497 // the catch clause. 1498 func TryGetDisplayLayout() (ret js.Promise[js.Array[DisplayLayout]], exception js.Any, ok bool) { 1499 ok = js.True == bindings.TryGetDisplayLayout( 1500 js.Pointer(&ret), js.Pointer(&exception), 1501 ) 1502 1503 return 1504 } 1505 1506 // HasFuncGetInfo returns true if the function "WEBEXT.system.display.getInfo" exists. 1507 func HasFuncGetInfo() bool { 1508 return js.True == bindings.HasFuncGetInfo() 1509 } 1510 1511 // FuncGetInfo returns the function "WEBEXT.system.display.getInfo". 1512 func FuncGetInfo() (fn js.Func[func(flags GetInfoFlags) js.Promise[js.Array[DisplayUnitInfo]]]) { 1513 bindings.FuncGetInfo( 1514 js.Pointer(&fn), 1515 ) 1516 return 1517 } 1518 1519 // GetInfo calls the function "WEBEXT.system.display.getInfo" directly. 1520 func GetInfo(flags GetInfoFlags) (ret js.Promise[js.Array[DisplayUnitInfo]]) { 1521 bindings.CallGetInfo( 1522 js.Pointer(&ret), 1523 js.Pointer(&flags), 1524 ) 1525 1526 return 1527 } 1528 1529 // TryGetInfo calls the function "WEBEXT.system.display.getInfo" 1530 // in a try/catch block and returns (_, err, ok = false) when it went through 1531 // the catch clause. 1532 func TryGetInfo(flags GetInfoFlags) (ret js.Promise[js.Array[DisplayUnitInfo]], exception js.Any, ok bool) { 1533 ok = js.True == bindings.TryGetInfo( 1534 js.Pointer(&ret), js.Pointer(&exception), 1535 js.Pointer(&flags), 1536 ) 1537 1538 return 1539 } 1540 1541 type OnDisplayChangedEventCallbackFunc func(this js.Ref) js.Ref 1542 1543 func (fn OnDisplayChangedEventCallbackFunc) Register() js.Func[func()] { 1544 return js.RegisterCallback[func()]( 1545 fn, abi.FuncPCABIInternal(fn), 1546 ) 1547 } 1548 1549 func (fn OnDisplayChangedEventCallbackFunc) DispatchCallback( 1550 targetPC uintptr, ctx *js.CallbackContext, 1551 ) { 1552 args := ctx.Args() 1553 if len(args) != 0+1 /* js this */ || 1554 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1555 js.ThrowInvalidCallbackInvocation() 1556 } 1557 1558 if ctx.Return(fn( 1559 args[0], 1560 )) { 1561 return 1562 } 1563 1564 js.ThrowCallbackValueNotReturned() 1565 } 1566 1567 type OnDisplayChangedEventCallback[T any] struct { 1568 Fn func(arg T, this js.Ref) js.Ref 1569 Arg T 1570 } 1571 1572 func (cb *OnDisplayChangedEventCallback[T]) Register() js.Func[func()] { 1573 return js.RegisterCallback[func()]( 1574 cb, abi.FuncPCABIInternal(cb.Fn), 1575 ) 1576 } 1577 1578 func (cb *OnDisplayChangedEventCallback[T]) DispatchCallback( 1579 targetPC uintptr, ctx *js.CallbackContext, 1580 ) { 1581 args := ctx.Args() 1582 if len(args) != 0+1 /* js this */ || 1583 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1584 js.ThrowInvalidCallbackInvocation() 1585 } 1586 1587 if ctx.Return(cb.Fn( 1588 cb.Arg, 1589 args[0], 1590 )) { 1591 return 1592 } 1593 1594 js.ThrowCallbackValueNotReturned() 1595 } 1596 1597 // HasFuncOnDisplayChanged returns true if the function "WEBEXT.system.display.onDisplayChanged.addListener" exists. 1598 func HasFuncOnDisplayChanged() bool { 1599 return js.True == bindings.HasFuncOnDisplayChanged() 1600 } 1601 1602 // FuncOnDisplayChanged returns the function "WEBEXT.system.display.onDisplayChanged.addListener". 1603 func FuncOnDisplayChanged() (fn js.Func[func(callback js.Func[func()])]) { 1604 bindings.FuncOnDisplayChanged( 1605 js.Pointer(&fn), 1606 ) 1607 return 1608 } 1609 1610 // OnDisplayChanged calls the function "WEBEXT.system.display.onDisplayChanged.addListener" directly. 1611 func OnDisplayChanged(callback js.Func[func()]) (ret js.Void) { 1612 bindings.CallOnDisplayChanged( 1613 js.Pointer(&ret), 1614 callback.Ref(), 1615 ) 1616 1617 return 1618 } 1619 1620 // TryOnDisplayChanged calls the function "WEBEXT.system.display.onDisplayChanged.addListener" 1621 // in a try/catch block and returns (_, err, ok = false) when it went through 1622 // the catch clause. 1623 func TryOnDisplayChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 1624 ok = js.True == bindings.TryOnDisplayChanged( 1625 js.Pointer(&ret), js.Pointer(&exception), 1626 callback.Ref(), 1627 ) 1628 1629 return 1630 } 1631 1632 // HasFuncOffDisplayChanged returns true if the function "WEBEXT.system.display.onDisplayChanged.removeListener" exists. 1633 func HasFuncOffDisplayChanged() bool { 1634 return js.True == bindings.HasFuncOffDisplayChanged() 1635 } 1636 1637 // FuncOffDisplayChanged returns the function "WEBEXT.system.display.onDisplayChanged.removeListener". 1638 func FuncOffDisplayChanged() (fn js.Func[func(callback js.Func[func()])]) { 1639 bindings.FuncOffDisplayChanged( 1640 js.Pointer(&fn), 1641 ) 1642 return 1643 } 1644 1645 // OffDisplayChanged calls the function "WEBEXT.system.display.onDisplayChanged.removeListener" directly. 1646 func OffDisplayChanged(callback js.Func[func()]) (ret js.Void) { 1647 bindings.CallOffDisplayChanged( 1648 js.Pointer(&ret), 1649 callback.Ref(), 1650 ) 1651 1652 return 1653 } 1654 1655 // TryOffDisplayChanged calls the function "WEBEXT.system.display.onDisplayChanged.removeListener" 1656 // in a try/catch block and returns (_, err, ok = false) when it went through 1657 // the catch clause. 1658 func TryOffDisplayChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 1659 ok = js.True == bindings.TryOffDisplayChanged( 1660 js.Pointer(&ret), js.Pointer(&exception), 1661 callback.Ref(), 1662 ) 1663 1664 return 1665 } 1666 1667 // HasFuncHasOnDisplayChanged returns true if the function "WEBEXT.system.display.onDisplayChanged.hasListener" exists. 1668 func HasFuncHasOnDisplayChanged() bool { 1669 return js.True == bindings.HasFuncHasOnDisplayChanged() 1670 } 1671 1672 // FuncHasOnDisplayChanged returns the function "WEBEXT.system.display.onDisplayChanged.hasListener". 1673 func FuncHasOnDisplayChanged() (fn js.Func[func(callback js.Func[func()]) bool]) { 1674 bindings.FuncHasOnDisplayChanged( 1675 js.Pointer(&fn), 1676 ) 1677 return 1678 } 1679 1680 // HasOnDisplayChanged calls the function "WEBEXT.system.display.onDisplayChanged.hasListener" directly. 1681 func HasOnDisplayChanged(callback js.Func[func()]) (ret bool) { 1682 bindings.CallHasOnDisplayChanged( 1683 js.Pointer(&ret), 1684 callback.Ref(), 1685 ) 1686 1687 return 1688 } 1689 1690 // TryHasOnDisplayChanged calls the function "WEBEXT.system.display.onDisplayChanged.hasListener" 1691 // in a try/catch block and returns (_, err, ok = false) when it went through 1692 // the catch clause. 1693 func TryHasOnDisplayChanged(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 1694 ok = js.True == bindings.TryHasOnDisplayChanged( 1695 js.Pointer(&ret), js.Pointer(&exception), 1696 callback.Ref(), 1697 ) 1698 1699 return 1700 } 1701 1702 // HasFuncOverscanCalibrationAdjust returns true if the function "WEBEXT.system.display.overscanCalibrationAdjust" exists. 1703 func HasFuncOverscanCalibrationAdjust() bool { 1704 return js.True == bindings.HasFuncOverscanCalibrationAdjust() 1705 } 1706 1707 // FuncOverscanCalibrationAdjust returns the function "WEBEXT.system.display.overscanCalibrationAdjust". 1708 func FuncOverscanCalibrationAdjust() (fn js.Func[func(id js.String, delta Insets)]) { 1709 bindings.FuncOverscanCalibrationAdjust( 1710 js.Pointer(&fn), 1711 ) 1712 return 1713 } 1714 1715 // OverscanCalibrationAdjust calls the function "WEBEXT.system.display.overscanCalibrationAdjust" directly. 1716 func OverscanCalibrationAdjust(id js.String, delta Insets) (ret js.Void) { 1717 bindings.CallOverscanCalibrationAdjust( 1718 js.Pointer(&ret), 1719 id.Ref(), 1720 js.Pointer(&delta), 1721 ) 1722 1723 return 1724 } 1725 1726 // TryOverscanCalibrationAdjust calls the function "WEBEXT.system.display.overscanCalibrationAdjust" 1727 // in a try/catch block and returns (_, err, ok = false) when it went through 1728 // the catch clause. 1729 func TryOverscanCalibrationAdjust(id js.String, delta Insets) (ret js.Void, exception js.Any, ok bool) { 1730 ok = js.True == bindings.TryOverscanCalibrationAdjust( 1731 js.Pointer(&ret), js.Pointer(&exception), 1732 id.Ref(), 1733 js.Pointer(&delta), 1734 ) 1735 1736 return 1737 } 1738 1739 // HasFuncOverscanCalibrationComplete returns true if the function "WEBEXT.system.display.overscanCalibrationComplete" exists. 1740 func HasFuncOverscanCalibrationComplete() bool { 1741 return js.True == bindings.HasFuncOverscanCalibrationComplete() 1742 } 1743 1744 // FuncOverscanCalibrationComplete returns the function "WEBEXT.system.display.overscanCalibrationComplete". 1745 func FuncOverscanCalibrationComplete() (fn js.Func[func(id js.String)]) { 1746 bindings.FuncOverscanCalibrationComplete( 1747 js.Pointer(&fn), 1748 ) 1749 return 1750 } 1751 1752 // OverscanCalibrationComplete calls the function "WEBEXT.system.display.overscanCalibrationComplete" directly. 1753 func OverscanCalibrationComplete(id js.String) (ret js.Void) { 1754 bindings.CallOverscanCalibrationComplete( 1755 js.Pointer(&ret), 1756 id.Ref(), 1757 ) 1758 1759 return 1760 } 1761 1762 // TryOverscanCalibrationComplete calls the function "WEBEXT.system.display.overscanCalibrationComplete" 1763 // in a try/catch block and returns (_, err, ok = false) when it went through 1764 // the catch clause. 1765 func TryOverscanCalibrationComplete(id js.String) (ret js.Void, exception js.Any, ok bool) { 1766 ok = js.True == bindings.TryOverscanCalibrationComplete( 1767 js.Pointer(&ret), js.Pointer(&exception), 1768 id.Ref(), 1769 ) 1770 1771 return 1772 } 1773 1774 // HasFuncOverscanCalibrationReset returns true if the function "WEBEXT.system.display.overscanCalibrationReset" exists. 1775 func HasFuncOverscanCalibrationReset() bool { 1776 return js.True == bindings.HasFuncOverscanCalibrationReset() 1777 } 1778 1779 // FuncOverscanCalibrationReset returns the function "WEBEXT.system.display.overscanCalibrationReset". 1780 func FuncOverscanCalibrationReset() (fn js.Func[func(id js.String)]) { 1781 bindings.FuncOverscanCalibrationReset( 1782 js.Pointer(&fn), 1783 ) 1784 return 1785 } 1786 1787 // OverscanCalibrationReset calls the function "WEBEXT.system.display.overscanCalibrationReset" directly. 1788 func OverscanCalibrationReset(id js.String) (ret js.Void) { 1789 bindings.CallOverscanCalibrationReset( 1790 js.Pointer(&ret), 1791 id.Ref(), 1792 ) 1793 1794 return 1795 } 1796 1797 // TryOverscanCalibrationReset calls the function "WEBEXT.system.display.overscanCalibrationReset" 1798 // in a try/catch block and returns (_, err, ok = false) when it went through 1799 // the catch clause. 1800 func TryOverscanCalibrationReset(id js.String) (ret js.Void, exception js.Any, ok bool) { 1801 ok = js.True == bindings.TryOverscanCalibrationReset( 1802 js.Pointer(&ret), js.Pointer(&exception), 1803 id.Ref(), 1804 ) 1805 1806 return 1807 } 1808 1809 // HasFuncOverscanCalibrationStart returns true if the function "WEBEXT.system.display.overscanCalibrationStart" exists. 1810 func HasFuncOverscanCalibrationStart() bool { 1811 return js.True == bindings.HasFuncOverscanCalibrationStart() 1812 } 1813 1814 // FuncOverscanCalibrationStart returns the function "WEBEXT.system.display.overscanCalibrationStart". 1815 func FuncOverscanCalibrationStart() (fn js.Func[func(id js.String)]) { 1816 bindings.FuncOverscanCalibrationStart( 1817 js.Pointer(&fn), 1818 ) 1819 return 1820 } 1821 1822 // OverscanCalibrationStart calls the function "WEBEXT.system.display.overscanCalibrationStart" directly. 1823 func OverscanCalibrationStart(id js.String) (ret js.Void) { 1824 bindings.CallOverscanCalibrationStart( 1825 js.Pointer(&ret), 1826 id.Ref(), 1827 ) 1828 1829 return 1830 } 1831 1832 // TryOverscanCalibrationStart calls the function "WEBEXT.system.display.overscanCalibrationStart" 1833 // in a try/catch block and returns (_, err, ok = false) when it went through 1834 // the catch clause. 1835 func TryOverscanCalibrationStart(id js.String) (ret js.Void, exception js.Any, ok bool) { 1836 ok = js.True == bindings.TryOverscanCalibrationStart( 1837 js.Pointer(&ret), js.Pointer(&exception), 1838 id.Ref(), 1839 ) 1840 1841 return 1842 } 1843 1844 // HasFuncSetDisplayLayout returns true if the function "WEBEXT.system.display.setDisplayLayout" exists. 1845 func HasFuncSetDisplayLayout() bool { 1846 return js.True == bindings.HasFuncSetDisplayLayout() 1847 } 1848 1849 // FuncSetDisplayLayout returns the function "WEBEXT.system.display.setDisplayLayout". 1850 func FuncSetDisplayLayout() (fn js.Func[func(layouts js.Array[DisplayLayout]) js.Promise[js.Void]]) { 1851 bindings.FuncSetDisplayLayout( 1852 js.Pointer(&fn), 1853 ) 1854 return 1855 } 1856 1857 // SetDisplayLayout calls the function "WEBEXT.system.display.setDisplayLayout" directly. 1858 func SetDisplayLayout(layouts js.Array[DisplayLayout]) (ret js.Promise[js.Void]) { 1859 bindings.CallSetDisplayLayout( 1860 js.Pointer(&ret), 1861 layouts.Ref(), 1862 ) 1863 1864 return 1865 } 1866 1867 // TrySetDisplayLayout calls the function "WEBEXT.system.display.setDisplayLayout" 1868 // in a try/catch block and returns (_, err, ok = false) when it went through 1869 // the catch clause. 1870 func TrySetDisplayLayout(layouts js.Array[DisplayLayout]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1871 ok = js.True == bindings.TrySetDisplayLayout( 1872 js.Pointer(&ret), js.Pointer(&exception), 1873 layouts.Ref(), 1874 ) 1875 1876 return 1877 } 1878 1879 // HasFuncSetDisplayProperties returns true if the function "WEBEXT.system.display.setDisplayProperties" exists. 1880 func HasFuncSetDisplayProperties() bool { 1881 return js.True == bindings.HasFuncSetDisplayProperties() 1882 } 1883 1884 // FuncSetDisplayProperties returns the function "WEBEXT.system.display.setDisplayProperties". 1885 func FuncSetDisplayProperties() (fn js.Func[func(id js.String, info DisplayProperties) js.Promise[js.Void]]) { 1886 bindings.FuncSetDisplayProperties( 1887 js.Pointer(&fn), 1888 ) 1889 return 1890 } 1891 1892 // SetDisplayProperties calls the function "WEBEXT.system.display.setDisplayProperties" directly. 1893 func SetDisplayProperties(id js.String, info DisplayProperties) (ret js.Promise[js.Void]) { 1894 bindings.CallSetDisplayProperties( 1895 js.Pointer(&ret), 1896 id.Ref(), 1897 js.Pointer(&info), 1898 ) 1899 1900 return 1901 } 1902 1903 // TrySetDisplayProperties calls the function "WEBEXT.system.display.setDisplayProperties" 1904 // in a try/catch block and returns (_, err, ok = false) when it went through 1905 // the catch clause. 1906 func TrySetDisplayProperties(id js.String, info DisplayProperties) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1907 ok = js.True == bindings.TrySetDisplayProperties( 1908 js.Pointer(&ret), js.Pointer(&exception), 1909 id.Ref(), 1910 js.Pointer(&info), 1911 ) 1912 1913 return 1914 } 1915 1916 // HasFuncSetMirrorMode returns true if the function "WEBEXT.system.display.setMirrorMode" exists. 1917 func HasFuncSetMirrorMode() bool { 1918 return js.True == bindings.HasFuncSetMirrorMode() 1919 } 1920 1921 // FuncSetMirrorMode returns the function "WEBEXT.system.display.setMirrorMode". 1922 func FuncSetMirrorMode() (fn js.Func[func(info MirrorModeInfo) js.Promise[js.Void]]) { 1923 bindings.FuncSetMirrorMode( 1924 js.Pointer(&fn), 1925 ) 1926 return 1927 } 1928 1929 // SetMirrorMode calls the function "WEBEXT.system.display.setMirrorMode" directly. 1930 func SetMirrorMode(info MirrorModeInfo) (ret js.Promise[js.Void]) { 1931 bindings.CallSetMirrorMode( 1932 js.Pointer(&ret), 1933 js.Pointer(&info), 1934 ) 1935 1936 return 1937 } 1938 1939 // TrySetMirrorMode calls the function "WEBEXT.system.display.setMirrorMode" 1940 // in a try/catch block and returns (_, err, ok = false) when it went through 1941 // the catch clause. 1942 func TrySetMirrorMode(info MirrorModeInfo) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1943 ok = js.True == bindings.TrySetMirrorMode( 1944 js.Pointer(&ret), js.Pointer(&exception), 1945 js.Pointer(&info), 1946 ) 1947 1948 return 1949 } 1950 1951 // HasFuncShowNativeTouchCalibration returns true if the function "WEBEXT.system.display.showNativeTouchCalibration" exists. 1952 func HasFuncShowNativeTouchCalibration() bool { 1953 return js.True == bindings.HasFuncShowNativeTouchCalibration() 1954 } 1955 1956 // FuncShowNativeTouchCalibration returns the function "WEBEXT.system.display.showNativeTouchCalibration". 1957 func FuncShowNativeTouchCalibration() (fn js.Func[func(id js.String) js.Promise[js.Boolean]]) { 1958 bindings.FuncShowNativeTouchCalibration( 1959 js.Pointer(&fn), 1960 ) 1961 return 1962 } 1963 1964 // ShowNativeTouchCalibration calls the function "WEBEXT.system.display.showNativeTouchCalibration" directly. 1965 func ShowNativeTouchCalibration(id js.String) (ret js.Promise[js.Boolean]) { 1966 bindings.CallShowNativeTouchCalibration( 1967 js.Pointer(&ret), 1968 id.Ref(), 1969 ) 1970 1971 return 1972 } 1973 1974 // TryShowNativeTouchCalibration calls the function "WEBEXT.system.display.showNativeTouchCalibration" 1975 // in a try/catch block and returns (_, err, ok = false) when it went through 1976 // the catch clause. 1977 func TryShowNativeTouchCalibration(id js.String) (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 1978 ok = js.True == bindings.TryShowNativeTouchCalibration( 1979 js.Pointer(&ret), js.Pointer(&exception), 1980 id.Ref(), 1981 ) 1982 1983 return 1984 } 1985 1986 // HasFuncStartCustomTouchCalibration returns true if the function "WEBEXT.system.display.startCustomTouchCalibration" exists. 1987 func HasFuncStartCustomTouchCalibration() bool { 1988 return js.True == bindings.HasFuncStartCustomTouchCalibration() 1989 } 1990 1991 // FuncStartCustomTouchCalibration returns the function "WEBEXT.system.display.startCustomTouchCalibration". 1992 func FuncStartCustomTouchCalibration() (fn js.Func[func(id js.String)]) { 1993 bindings.FuncStartCustomTouchCalibration( 1994 js.Pointer(&fn), 1995 ) 1996 return 1997 } 1998 1999 // StartCustomTouchCalibration calls the function "WEBEXT.system.display.startCustomTouchCalibration" directly. 2000 func StartCustomTouchCalibration(id js.String) (ret js.Void) { 2001 bindings.CallStartCustomTouchCalibration( 2002 js.Pointer(&ret), 2003 id.Ref(), 2004 ) 2005 2006 return 2007 } 2008 2009 // TryStartCustomTouchCalibration calls the function "WEBEXT.system.display.startCustomTouchCalibration" 2010 // in a try/catch block and returns (_, err, ok = false) when it went through 2011 // the catch clause. 2012 func TryStartCustomTouchCalibration(id js.String) (ret js.Void, exception js.Any, ok bool) { 2013 ok = js.True == bindings.TryStartCustomTouchCalibration( 2014 js.Pointer(&ret), js.Pointer(&exception), 2015 id.Ref(), 2016 ) 2017 2018 return 2019 }