github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/app/currentwindowinternal/bindings/ffi_bindings.ts (about)

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/app/currentwindowinternal", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "store_Bounds": (ptr: Pointer, ref: heap.Ref<any>) => {
     8        const x = A.H.get<any>(ref);
     9  
    10        if (typeof x === "undefined") {
    11          A.store.Bool(ptr + 20, false);
    12          A.store.Bool(ptr + 16, false);
    13          A.store.Int32(ptr + 0, 0);
    14          A.store.Bool(ptr + 17, false);
    15          A.store.Int32(ptr + 4, 0);
    16          A.store.Bool(ptr + 18, false);
    17          A.store.Int32(ptr + 8, 0);
    18          A.store.Bool(ptr + 19, false);
    19          A.store.Int32(ptr + 12, 0);
    20        } else {
    21          A.store.Bool(ptr + 20, true);
    22          A.store.Bool(ptr + 16, "left" in x ? true : false);
    23          A.store.Int32(ptr + 0, x["left"] === undefined ? 0 : (x["left"] as number));
    24          A.store.Bool(ptr + 17, "top" in x ? true : false);
    25          A.store.Int32(ptr + 4, x["top"] === undefined ? 0 : (x["top"] as number));
    26          A.store.Bool(ptr + 18, "width" in x ? true : false);
    27          A.store.Int32(ptr + 8, x["width"] === undefined ? 0 : (x["width"] as number));
    28          A.store.Bool(ptr + 19, "height" in x ? true : false);
    29          A.store.Int32(ptr + 12, x["height"] === undefined ? 0 : (x["height"] as number));
    30        }
    31      },
    32      "load_Bounds": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    33        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    34  
    35        if (A.load.Bool(ptr + 16)) {
    36          x["left"] = A.load.Int32(ptr + 0);
    37        } else {
    38          delete x["left"];
    39        }
    40        if (A.load.Bool(ptr + 17)) {
    41          x["top"] = A.load.Int32(ptr + 4);
    42        } else {
    43          delete x["top"];
    44        }
    45        if (A.load.Bool(ptr + 18)) {
    46          x["width"] = A.load.Int32(ptr + 8);
    47        } else {
    48          delete x["width"];
    49        }
    50        if (A.load.Bool(ptr + 19)) {
    51          x["height"] = A.load.Int32(ptr + 12);
    52        } else {
    53          delete x["height"];
    54        }
    55        return create === A.H.TRUE ? A.H.push(x) : ref;
    56      },
    57  
    58      "store_RegionRect": (ptr: Pointer, ref: heap.Ref<any>) => {
    59        const x = A.H.get<any>(ref);
    60  
    61        if (typeof x === "undefined") {
    62          A.store.Bool(ptr + 20, false);
    63          A.store.Bool(ptr + 16, false);
    64          A.store.Int32(ptr + 0, 0);
    65          A.store.Bool(ptr + 17, false);
    66          A.store.Int32(ptr + 4, 0);
    67          A.store.Bool(ptr + 18, false);
    68          A.store.Int32(ptr + 8, 0);
    69          A.store.Bool(ptr + 19, false);
    70          A.store.Int32(ptr + 12, 0);
    71        } else {
    72          A.store.Bool(ptr + 20, true);
    73          A.store.Bool(ptr + 16, "left" in x ? true : false);
    74          A.store.Int32(ptr + 0, x["left"] === undefined ? 0 : (x["left"] as number));
    75          A.store.Bool(ptr + 17, "top" in x ? true : false);
    76          A.store.Int32(ptr + 4, x["top"] === undefined ? 0 : (x["top"] as number));
    77          A.store.Bool(ptr + 18, "width" in x ? true : false);
    78          A.store.Int32(ptr + 8, x["width"] === undefined ? 0 : (x["width"] as number));
    79          A.store.Bool(ptr + 19, "height" in x ? true : false);
    80          A.store.Int32(ptr + 12, x["height"] === undefined ? 0 : (x["height"] as number));
    81        }
    82      },
    83      "load_RegionRect": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    84        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    85  
    86        if (A.load.Bool(ptr + 16)) {
    87          x["left"] = A.load.Int32(ptr + 0);
    88        } else {
    89          delete x["left"];
    90        }
    91        if (A.load.Bool(ptr + 17)) {
    92          x["top"] = A.load.Int32(ptr + 4);
    93        } else {
    94          delete x["top"];
    95        }
    96        if (A.load.Bool(ptr + 18)) {
    97          x["width"] = A.load.Int32(ptr + 8);
    98        } else {
    99          delete x["width"];
   100        }
   101        if (A.load.Bool(ptr + 19)) {
   102          x["height"] = A.load.Int32(ptr + 12);
   103        } else {
   104          delete x["height"];
   105        }
   106        return create === A.H.TRUE ? A.H.push(x) : ref;
   107      },
   108  
   109      "store_Region": (ptr: Pointer, ref: heap.Ref<any>) => {
   110        const x = A.H.get<any>(ref);
   111  
   112        if (typeof x === "undefined") {
   113          A.store.Bool(ptr + 4, false);
   114          A.store.Ref(ptr + 0, undefined);
   115        } else {
   116          A.store.Bool(ptr + 4, true);
   117          A.store.Ref(ptr + 0, x["rects"]);
   118        }
   119      },
   120      "load_Region": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   121        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   122  
   123        x["rects"] = A.load.Ref(ptr + 0, undefined);
   124        return create === A.H.TRUE ? A.H.push(x) : ref;
   125      },
   126  
   127      "store_SizeConstraints": (ptr: Pointer, ref: heap.Ref<any>) => {
   128        const x = A.H.get<any>(ref);
   129  
   130        if (typeof x === "undefined") {
   131          A.store.Bool(ptr + 20, false);
   132          A.store.Bool(ptr + 16, false);
   133          A.store.Int32(ptr + 0, 0);
   134          A.store.Bool(ptr + 17, false);
   135          A.store.Int32(ptr + 4, 0);
   136          A.store.Bool(ptr + 18, false);
   137          A.store.Int32(ptr + 8, 0);
   138          A.store.Bool(ptr + 19, false);
   139          A.store.Int32(ptr + 12, 0);
   140        } else {
   141          A.store.Bool(ptr + 20, true);
   142          A.store.Bool(ptr + 16, "minWidth" in x ? true : false);
   143          A.store.Int32(ptr + 0, x["minWidth"] === undefined ? 0 : (x["minWidth"] as number));
   144          A.store.Bool(ptr + 17, "minHeight" in x ? true : false);
   145          A.store.Int32(ptr + 4, x["minHeight"] === undefined ? 0 : (x["minHeight"] as number));
   146          A.store.Bool(ptr + 18, "maxWidth" in x ? true : false);
   147          A.store.Int32(ptr + 8, x["maxWidth"] === undefined ? 0 : (x["maxWidth"] as number));
   148          A.store.Bool(ptr + 19, "maxHeight" in x ? true : false);
   149          A.store.Int32(ptr + 12, x["maxHeight"] === undefined ? 0 : (x["maxHeight"] as number));
   150        }
   151      },
   152      "load_SizeConstraints": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   153        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   154  
   155        if (A.load.Bool(ptr + 16)) {
   156          x["minWidth"] = A.load.Int32(ptr + 0);
   157        } else {
   158          delete x["minWidth"];
   159        }
   160        if (A.load.Bool(ptr + 17)) {
   161          x["minHeight"] = A.load.Int32(ptr + 4);
   162        } else {
   163          delete x["minHeight"];
   164        }
   165        if (A.load.Bool(ptr + 18)) {
   166          x["maxWidth"] = A.load.Int32(ptr + 8);
   167        } else {
   168          delete x["maxWidth"];
   169        }
   170        if (A.load.Bool(ptr + 19)) {
   171          x["maxHeight"] = A.load.Int32(ptr + 12);
   172        } else {
   173          delete x["maxHeight"];
   174        }
   175        return create === A.H.TRUE ? A.H.push(x) : ref;
   176      },
   177      "has_ClearAttention": (): heap.Ref<boolean> => {
   178        if (WEBEXT?.app?.currentWindowInternal && "clearAttention" in WEBEXT?.app?.currentWindowInternal) {
   179          return A.H.TRUE;
   180        }
   181        return A.H.FALSE;
   182      },
   183      "func_ClearAttention": (fn: Pointer): void => {
   184        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.clearAttention);
   185      },
   186      "call_ClearAttention": (retPtr: Pointer): void => {
   187        const _ret = WEBEXT.app.currentWindowInternal.clearAttention();
   188      },
   189      "try_ClearAttention": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   190        try {
   191          const _ret = WEBEXT.app.currentWindowInternal.clearAttention();
   192          return A.H.TRUE;
   193        } catch (err: any) {
   194          A.store.Ref(errPtr, err);
   195          return A.H.FALSE;
   196        }
   197      },
   198      "has_DrawAttention": (): heap.Ref<boolean> => {
   199        if (WEBEXT?.app?.currentWindowInternal && "drawAttention" in WEBEXT?.app?.currentWindowInternal) {
   200          return A.H.TRUE;
   201        }
   202        return A.H.FALSE;
   203      },
   204      "func_DrawAttention": (fn: Pointer): void => {
   205        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.drawAttention);
   206      },
   207      "call_DrawAttention": (retPtr: Pointer): void => {
   208        const _ret = WEBEXT.app.currentWindowInternal.drawAttention();
   209      },
   210      "try_DrawAttention": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   211        try {
   212          const _ret = WEBEXT.app.currentWindowInternal.drawAttention();
   213          return A.H.TRUE;
   214        } catch (err: any) {
   215          A.store.Ref(errPtr, err);
   216          return A.H.FALSE;
   217        }
   218      },
   219      "has_Focus": (): heap.Ref<boolean> => {
   220        if (WEBEXT?.app?.currentWindowInternal && "focus" in WEBEXT?.app?.currentWindowInternal) {
   221          return A.H.TRUE;
   222        }
   223        return A.H.FALSE;
   224      },
   225      "func_Focus": (fn: Pointer): void => {
   226        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.focus);
   227      },
   228      "call_Focus": (retPtr: Pointer): void => {
   229        const _ret = WEBEXT.app.currentWindowInternal.focus();
   230      },
   231      "try_Focus": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   232        try {
   233          const _ret = WEBEXT.app.currentWindowInternal.focus();
   234          return A.H.TRUE;
   235        } catch (err: any) {
   236          A.store.Ref(errPtr, err);
   237          return A.H.FALSE;
   238        }
   239      },
   240      "has_Fullscreen": (): heap.Ref<boolean> => {
   241        if (WEBEXT?.app?.currentWindowInternal && "fullscreen" in WEBEXT?.app?.currentWindowInternal) {
   242          return A.H.TRUE;
   243        }
   244        return A.H.FALSE;
   245      },
   246      "func_Fullscreen": (fn: Pointer): void => {
   247        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.fullscreen);
   248      },
   249      "call_Fullscreen": (retPtr: Pointer): void => {
   250        const _ret = WEBEXT.app.currentWindowInternal.fullscreen();
   251      },
   252      "try_Fullscreen": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   253        try {
   254          const _ret = WEBEXT.app.currentWindowInternal.fullscreen();
   255          return A.H.TRUE;
   256        } catch (err: any) {
   257          A.store.Ref(errPtr, err);
   258          return A.H.FALSE;
   259        }
   260      },
   261      "has_Hide": (): heap.Ref<boolean> => {
   262        if (WEBEXT?.app?.currentWindowInternal && "hide" in WEBEXT?.app?.currentWindowInternal) {
   263          return A.H.TRUE;
   264        }
   265        return A.H.FALSE;
   266      },
   267      "func_Hide": (fn: Pointer): void => {
   268        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.hide);
   269      },
   270      "call_Hide": (retPtr: Pointer): void => {
   271        const _ret = WEBEXT.app.currentWindowInternal.hide();
   272      },
   273      "try_Hide": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   274        try {
   275          const _ret = WEBEXT.app.currentWindowInternal.hide();
   276          return A.H.TRUE;
   277        } catch (err: any) {
   278          A.store.Ref(errPtr, err);
   279          return A.H.FALSE;
   280        }
   281      },
   282      "has_Maximize": (): heap.Ref<boolean> => {
   283        if (WEBEXT?.app?.currentWindowInternal && "maximize" in WEBEXT?.app?.currentWindowInternal) {
   284          return A.H.TRUE;
   285        }
   286        return A.H.FALSE;
   287      },
   288      "func_Maximize": (fn: Pointer): void => {
   289        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.maximize);
   290      },
   291      "call_Maximize": (retPtr: Pointer): void => {
   292        const _ret = WEBEXT.app.currentWindowInternal.maximize();
   293      },
   294      "try_Maximize": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   295        try {
   296          const _ret = WEBEXT.app.currentWindowInternal.maximize();
   297          return A.H.TRUE;
   298        } catch (err: any) {
   299          A.store.Ref(errPtr, err);
   300          return A.H.FALSE;
   301        }
   302      },
   303      "has_Minimize": (): heap.Ref<boolean> => {
   304        if (WEBEXT?.app?.currentWindowInternal && "minimize" in WEBEXT?.app?.currentWindowInternal) {
   305          return A.H.TRUE;
   306        }
   307        return A.H.FALSE;
   308      },
   309      "func_Minimize": (fn: Pointer): void => {
   310        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.minimize);
   311      },
   312      "call_Minimize": (retPtr: Pointer): void => {
   313        const _ret = WEBEXT.app.currentWindowInternal.minimize();
   314      },
   315      "try_Minimize": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   316        try {
   317          const _ret = WEBEXT.app.currentWindowInternal.minimize();
   318          return A.H.TRUE;
   319        } catch (err: any) {
   320          A.store.Ref(errPtr, err);
   321          return A.H.FALSE;
   322        }
   323      },
   324      "has_OnAlphaEnabledChanged": (): heap.Ref<boolean> => {
   325        if (
   326          WEBEXT?.app?.currentWindowInternal?.onAlphaEnabledChanged &&
   327          "addListener" in WEBEXT?.app?.currentWindowInternal?.onAlphaEnabledChanged
   328        ) {
   329          return A.H.TRUE;
   330        }
   331        return A.H.FALSE;
   332      },
   333      "func_OnAlphaEnabledChanged": (fn: Pointer): void => {
   334        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.addListener);
   335      },
   336      "call_OnAlphaEnabledChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   337        const _ret = WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.addListener(A.H.get<object>(callback));
   338      },
   339      "try_OnAlphaEnabledChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   340        try {
   341          const _ret = WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.addListener(A.H.get<object>(callback));
   342          return A.H.TRUE;
   343        } catch (err: any) {
   344          A.store.Ref(errPtr, err);
   345          return A.H.FALSE;
   346        }
   347      },
   348      "has_OffAlphaEnabledChanged": (): heap.Ref<boolean> => {
   349        if (
   350          WEBEXT?.app?.currentWindowInternal?.onAlphaEnabledChanged &&
   351          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onAlphaEnabledChanged
   352        ) {
   353          return A.H.TRUE;
   354        }
   355        return A.H.FALSE;
   356      },
   357      "func_OffAlphaEnabledChanged": (fn: Pointer): void => {
   358        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.removeListener);
   359      },
   360      "call_OffAlphaEnabledChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   361        const _ret = WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.removeListener(A.H.get<object>(callback));
   362      },
   363      "try_OffAlphaEnabledChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   364        try {
   365          const _ret = WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.removeListener(A.H.get<object>(callback));
   366          return A.H.TRUE;
   367        } catch (err: any) {
   368          A.store.Ref(errPtr, err);
   369          return A.H.FALSE;
   370        }
   371      },
   372      "has_HasOnAlphaEnabledChanged": (): heap.Ref<boolean> => {
   373        if (
   374          WEBEXT?.app?.currentWindowInternal?.onAlphaEnabledChanged &&
   375          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onAlphaEnabledChanged
   376        ) {
   377          return A.H.TRUE;
   378        }
   379        return A.H.FALSE;
   380      },
   381      "func_HasOnAlphaEnabledChanged": (fn: Pointer): void => {
   382        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.hasListener);
   383      },
   384      "call_HasOnAlphaEnabledChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   385        const _ret = WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.hasListener(A.H.get<object>(callback));
   386        A.store.Bool(retPtr, _ret);
   387      },
   388      "try_HasOnAlphaEnabledChanged": (
   389        retPtr: Pointer,
   390        errPtr: Pointer,
   391        callback: heap.Ref<object>
   392      ): heap.Ref<boolean> => {
   393        try {
   394          const _ret = WEBEXT.app.currentWindowInternal.onAlphaEnabledChanged.hasListener(A.H.get<object>(callback));
   395          A.store.Bool(retPtr, _ret);
   396          return A.H.TRUE;
   397        } catch (err: any) {
   398          A.store.Ref(errPtr, err);
   399          return A.H.FALSE;
   400        }
   401      },
   402      "has_OnBoundsChanged": (): heap.Ref<boolean> => {
   403        if (
   404          WEBEXT?.app?.currentWindowInternal?.onBoundsChanged &&
   405          "addListener" in WEBEXT?.app?.currentWindowInternal?.onBoundsChanged
   406        ) {
   407          return A.H.TRUE;
   408        }
   409        return A.H.FALSE;
   410      },
   411      "func_OnBoundsChanged": (fn: Pointer): void => {
   412        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onBoundsChanged.addListener);
   413      },
   414      "call_OnBoundsChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   415        const _ret = WEBEXT.app.currentWindowInternal.onBoundsChanged.addListener(A.H.get<object>(callback));
   416      },
   417      "try_OnBoundsChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   418        try {
   419          const _ret = WEBEXT.app.currentWindowInternal.onBoundsChanged.addListener(A.H.get<object>(callback));
   420          return A.H.TRUE;
   421        } catch (err: any) {
   422          A.store.Ref(errPtr, err);
   423          return A.H.FALSE;
   424        }
   425      },
   426      "has_OffBoundsChanged": (): heap.Ref<boolean> => {
   427        if (
   428          WEBEXT?.app?.currentWindowInternal?.onBoundsChanged &&
   429          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onBoundsChanged
   430        ) {
   431          return A.H.TRUE;
   432        }
   433        return A.H.FALSE;
   434      },
   435      "func_OffBoundsChanged": (fn: Pointer): void => {
   436        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onBoundsChanged.removeListener);
   437      },
   438      "call_OffBoundsChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   439        const _ret = WEBEXT.app.currentWindowInternal.onBoundsChanged.removeListener(A.H.get<object>(callback));
   440      },
   441      "try_OffBoundsChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   442        try {
   443          const _ret = WEBEXT.app.currentWindowInternal.onBoundsChanged.removeListener(A.H.get<object>(callback));
   444          return A.H.TRUE;
   445        } catch (err: any) {
   446          A.store.Ref(errPtr, err);
   447          return A.H.FALSE;
   448        }
   449      },
   450      "has_HasOnBoundsChanged": (): heap.Ref<boolean> => {
   451        if (
   452          WEBEXT?.app?.currentWindowInternal?.onBoundsChanged &&
   453          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onBoundsChanged
   454        ) {
   455          return A.H.TRUE;
   456        }
   457        return A.H.FALSE;
   458      },
   459      "func_HasOnBoundsChanged": (fn: Pointer): void => {
   460        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onBoundsChanged.hasListener);
   461      },
   462      "call_HasOnBoundsChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   463        const _ret = WEBEXT.app.currentWindowInternal.onBoundsChanged.hasListener(A.H.get<object>(callback));
   464        A.store.Bool(retPtr, _ret);
   465      },
   466      "try_HasOnBoundsChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   467        try {
   468          const _ret = WEBEXT.app.currentWindowInternal.onBoundsChanged.hasListener(A.H.get<object>(callback));
   469          A.store.Bool(retPtr, _ret);
   470          return A.H.TRUE;
   471        } catch (err: any) {
   472          A.store.Ref(errPtr, err);
   473          return A.H.FALSE;
   474        }
   475      },
   476      "has_OnClosed": (): heap.Ref<boolean> => {
   477        if (
   478          WEBEXT?.app?.currentWindowInternal?.onClosed &&
   479          "addListener" in WEBEXT?.app?.currentWindowInternal?.onClosed
   480        ) {
   481          return A.H.TRUE;
   482        }
   483        return A.H.FALSE;
   484      },
   485      "func_OnClosed": (fn: Pointer): void => {
   486        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onClosed.addListener);
   487      },
   488      "call_OnClosed": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   489        const _ret = WEBEXT.app.currentWindowInternal.onClosed.addListener(A.H.get<object>(callback));
   490      },
   491      "try_OnClosed": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   492        try {
   493          const _ret = WEBEXT.app.currentWindowInternal.onClosed.addListener(A.H.get<object>(callback));
   494          return A.H.TRUE;
   495        } catch (err: any) {
   496          A.store.Ref(errPtr, err);
   497          return A.H.FALSE;
   498        }
   499      },
   500      "has_OffClosed": (): heap.Ref<boolean> => {
   501        if (
   502          WEBEXT?.app?.currentWindowInternal?.onClosed &&
   503          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onClosed
   504        ) {
   505          return A.H.TRUE;
   506        }
   507        return A.H.FALSE;
   508      },
   509      "func_OffClosed": (fn: Pointer): void => {
   510        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onClosed.removeListener);
   511      },
   512      "call_OffClosed": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   513        const _ret = WEBEXT.app.currentWindowInternal.onClosed.removeListener(A.H.get<object>(callback));
   514      },
   515      "try_OffClosed": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   516        try {
   517          const _ret = WEBEXT.app.currentWindowInternal.onClosed.removeListener(A.H.get<object>(callback));
   518          return A.H.TRUE;
   519        } catch (err: any) {
   520          A.store.Ref(errPtr, err);
   521          return A.H.FALSE;
   522        }
   523      },
   524      "has_HasOnClosed": (): heap.Ref<boolean> => {
   525        if (
   526          WEBEXT?.app?.currentWindowInternal?.onClosed &&
   527          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onClosed
   528        ) {
   529          return A.H.TRUE;
   530        }
   531        return A.H.FALSE;
   532      },
   533      "func_HasOnClosed": (fn: Pointer): void => {
   534        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onClosed.hasListener);
   535      },
   536      "call_HasOnClosed": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   537        const _ret = WEBEXT.app.currentWindowInternal.onClosed.hasListener(A.H.get<object>(callback));
   538        A.store.Bool(retPtr, _ret);
   539      },
   540      "try_HasOnClosed": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   541        try {
   542          const _ret = WEBEXT.app.currentWindowInternal.onClosed.hasListener(A.H.get<object>(callback));
   543          A.store.Bool(retPtr, _ret);
   544          return A.H.TRUE;
   545        } catch (err: any) {
   546          A.store.Ref(errPtr, err);
   547          return A.H.FALSE;
   548        }
   549      },
   550      "has_OnFullscreened": (): heap.Ref<boolean> => {
   551        if (
   552          WEBEXT?.app?.currentWindowInternal?.onFullscreened &&
   553          "addListener" in WEBEXT?.app?.currentWindowInternal?.onFullscreened
   554        ) {
   555          return A.H.TRUE;
   556        }
   557        return A.H.FALSE;
   558      },
   559      "func_OnFullscreened": (fn: Pointer): void => {
   560        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onFullscreened.addListener);
   561      },
   562      "call_OnFullscreened": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   563        const _ret = WEBEXT.app.currentWindowInternal.onFullscreened.addListener(A.H.get<object>(callback));
   564      },
   565      "try_OnFullscreened": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   566        try {
   567          const _ret = WEBEXT.app.currentWindowInternal.onFullscreened.addListener(A.H.get<object>(callback));
   568          return A.H.TRUE;
   569        } catch (err: any) {
   570          A.store.Ref(errPtr, err);
   571          return A.H.FALSE;
   572        }
   573      },
   574      "has_OffFullscreened": (): heap.Ref<boolean> => {
   575        if (
   576          WEBEXT?.app?.currentWindowInternal?.onFullscreened &&
   577          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onFullscreened
   578        ) {
   579          return A.H.TRUE;
   580        }
   581        return A.H.FALSE;
   582      },
   583      "func_OffFullscreened": (fn: Pointer): void => {
   584        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onFullscreened.removeListener);
   585      },
   586      "call_OffFullscreened": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   587        const _ret = WEBEXT.app.currentWindowInternal.onFullscreened.removeListener(A.H.get<object>(callback));
   588      },
   589      "try_OffFullscreened": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   590        try {
   591          const _ret = WEBEXT.app.currentWindowInternal.onFullscreened.removeListener(A.H.get<object>(callback));
   592          return A.H.TRUE;
   593        } catch (err: any) {
   594          A.store.Ref(errPtr, err);
   595          return A.H.FALSE;
   596        }
   597      },
   598      "has_HasOnFullscreened": (): heap.Ref<boolean> => {
   599        if (
   600          WEBEXT?.app?.currentWindowInternal?.onFullscreened &&
   601          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onFullscreened
   602        ) {
   603          return A.H.TRUE;
   604        }
   605        return A.H.FALSE;
   606      },
   607      "func_HasOnFullscreened": (fn: Pointer): void => {
   608        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onFullscreened.hasListener);
   609      },
   610      "call_HasOnFullscreened": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   611        const _ret = WEBEXT.app.currentWindowInternal.onFullscreened.hasListener(A.H.get<object>(callback));
   612        A.store.Bool(retPtr, _ret);
   613      },
   614      "try_HasOnFullscreened": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   615        try {
   616          const _ret = WEBEXT.app.currentWindowInternal.onFullscreened.hasListener(A.H.get<object>(callback));
   617          A.store.Bool(retPtr, _ret);
   618          return A.H.TRUE;
   619        } catch (err: any) {
   620          A.store.Ref(errPtr, err);
   621          return A.H.FALSE;
   622        }
   623      },
   624      "has_OnMaximized": (): heap.Ref<boolean> => {
   625        if (
   626          WEBEXT?.app?.currentWindowInternal?.onMaximized &&
   627          "addListener" in WEBEXT?.app?.currentWindowInternal?.onMaximized
   628        ) {
   629          return A.H.TRUE;
   630        }
   631        return A.H.FALSE;
   632      },
   633      "func_OnMaximized": (fn: Pointer): void => {
   634        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onMaximized.addListener);
   635      },
   636      "call_OnMaximized": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   637        const _ret = WEBEXT.app.currentWindowInternal.onMaximized.addListener(A.H.get<object>(callback));
   638      },
   639      "try_OnMaximized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   640        try {
   641          const _ret = WEBEXT.app.currentWindowInternal.onMaximized.addListener(A.H.get<object>(callback));
   642          return A.H.TRUE;
   643        } catch (err: any) {
   644          A.store.Ref(errPtr, err);
   645          return A.H.FALSE;
   646        }
   647      },
   648      "has_OffMaximized": (): heap.Ref<boolean> => {
   649        if (
   650          WEBEXT?.app?.currentWindowInternal?.onMaximized &&
   651          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onMaximized
   652        ) {
   653          return A.H.TRUE;
   654        }
   655        return A.H.FALSE;
   656      },
   657      "func_OffMaximized": (fn: Pointer): void => {
   658        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onMaximized.removeListener);
   659      },
   660      "call_OffMaximized": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   661        const _ret = WEBEXT.app.currentWindowInternal.onMaximized.removeListener(A.H.get<object>(callback));
   662      },
   663      "try_OffMaximized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   664        try {
   665          const _ret = WEBEXT.app.currentWindowInternal.onMaximized.removeListener(A.H.get<object>(callback));
   666          return A.H.TRUE;
   667        } catch (err: any) {
   668          A.store.Ref(errPtr, err);
   669          return A.H.FALSE;
   670        }
   671      },
   672      "has_HasOnMaximized": (): heap.Ref<boolean> => {
   673        if (
   674          WEBEXT?.app?.currentWindowInternal?.onMaximized &&
   675          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onMaximized
   676        ) {
   677          return A.H.TRUE;
   678        }
   679        return A.H.FALSE;
   680      },
   681      "func_HasOnMaximized": (fn: Pointer): void => {
   682        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onMaximized.hasListener);
   683      },
   684      "call_HasOnMaximized": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   685        const _ret = WEBEXT.app.currentWindowInternal.onMaximized.hasListener(A.H.get<object>(callback));
   686        A.store.Bool(retPtr, _ret);
   687      },
   688      "try_HasOnMaximized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   689        try {
   690          const _ret = WEBEXT.app.currentWindowInternal.onMaximized.hasListener(A.H.get<object>(callback));
   691          A.store.Bool(retPtr, _ret);
   692          return A.H.TRUE;
   693        } catch (err: any) {
   694          A.store.Ref(errPtr, err);
   695          return A.H.FALSE;
   696        }
   697      },
   698      "has_OnMinimized": (): heap.Ref<boolean> => {
   699        if (
   700          WEBEXT?.app?.currentWindowInternal?.onMinimized &&
   701          "addListener" in WEBEXT?.app?.currentWindowInternal?.onMinimized
   702        ) {
   703          return A.H.TRUE;
   704        }
   705        return A.H.FALSE;
   706      },
   707      "func_OnMinimized": (fn: Pointer): void => {
   708        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onMinimized.addListener);
   709      },
   710      "call_OnMinimized": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   711        const _ret = WEBEXT.app.currentWindowInternal.onMinimized.addListener(A.H.get<object>(callback));
   712      },
   713      "try_OnMinimized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   714        try {
   715          const _ret = WEBEXT.app.currentWindowInternal.onMinimized.addListener(A.H.get<object>(callback));
   716          return A.H.TRUE;
   717        } catch (err: any) {
   718          A.store.Ref(errPtr, err);
   719          return A.H.FALSE;
   720        }
   721      },
   722      "has_OffMinimized": (): heap.Ref<boolean> => {
   723        if (
   724          WEBEXT?.app?.currentWindowInternal?.onMinimized &&
   725          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onMinimized
   726        ) {
   727          return A.H.TRUE;
   728        }
   729        return A.H.FALSE;
   730      },
   731      "func_OffMinimized": (fn: Pointer): void => {
   732        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onMinimized.removeListener);
   733      },
   734      "call_OffMinimized": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   735        const _ret = WEBEXT.app.currentWindowInternal.onMinimized.removeListener(A.H.get<object>(callback));
   736      },
   737      "try_OffMinimized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   738        try {
   739          const _ret = WEBEXT.app.currentWindowInternal.onMinimized.removeListener(A.H.get<object>(callback));
   740          return A.H.TRUE;
   741        } catch (err: any) {
   742          A.store.Ref(errPtr, err);
   743          return A.H.FALSE;
   744        }
   745      },
   746      "has_HasOnMinimized": (): heap.Ref<boolean> => {
   747        if (
   748          WEBEXT?.app?.currentWindowInternal?.onMinimized &&
   749          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onMinimized
   750        ) {
   751          return A.H.TRUE;
   752        }
   753        return A.H.FALSE;
   754      },
   755      "func_HasOnMinimized": (fn: Pointer): void => {
   756        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onMinimized.hasListener);
   757      },
   758      "call_HasOnMinimized": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   759        const _ret = WEBEXT.app.currentWindowInternal.onMinimized.hasListener(A.H.get<object>(callback));
   760        A.store.Bool(retPtr, _ret);
   761      },
   762      "try_HasOnMinimized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   763        try {
   764          const _ret = WEBEXT.app.currentWindowInternal.onMinimized.hasListener(A.H.get<object>(callback));
   765          A.store.Bool(retPtr, _ret);
   766          return A.H.TRUE;
   767        } catch (err: any) {
   768          A.store.Ref(errPtr, err);
   769          return A.H.FALSE;
   770        }
   771      },
   772      "has_OnRestored": (): heap.Ref<boolean> => {
   773        if (
   774          WEBEXT?.app?.currentWindowInternal?.onRestored &&
   775          "addListener" in WEBEXT?.app?.currentWindowInternal?.onRestored
   776        ) {
   777          return A.H.TRUE;
   778        }
   779        return A.H.FALSE;
   780      },
   781      "func_OnRestored": (fn: Pointer): void => {
   782        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onRestored.addListener);
   783      },
   784      "call_OnRestored": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   785        const _ret = WEBEXT.app.currentWindowInternal.onRestored.addListener(A.H.get<object>(callback));
   786      },
   787      "try_OnRestored": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   788        try {
   789          const _ret = WEBEXT.app.currentWindowInternal.onRestored.addListener(A.H.get<object>(callback));
   790          return A.H.TRUE;
   791        } catch (err: any) {
   792          A.store.Ref(errPtr, err);
   793          return A.H.FALSE;
   794        }
   795      },
   796      "has_OffRestored": (): heap.Ref<boolean> => {
   797        if (
   798          WEBEXT?.app?.currentWindowInternal?.onRestored &&
   799          "removeListener" in WEBEXT?.app?.currentWindowInternal?.onRestored
   800        ) {
   801          return A.H.TRUE;
   802        }
   803        return A.H.FALSE;
   804      },
   805      "func_OffRestored": (fn: Pointer): void => {
   806        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onRestored.removeListener);
   807      },
   808      "call_OffRestored": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   809        const _ret = WEBEXT.app.currentWindowInternal.onRestored.removeListener(A.H.get<object>(callback));
   810      },
   811      "try_OffRestored": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   812        try {
   813          const _ret = WEBEXT.app.currentWindowInternal.onRestored.removeListener(A.H.get<object>(callback));
   814          return A.H.TRUE;
   815        } catch (err: any) {
   816          A.store.Ref(errPtr, err);
   817          return A.H.FALSE;
   818        }
   819      },
   820      "has_HasOnRestored": (): heap.Ref<boolean> => {
   821        if (
   822          WEBEXT?.app?.currentWindowInternal?.onRestored &&
   823          "hasListener" in WEBEXT?.app?.currentWindowInternal?.onRestored
   824        ) {
   825          return A.H.TRUE;
   826        }
   827        return A.H.FALSE;
   828      },
   829      "func_HasOnRestored": (fn: Pointer): void => {
   830        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.onRestored.hasListener);
   831      },
   832      "call_HasOnRestored": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   833        const _ret = WEBEXT.app.currentWindowInternal.onRestored.hasListener(A.H.get<object>(callback));
   834        A.store.Bool(retPtr, _ret);
   835      },
   836      "try_HasOnRestored": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   837        try {
   838          const _ret = WEBEXT.app.currentWindowInternal.onRestored.hasListener(A.H.get<object>(callback));
   839          A.store.Bool(retPtr, _ret);
   840          return A.H.TRUE;
   841        } catch (err: any) {
   842          A.store.Ref(errPtr, err);
   843          return A.H.FALSE;
   844        }
   845      },
   846      "has_Restore": (): heap.Ref<boolean> => {
   847        if (WEBEXT?.app?.currentWindowInternal && "restore" in WEBEXT?.app?.currentWindowInternal) {
   848          return A.H.TRUE;
   849        }
   850        return A.H.FALSE;
   851      },
   852      "func_Restore": (fn: Pointer): void => {
   853        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.restore);
   854      },
   855      "call_Restore": (retPtr: Pointer): void => {
   856        const _ret = WEBEXT.app.currentWindowInternal.restore();
   857      },
   858      "try_Restore": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   859        try {
   860          const _ret = WEBEXT.app.currentWindowInternal.restore();
   861          return A.H.TRUE;
   862        } catch (err: any) {
   863          A.store.Ref(errPtr, err);
   864          return A.H.FALSE;
   865        }
   866      },
   867      "has_SetActivateOnPointer": (): heap.Ref<boolean> => {
   868        if (WEBEXT?.app?.currentWindowInternal && "setActivateOnPointer" in WEBEXT?.app?.currentWindowInternal) {
   869          return A.H.TRUE;
   870        }
   871        return A.H.FALSE;
   872      },
   873      "func_SetActivateOnPointer": (fn: Pointer): void => {
   874        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setActivateOnPointer);
   875      },
   876      "call_SetActivateOnPointer": (retPtr: Pointer, activate_on_pointer: heap.Ref<boolean>): void => {
   877        const _ret = WEBEXT.app.currentWindowInternal.setActivateOnPointer(activate_on_pointer === A.H.TRUE);
   878      },
   879      "try_SetActivateOnPointer": (
   880        retPtr: Pointer,
   881        errPtr: Pointer,
   882        activate_on_pointer: heap.Ref<boolean>
   883      ): heap.Ref<boolean> => {
   884        try {
   885          const _ret = WEBEXT.app.currentWindowInternal.setActivateOnPointer(activate_on_pointer === A.H.TRUE);
   886          return A.H.TRUE;
   887        } catch (err: any) {
   888          A.store.Ref(errPtr, err);
   889          return A.H.FALSE;
   890        }
   891      },
   892      "has_SetAlwaysOnTop": (): heap.Ref<boolean> => {
   893        if (WEBEXT?.app?.currentWindowInternal && "setAlwaysOnTop" in WEBEXT?.app?.currentWindowInternal) {
   894          return A.H.TRUE;
   895        }
   896        return A.H.FALSE;
   897      },
   898      "func_SetAlwaysOnTop": (fn: Pointer): void => {
   899        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setAlwaysOnTop);
   900      },
   901      "call_SetAlwaysOnTop": (retPtr: Pointer, always_on_top: heap.Ref<boolean>): void => {
   902        const _ret = WEBEXT.app.currentWindowInternal.setAlwaysOnTop(always_on_top === A.H.TRUE);
   903      },
   904      "try_SetAlwaysOnTop": (retPtr: Pointer, errPtr: Pointer, always_on_top: heap.Ref<boolean>): heap.Ref<boolean> => {
   905        try {
   906          const _ret = WEBEXT.app.currentWindowInternal.setAlwaysOnTop(always_on_top === A.H.TRUE);
   907          return A.H.TRUE;
   908        } catch (err: any) {
   909          A.store.Ref(errPtr, err);
   910          return A.H.FALSE;
   911        }
   912      },
   913      "has_SetBounds": (): heap.Ref<boolean> => {
   914        if (WEBEXT?.app?.currentWindowInternal && "setBounds" in WEBEXT?.app?.currentWindowInternal) {
   915          return A.H.TRUE;
   916        }
   917        return A.H.FALSE;
   918      },
   919      "func_SetBounds": (fn: Pointer): void => {
   920        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setBounds);
   921      },
   922      "call_SetBounds": (retPtr: Pointer, boundsType: heap.Ref<object>, bounds: Pointer): void => {
   923        const bounds_ffi = {};
   924  
   925        if (A.load.Bool(bounds + 16)) {
   926          bounds_ffi["left"] = A.load.Int32(bounds + 0);
   927        }
   928        if (A.load.Bool(bounds + 17)) {
   929          bounds_ffi["top"] = A.load.Int32(bounds + 4);
   930        }
   931        if (A.load.Bool(bounds + 18)) {
   932          bounds_ffi["width"] = A.load.Int32(bounds + 8);
   933        }
   934        if (A.load.Bool(bounds + 19)) {
   935          bounds_ffi["height"] = A.load.Int32(bounds + 12);
   936        }
   937  
   938        const _ret = WEBEXT.app.currentWindowInternal.setBounds(A.H.get<object>(boundsType), bounds_ffi);
   939      },
   940      "try_SetBounds": (
   941        retPtr: Pointer,
   942        errPtr: Pointer,
   943        boundsType: heap.Ref<object>,
   944        bounds: Pointer
   945      ): heap.Ref<boolean> => {
   946        try {
   947          const bounds_ffi = {};
   948  
   949          if (A.load.Bool(bounds + 16)) {
   950            bounds_ffi["left"] = A.load.Int32(bounds + 0);
   951          }
   952          if (A.load.Bool(bounds + 17)) {
   953            bounds_ffi["top"] = A.load.Int32(bounds + 4);
   954          }
   955          if (A.load.Bool(bounds + 18)) {
   956            bounds_ffi["width"] = A.load.Int32(bounds + 8);
   957          }
   958          if (A.load.Bool(bounds + 19)) {
   959            bounds_ffi["height"] = A.load.Int32(bounds + 12);
   960          }
   961  
   962          const _ret = WEBEXT.app.currentWindowInternal.setBounds(A.H.get<object>(boundsType), bounds_ffi);
   963          return A.H.TRUE;
   964        } catch (err: any) {
   965          A.store.Ref(errPtr, err);
   966          return A.H.FALSE;
   967        }
   968      },
   969      "has_SetIcon": (): heap.Ref<boolean> => {
   970        if (WEBEXT?.app?.currentWindowInternal && "setIcon" in WEBEXT?.app?.currentWindowInternal) {
   971          return A.H.TRUE;
   972        }
   973        return A.H.FALSE;
   974      },
   975      "func_SetIcon": (fn: Pointer): void => {
   976        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setIcon);
   977      },
   978      "call_SetIcon": (retPtr: Pointer, icon_url: heap.Ref<object>): void => {
   979        const _ret = WEBEXT.app.currentWindowInternal.setIcon(A.H.get<object>(icon_url));
   980      },
   981      "try_SetIcon": (retPtr: Pointer, errPtr: Pointer, icon_url: heap.Ref<object>): heap.Ref<boolean> => {
   982        try {
   983          const _ret = WEBEXT.app.currentWindowInternal.setIcon(A.H.get<object>(icon_url));
   984          return A.H.TRUE;
   985        } catch (err: any) {
   986          A.store.Ref(errPtr, err);
   987          return A.H.FALSE;
   988        }
   989      },
   990      "has_SetShape": (): heap.Ref<boolean> => {
   991        if (WEBEXT?.app?.currentWindowInternal && "setShape" in WEBEXT?.app?.currentWindowInternal) {
   992          return A.H.TRUE;
   993        }
   994        return A.H.FALSE;
   995      },
   996      "func_SetShape": (fn: Pointer): void => {
   997        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setShape);
   998      },
   999      "call_SetShape": (retPtr: Pointer, region: Pointer): void => {
  1000        const region_ffi = {};
  1001  
  1002        region_ffi["rects"] = A.load.Ref(region + 0, undefined);
  1003  
  1004        const _ret = WEBEXT.app.currentWindowInternal.setShape(region_ffi);
  1005      },
  1006      "try_SetShape": (retPtr: Pointer, errPtr: Pointer, region: Pointer): heap.Ref<boolean> => {
  1007        try {
  1008          const region_ffi = {};
  1009  
  1010          region_ffi["rects"] = A.load.Ref(region + 0, undefined);
  1011  
  1012          const _ret = WEBEXT.app.currentWindowInternal.setShape(region_ffi);
  1013          return A.H.TRUE;
  1014        } catch (err: any) {
  1015          A.store.Ref(errPtr, err);
  1016          return A.H.FALSE;
  1017        }
  1018      },
  1019      "has_SetSizeConstraints": (): heap.Ref<boolean> => {
  1020        if (WEBEXT?.app?.currentWindowInternal && "setSizeConstraints" in WEBEXT?.app?.currentWindowInternal) {
  1021          return A.H.TRUE;
  1022        }
  1023        return A.H.FALSE;
  1024      },
  1025      "func_SetSizeConstraints": (fn: Pointer): void => {
  1026        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setSizeConstraints);
  1027      },
  1028      "call_SetSizeConstraints": (retPtr: Pointer, boundsType: heap.Ref<object>, constraints: Pointer): void => {
  1029        const constraints_ffi = {};
  1030  
  1031        if (A.load.Bool(constraints + 16)) {
  1032          constraints_ffi["minWidth"] = A.load.Int32(constraints + 0);
  1033        }
  1034        if (A.load.Bool(constraints + 17)) {
  1035          constraints_ffi["minHeight"] = A.load.Int32(constraints + 4);
  1036        }
  1037        if (A.load.Bool(constraints + 18)) {
  1038          constraints_ffi["maxWidth"] = A.load.Int32(constraints + 8);
  1039        }
  1040        if (A.load.Bool(constraints + 19)) {
  1041          constraints_ffi["maxHeight"] = A.load.Int32(constraints + 12);
  1042        }
  1043  
  1044        const _ret = WEBEXT.app.currentWindowInternal.setSizeConstraints(A.H.get<object>(boundsType), constraints_ffi);
  1045      },
  1046      "try_SetSizeConstraints": (
  1047        retPtr: Pointer,
  1048        errPtr: Pointer,
  1049        boundsType: heap.Ref<object>,
  1050        constraints: Pointer
  1051      ): heap.Ref<boolean> => {
  1052        try {
  1053          const constraints_ffi = {};
  1054  
  1055          if (A.load.Bool(constraints + 16)) {
  1056            constraints_ffi["minWidth"] = A.load.Int32(constraints + 0);
  1057          }
  1058          if (A.load.Bool(constraints + 17)) {
  1059            constraints_ffi["minHeight"] = A.load.Int32(constraints + 4);
  1060          }
  1061          if (A.load.Bool(constraints + 18)) {
  1062            constraints_ffi["maxWidth"] = A.load.Int32(constraints + 8);
  1063          }
  1064          if (A.load.Bool(constraints + 19)) {
  1065            constraints_ffi["maxHeight"] = A.load.Int32(constraints + 12);
  1066          }
  1067  
  1068          const _ret = WEBEXT.app.currentWindowInternal.setSizeConstraints(A.H.get<object>(boundsType), constraints_ffi);
  1069          return A.H.TRUE;
  1070        } catch (err: any) {
  1071          A.store.Ref(errPtr, err);
  1072          return A.H.FALSE;
  1073        }
  1074      },
  1075      "has_SetVisibleOnAllWorkspaces": (): heap.Ref<boolean> => {
  1076        if (WEBEXT?.app?.currentWindowInternal && "setVisibleOnAllWorkspaces" in WEBEXT?.app?.currentWindowInternal) {
  1077          return A.H.TRUE;
  1078        }
  1079        return A.H.FALSE;
  1080      },
  1081      "func_SetVisibleOnAllWorkspaces": (fn: Pointer): void => {
  1082        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.setVisibleOnAllWorkspaces);
  1083      },
  1084      "call_SetVisibleOnAllWorkspaces": (retPtr: Pointer, always_visible: heap.Ref<boolean>): void => {
  1085        const _ret = WEBEXT.app.currentWindowInternal.setVisibleOnAllWorkspaces(always_visible === A.H.TRUE);
  1086      },
  1087      "try_SetVisibleOnAllWorkspaces": (
  1088        retPtr: Pointer,
  1089        errPtr: Pointer,
  1090        always_visible: heap.Ref<boolean>
  1091      ): heap.Ref<boolean> => {
  1092        try {
  1093          const _ret = WEBEXT.app.currentWindowInternal.setVisibleOnAllWorkspaces(always_visible === A.H.TRUE);
  1094          return A.H.TRUE;
  1095        } catch (err: any) {
  1096          A.store.Ref(errPtr, err);
  1097          return A.H.FALSE;
  1098        }
  1099      },
  1100      "has_Show": (): heap.Ref<boolean> => {
  1101        if (WEBEXT?.app?.currentWindowInternal && "show" in WEBEXT?.app?.currentWindowInternal) {
  1102          return A.H.TRUE;
  1103        }
  1104        return A.H.FALSE;
  1105      },
  1106      "func_Show": (fn: Pointer): void => {
  1107        A.store.Ref(fn, WEBEXT.app.currentWindowInternal.show);
  1108      },
  1109      "call_Show": (retPtr: Pointer, focused: heap.Ref<boolean>): void => {
  1110        const _ret = WEBEXT.app.currentWindowInternal.show(focused === A.H.TRUE);
  1111      },
  1112      "try_Show": (retPtr: Pointer, errPtr: Pointer, focused: heap.Ref<boolean>): heap.Ref<boolean> => {
  1113        try {
  1114          const _ret = WEBEXT.app.currentWindowInternal.show(focused === A.H.TRUE);
  1115          return A.H.TRUE;
  1116        } catch (err: any) {
  1117          A.store.Ref(errPtr, err);
  1118          return A.H.FALSE;
  1119        }
  1120      },
  1121    };
  1122  });