@opentui/core 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/buffer.d.ts +2 -2
- package/{chunk-bun-1n307cze.js → chunk-bun-9335djz2.js} +445 -179
- package/{chunk-bun-1n307cze.js.map → chunk-bun-9335djz2.js.map} +6 -6
- package/{chunk-bun-gvv8cwwz.js → chunk-bun-da1keqyp.js} +2 -2
- package/{chunk-node-crchpns1.js → chunk-node-2h23nsbj.js} +445 -179
- package/{chunk-node-crchpns1.js.map → chunk-node-2h23nsbj.js.map} +6 -6
- package/{chunk-node-tq0x9mbj.js → chunk-node-ks0581vk.js} +2 -2
- package/index.bun.js +376 -3
- package/index.bun.js.map +4 -3
- package/index.node.js +376 -3
- package/index.node.js.map +4 -2
- package/package.json +9 -9
- package/renderables/EmbeddedTerminal.d.ts +67 -0
- package/renderables/index.d.ts +1 -0
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig-structs.d.ts +2 -0
- package/zig.d.ts +64 -6
- /package/{chunk-bun-gvv8cwwz.js.map → chunk-bun-da1keqyp.js.map} +0 -0
- /package/{chunk-node-tq0x9mbj.js.map → chunk-node-ks0581vk.js.map} +0 -0
|
@@ -585,7 +585,7 @@ function toNodeFFIType(type, position) {
|
|
|
585
585
|
case FFIType.napi_value:
|
|
586
586
|
throw new Error(NODE_NAPI_UNSUPPORTED);
|
|
587
587
|
case FFIType.buffer:
|
|
588
|
-
return "
|
|
588
|
+
return "pointer";
|
|
589
589
|
default:
|
|
590
590
|
return unsupportedNodeFFIType(type);
|
|
591
591
|
}
|
|
@@ -11437,7 +11437,7 @@ class OptimizedBuffer {
|
|
|
11437
11437
|
if (matrix.length !== 16)
|
|
11438
11438
|
throw new RangeError(`colorMatrix matrix must have length 16, got ${matrix.length}`);
|
|
11439
11439
|
const cellMaskCount = Math.floor(cellMask.length / 3);
|
|
11440
|
-
this.lib.bufferColorMatrix(this.bufferPtr,
|
|
11440
|
+
this.lib.bufferColorMatrix(this.bufferPtr, matrix, cellMask, cellMaskCount, strength, target);
|
|
11441
11441
|
}
|
|
11442
11442
|
colorMatrixUniform(matrix, strength = 1, target = 3 /* Both */) {
|
|
11443
11443
|
this.guard();
|
|
@@ -11445,7 +11445,7 @@ class OptimizedBuffer {
|
|
|
11445
11445
|
throw new RangeError(`colorMatrixUniform matrix must have length 16, got ${matrix.length}`);
|
|
11446
11446
|
if (strength === 0)
|
|
11447
11447
|
return;
|
|
11448
|
-
this.lib.bufferColorMatrixUniform(this.bufferPtr,
|
|
11448
|
+
this.lib.bufferColorMatrixUniform(this.bufferPtr, matrix, strength, target);
|
|
11449
11449
|
}
|
|
11450
11450
|
drawFrameBuffer(destX, destY, frameBuffer, sourceX, sourceY, sourceWidth, sourceHeight) {
|
|
11451
11451
|
this.guard();
|
|
@@ -11466,9 +11466,9 @@ class OptimizedBuffer {
|
|
|
11466
11466
|
this.guard();
|
|
11467
11467
|
this.lib.bufferDrawEditorView(this.bufferPtr, editorView.ptr, x, y);
|
|
11468
11468
|
}
|
|
11469
|
-
drawSuperSampleBuffer(x, y,
|
|
11469
|
+
drawSuperSampleBuffer(x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
|
|
11470
11470
|
this.guard();
|
|
11471
|
-
this.lib.bufferDrawSuperSampleBuffer(this.bufferPtr, x, y, toPointer(
|
|
11471
|
+
this.lib.bufferDrawSuperSampleBuffer(this.bufferPtr, x, y, typeof pixelData === "number" || typeof pixelData === "bigint" ? toPointer(pixelData) : pixelData, pixelDataLength, format, alignedBytesPerRow);
|
|
11472
11472
|
}
|
|
11473
11473
|
drawImage(image, x, y, width, height, pixelWidth = 0, pixelHeight = 0, sourceX = 0, sourceY = 0, sourceWidth = image.width, sourceHeight = image.height, protocol = "auto") {
|
|
11474
11474
|
this.guard();
|
|
@@ -11487,17 +11487,17 @@ class OptimizedBuffer {
|
|
|
11487
11487
|
}
|
|
11488
11488
|
return this.lib.bufferDrawImage(this.bufferPtr, image.ptr, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol);
|
|
11489
11489
|
}
|
|
11490
|
-
drawPackedBuffer(
|
|
11490
|
+
drawPackedBuffer(data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
|
|
11491
11491
|
this.guard();
|
|
11492
|
-
this.lib.bufferDrawPackedBuffer(this.bufferPtr, toPointer(
|
|
11492
|
+
this.lib.bufferDrawPackedBuffer(this.bufferPtr, typeof data === "number" || typeof data === "bigint" ? toPointer(data) : data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
|
|
11493
11493
|
}
|
|
11494
11494
|
drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
|
|
11495
11495
|
this.guard();
|
|
11496
|
-
this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY,
|
|
11496
|
+
this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
|
|
11497
11497
|
}
|
|
11498
11498
|
drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
|
|
11499
11499
|
this.guard();
|
|
11500
|
-
this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY,
|
|
11500
|
+
this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
|
|
11501
11501
|
}
|
|
11502
11502
|
resize(width, height) {
|
|
11503
11503
|
this.guard();
|
|
@@ -13201,6 +13201,28 @@ var CursorStateStruct = defineStruct([
|
|
|
13201
13201
|
["b", "f32"],
|
|
13202
13202
|
["a", "f32"]
|
|
13203
13203
|
]);
|
|
13204
|
+
var EmbeddedTerminalCursorStruct = defineStruct([
|
|
13205
|
+
["x", "u16"],
|
|
13206
|
+
["y", "u16"],
|
|
13207
|
+
["hasValue", "bool_u8"],
|
|
13208
|
+
["visible", "bool_u8"],
|
|
13209
|
+
["blinking", "bool_u8"],
|
|
13210
|
+
["wideTail", "bool_u8"],
|
|
13211
|
+
["style", "u8"],
|
|
13212
|
+
["colorHasValue", "bool_u8"],
|
|
13213
|
+
["colorR", "u8"],
|
|
13214
|
+
["colorG", "u8"],
|
|
13215
|
+
["colorB", "u8"],
|
|
13216
|
+
["padding", "u8"]
|
|
13217
|
+
]);
|
|
13218
|
+
var EmbeddedTerminalKeyOptionsStruct = defineStruct([
|
|
13219
|
+
["action", "u8"],
|
|
13220
|
+
["composing", "u8"],
|
|
13221
|
+
["mods", "u16"],
|
|
13222
|
+
["consumedMods", "u16"],
|
|
13223
|
+
["padding", "u16"],
|
|
13224
|
+
["unshiftedCodepoint", "u32"]
|
|
13225
|
+
]);
|
|
13204
13226
|
var CursorStyleOptionsStruct = defineStruct([
|
|
13205
13227
|
["style", "u8", { default: 255 }],
|
|
13206
13228
|
["blinking", "u8", { default: 255 }],
|
|
@@ -13517,14 +13539,50 @@ function toSafeFFIU32Length(value, label) {
|
|
|
13517
13539
|
function isFFIU32(value) {
|
|
13518
13540
|
return Number.isInteger(value) && value >= 0 && value <= MAX_FFI_U32;
|
|
13519
13541
|
}
|
|
13520
|
-
function
|
|
13521
|
-
return value.byteLength === 0 ? null :
|
|
13542
|
+
function viewOrNull(value) {
|
|
13543
|
+
return value.byteLength === 0 ? null : value;
|
|
13544
|
+
}
|
|
13545
|
+
function retainedPtrOrNull(value) {
|
|
13546
|
+
if (value.byteLength === 0)
|
|
13547
|
+
return null;
|
|
13548
|
+
value.buffer;
|
|
13549
|
+
return ptr(value);
|
|
13550
|
+
}
|
|
13551
|
+
var EMBEDDED_TERMINAL_ERRORS = {
|
|
13552
|
+
[-1]: "invalid value or handle",
|
|
13553
|
+
[-2]: "out of memory",
|
|
13554
|
+
[-3]: "embedded terminal support is unavailable",
|
|
13555
|
+
[-4]: "output buffer is too small",
|
|
13556
|
+
[-5]: "processing failed"
|
|
13557
|
+
};
|
|
13558
|
+
function embeddedTerminalResult(status, operation) {
|
|
13559
|
+
if (status >= 0)
|
|
13560
|
+
return status;
|
|
13561
|
+
throw new Error(`Embedded terminal ${operation} failed: ${EMBEDDED_TERMINAL_ERRORS[status] ?? `status ${status}`}`);
|
|
13562
|
+
}
|
|
13563
|
+
function embeddedTerminalDimension(value, name) {
|
|
13564
|
+
if (!Number.isInteger(value) || value < 1 || value > 65535) {
|
|
13565
|
+
throw new RangeError(`Embedded terminal ${name} must be an integer between 1 and 65535`);
|
|
13566
|
+
}
|
|
13567
|
+
return value;
|
|
13522
13568
|
}
|
|
13523
|
-
function
|
|
13524
|
-
|
|
13569
|
+
function embeddedTerminalI32(value, name) {
|
|
13570
|
+
if (!Number.isInteger(value) || value < -2147483648 || value > 2147483647) {
|
|
13571
|
+
throw new RangeError(`Embedded terminal ${name} must be a signed 32-bit integer`);
|
|
13572
|
+
}
|
|
13573
|
+
return value;
|
|
13525
13574
|
}
|
|
13526
|
-
function
|
|
13527
|
-
|
|
13575
|
+
function embeddedTerminalF32(value, name) {
|
|
13576
|
+
if (!Number.isFinite(value) || Math.abs(value) > 340282346638528860000000000000000000000) {
|
|
13577
|
+
throw new RangeError(`Embedded terminal ${name} must be a finite 32-bit float`);
|
|
13578
|
+
}
|
|
13579
|
+
return value;
|
|
13580
|
+
}
|
|
13581
|
+
function rgbaBuffer(value) {
|
|
13582
|
+
return value.buffer;
|
|
13583
|
+
}
|
|
13584
|
+
function optionalRgbaBuffer(value) {
|
|
13585
|
+
return value ? rgbaBuffer(value) : null;
|
|
13528
13586
|
}
|
|
13529
13587
|
function getOpenTUILib(libPath) {
|
|
13530
13588
|
const resolvedLibPath = libPath || targetLibPath;
|
|
@@ -13560,6 +13618,70 @@ function getOpenTUILib(libPath) {
|
|
|
13560
13618
|
args: ["u32", "u32", "u32"],
|
|
13561
13619
|
returns: "bool"
|
|
13562
13620
|
},
|
|
13621
|
+
createEmbeddedTerminal: {
|
|
13622
|
+
args: ["u16", "u16", "u32", "ptr"],
|
|
13623
|
+
returns: "i32"
|
|
13624
|
+
},
|
|
13625
|
+
destroyEmbeddedTerminal: {
|
|
13626
|
+
args: ["u32"],
|
|
13627
|
+
returns: "void"
|
|
13628
|
+
},
|
|
13629
|
+
embeddedTerminalWrite: {
|
|
13630
|
+
args: ["u32", "ptr", "u32"],
|
|
13631
|
+
returns: "i32"
|
|
13632
|
+
},
|
|
13633
|
+
embeddedTerminalResize: {
|
|
13634
|
+
args: ["u32", "u16", "u16"],
|
|
13635
|
+
returns: "i32"
|
|
13636
|
+
},
|
|
13637
|
+
embeddedTerminalInvalidate: {
|
|
13638
|
+
args: ["u32"],
|
|
13639
|
+
returns: "i32"
|
|
13640
|
+
},
|
|
13641
|
+
embeddedTerminalScroll: {
|
|
13642
|
+
args: ["u32", "i32"],
|
|
13643
|
+
returns: "i32"
|
|
13644
|
+
},
|
|
13645
|
+
embeddedTerminalSetSelection: {
|
|
13646
|
+
args: ["u32", "u16", "u16", "u16", "u16"],
|
|
13647
|
+
returns: "i32"
|
|
13648
|
+
},
|
|
13649
|
+
embeddedTerminalClearSelection: {
|
|
13650
|
+
args: ["u32"],
|
|
13651
|
+
returns: "i32"
|
|
13652
|
+
},
|
|
13653
|
+
embeddedTerminalGetSelectedText: {
|
|
13654
|
+
args: ["u32", "buffer", "u32", "buffer"],
|
|
13655
|
+
returns: "i32"
|
|
13656
|
+
},
|
|
13657
|
+
embeddedTerminalCompose: {
|
|
13658
|
+
args: ["u32", "u32", "i32", "i32"],
|
|
13659
|
+
returns: "i32"
|
|
13660
|
+
},
|
|
13661
|
+
embeddedTerminalCursor: {
|
|
13662
|
+
args: ["u32", "ptr"],
|
|
13663
|
+
returns: "i32"
|
|
13664
|
+
},
|
|
13665
|
+
embeddedTerminalEncodeKey: {
|
|
13666
|
+
args: ["u32", "ptr", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
|
|
13667
|
+
returns: "i32"
|
|
13668
|
+
},
|
|
13669
|
+
embeddedTerminalEncodeMouse: {
|
|
13670
|
+
args: ["u32", "u8", "i8", "u16", "f32", "f32", "u8", "ptr", "u32"],
|
|
13671
|
+
returns: "i32"
|
|
13672
|
+
},
|
|
13673
|
+
embeddedTerminalEncodePaste: {
|
|
13674
|
+
args: ["u32", "ptr", "u32", "ptr", "u32"],
|
|
13675
|
+
returns: "i32"
|
|
13676
|
+
},
|
|
13677
|
+
embeddedTerminalEncodeFocus: {
|
|
13678
|
+
args: ["u32", "u8", "ptr", "u32"],
|
|
13679
|
+
returns: "i32"
|
|
13680
|
+
},
|
|
13681
|
+
embeddedTerminalDrainResponses: {
|
|
13682
|
+
args: ["u32", "ptr", "u32"],
|
|
13683
|
+
returns: "i32"
|
|
13684
|
+
},
|
|
13563
13685
|
createRenderer: {
|
|
13564
13686
|
args: ["u32", "u32", "u8", "u8", "ptr"],
|
|
13565
13687
|
returns: "u32"
|
|
@@ -13581,7 +13703,7 @@ function getOpenTUILib(libPath) {
|
|
|
13581
13703
|
returns: "void"
|
|
13582
13704
|
},
|
|
13583
13705
|
setBackgroundColor: {
|
|
13584
|
-
args: ["u32", "
|
|
13706
|
+
args: ["u32", "buffer"],
|
|
13585
13707
|
returns: "void"
|
|
13586
13708
|
},
|
|
13587
13709
|
setRenderOffset: {
|
|
@@ -13641,7 +13763,7 @@ function getOpenTUILib(libPath) {
|
|
|
13641
13763
|
returns: "u32"
|
|
13642
13764
|
},
|
|
13643
13765
|
rendererSetPaletteState: {
|
|
13644
|
-
args: ["u32", "
|
|
13766
|
+
args: ["u32", "buffer", "u32", "buffer", "buffer", "u32"],
|
|
13645
13767
|
returns: "void"
|
|
13646
13768
|
},
|
|
13647
13769
|
queryPixelResolution: {
|
|
@@ -13653,7 +13775,7 @@ function getOpenTUILib(libPath) {
|
|
|
13653
13775
|
returns: "void"
|
|
13654
13776
|
},
|
|
13655
13777
|
createOptimizedBuffer: {
|
|
13656
|
-
args: ["u32", "u32", "bool", "u8", "
|
|
13778
|
+
args: ["u32", "u32", "bool", "u8", "buffer", "u32"],
|
|
13657
13779
|
returns: "u32"
|
|
13658
13780
|
},
|
|
13659
13781
|
destroyOptimizedBuffer: {
|
|
@@ -13673,7 +13795,7 @@ function getOpenTUILib(libPath) {
|
|
|
13673
13795
|
returns: "u32"
|
|
13674
13796
|
},
|
|
13675
13797
|
bufferClear: {
|
|
13676
|
-
args: ["u32", "
|
|
13798
|
+
args: ["u32", "buffer"],
|
|
13677
13799
|
returns: "void"
|
|
13678
13800
|
},
|
|
13679
13801
|
bufferGetCharPtr: {
|
|
@@ -13701,7 +13823,7 @@ function getOpenTUILib(libPath) {
|
|
|
13701
13823
|
returns: "void"
|
|
13702
13824
|
},
|
|
13703
13825
|
bufferGetId: {
|
|
13704
|
-
args: ["u32", "
|
|
13826
|
+
args: ["u32", "buffer", "u32"],
|
|
13705
13827
|
returns: "u32"
|
|
13706
13828
|
},
|
|
13707
13829
|
bufferGetRealCharSize: {
|
|
@@ -13713,19 +13835,19 @@ function getOpenTUILib(libPath) {
|
|
|
13713
13835
|
returns: "u32"
|
|
13714
13836
|
},
|
|
13715
13837
|
bufferDrawText: {
|
|
13716
|
-
args: ["u32", "ptr", "u32", "u32", "u32", "
|
|
13838
|
+
args: ["u32", "ptr", "u32", "u32", "u32", "buffer", "ptr", "u32"],
|
|
13717
13839
|
returns: "void"
|
|
13718
13840
|
},
|
|
13719
13841
|
bufferSetCellWithAlphaBlending: {
|
|
13720
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
13842
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
13721
13843
|
returns: "void"
|
|
13722
13844
|
},
|
|
13723
13845
|
bufferSetCell: {
|
|
13724
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
13846
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
13725
13847
|
returns: "void"
|
|
13726
13848
|
},
|
|
13727
13849
|
bufferFillRect: {
|
|
13728
|
-
args: ["u32", "u32", "u32", "u32", "u32", "
|
|
13850
|
+
args: ["u32", "u32", "u32", "u32", "u32", "buffer"],
|
|
13729
13851
|
returns: "void"
|
|
13730
13852
|
},
|
|
13731
13853
|
bufferColorMatrix: {
|
|
@@ -13765,7 +13887,7 @@ function getOpenTUILib(libPath) {
|
|
|
13765
13887
|
returns: "void"
|
|
13766
13888
|
},
|
|
13767
13889
|
setCursorColor: {
|
|
13768
|
-
args: ["u32", "
|
|
13890
|
+
args: ["u32", "buffer"],
|
|
13769
13891
|
returns: "void"
|
|
13770
13892
|
},
|
|
13771
13893
|
getCursorState: {
|
|
@@ -13893,11 +14015,26 @@ function getOpenTUILib(libPath) {
|
|
|
13893
14015
|
returns: "void"
|
|
13894
14016
|
},
|
|
13895
14017
|
bufferDrawGrid: {
|
|
13896
|
-
args: ["u32", "
|
|
14018
|
+
args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "ptr"],
|
|
13897
14019
|
returns: "void"
|
|
13898
14020
|
},
|
|
13899
14021
|
bufferDrawBox: {
|
|
13900
|
-
args: [
|
|
14022
|
+
args: [
|
|
14023
|
+
"u32",
|
|
14024
|
+
"i32",
|
|
14025
|
+
"i32",
|
|
14026
|
+
"u32",
|
|
14027
|
+
"u32",
|
|
14028
|
+
"buffer",
|
|
14029
|
+
"u32",
|
|
14030
|
+
"buffer",
|
|
14031
|
+
"buffer",
|
|
14032
|
+
"buffer",
|
|
14033
|
+
"ptr",
|
|
14034
|
+
"u32",
|
|
14035
|
+
"ptr",
|
|
14036
|
+
"u32"
|
|
14037
|
+
],
|
|
13901
14038
|
returns: "void"
|
|
13902
14039
|
},
|
|
13903
14040
|
bufferPushScissorRect: {
|
|
@@ -14229,7 +14366,7 @@ function getOpenTUILib(libPath) {
|
|
|
14229
14366
|
returns: "void"
|
|
14230
14367
|
},
|
|
14231
14368
|
textBufferViewSetTabIndicatorColor: {
|
|
14232
|
-
args: ["u32", "
|
|
14369
|
+
args: ["u32", "buffer"],
|
|
14233
14370
|
returns: "void"
|
|
14234
14371
|
},
|
|
14235
14372
|
textBufferViewSetTruncate: {
|
|
@@ -14265,7 +14402,7 @@ function getOpenTUILib(libPath) {
|
|
|
14265
14402
|
returns: "void"
|
|
14266
14403
|
},
|
|
14267
14404
|
editorViewGetViewport: {
|
|
14268
|
-
args: ["u32", "
|
|
14405
|
+
args: ["u32", "buffer", "buffer", "buffer", "buffer"],
|
|
14269
14406
|
returns: "void"
|
|
14270
14407
|
},
|
|
14271
14408
|
editorViewSetScrollMargin: {
|
|
@@ -14489,7 +14626,7 @@ function getOpenTUILib(libPath) {
|
|
|
14489
14626
|
returns: "u32"
|
|
14490
14627
|
},
|
|
14491
14628
|
editorViewGetCursor: {
|
|
14492
|
-
args: ["u32", "
|
|
14629
|
+
args: ["u32", "buffer", "buffer"],
|
|
14493
14630
|
returns: "void"
|
|
14494
14631
|
},
|
|
14495
14632
|
editorViewGetText: {
|
|
@@ -14545,7 +14682,7 @@ function getOpenTUILib(libPath) {
|
|
|
14545
14682
|
returns: "void"
|
|
14546
14683
|
},
|
|
14547
14684
|
editorViewSetTabIndicatorColor: {
|
|
14548
|
-
args: ["u32", "
|
|
14685
|
+
args: ["u32", "buffer"],
|
|
14549
14686
|
returns: "void"
|
|
14550
14687
|
},
|
|
14551
14688
|
getArenaAllocatedBytes: {
|
|
@@ -14584,21 +14721,21 @@ function getOpenTUILib(libPath) {
|
|
|
14584
14721
|
imageRetainIccCache: { args: [], returns: "void" },
|
|
14585
14722
|
imageReleaseIccCache: { args: [], returns: "void" },
|
|
14586
14723
|
imageTestFailIccProfileCopyAllocationOnce: { args: [], returns: "void" },
|
|
14587
|
-
imageDecode: { args: ["ptr", "u32", "
|
|
14588
|
-
imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "
|
|
14724
|
+
imageDecode: { args: ["ptr", "u32", "buffer"], returns: "u32" },
|
|
14725
|
+
imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "buffer"], returns: "u32" },
|
|
14589
14726
|
imageDestroy: { args: ["u32"], returns: "void" },
|
|
14590
|
-
imageRetain: { args: ["u32", "
|
|
14727
|
+
imageRetain: { args: ["u32", "buffer"], returns: "u32" },
|
|
14591
14728
|
imageGetInfo: { args: ["u32", "ptr"], returns: "u32" },
|
|
14592
14729
|
imageMaterialize: { args: ["u32"], returns: "u32" },
|
|
14593
14730
|
imageEnsureEncodedPng: { args: ["u32"], returns: "u32" },
|
|
14594
14731
|
imageGetPixelsPtr: { args: ["u32"], returns: "ptr" },
|
|
14595
|
-
imageClone: { args: ["u32", "
|
|
14732
|
+
imageClone: { args: ["u32", "buffer"], returns: "u32" },
|
|
14596
14733
|
imageCopyPixels: { args: ["u32", "ptr", "u64", "u32", "u8"], returns: "u32" },
|
|
14597
|
-
imageResize: { args: ["u32", "u32", "u32", "u32", "
|
|
14598
|
-
imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "
|
|
14599
|
-
imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "
|
|
14600
|
-
imageTransform: { args: ["u32", "u32", "
|
|
14601
|
-
imageComposite: { args: ["u32", "u32", "i32", "i32", "u32", "u8", "
|
|
14734
|
+
imageResize: { args: ["u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
|
|
14735
|
+
imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
|
|
14736
|
+
imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "buffer", "buffer"], returns: "u32" },
|
|
14737
|
+
imageTransform: { args: ["u32", "u32", "buffer"], returns: "u32" },
|
|
14738
|
+
imageComposite: { args: ["u32", "u32", "i32", "i32", "u32", "u8", "buffer"], returns: "u32" },
|
|
14602
14739
|
getTerminalCapabilities: {
|
|
14603
14740
|
args: ["u32", "ptr"],
|
|
14604
14741
|
returns: "void"
|
|
@@ -14616,7 +14753,7 @@ function getOpenTUILib(libPath) {
|
|
|
14616
14753
|
returns: "void"
|
|
14617
14754
|
},
|
|
14618
14755
|
bufferDrawChar: {
|
|
14619
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
14756
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
14620
14757
|
returns: "void"
|
|
14621
14758
|
},
|
|
14622
14759
|
yogaConfigCreate: {
|
|
@@ -14836,7 +14973,7 @@ function getOpenTUILib(libPath) {
|
|
|
14836
14973
|
returns: "u32"
|
|
14837
14974
|
},
|
|
14838
14975
|
audioGetPlaybackDeviceName: {
|
|
14839
|
-
args: ["u32", "u32", "
|
|
14976
|
+
args: ["u32", "u32", "buffer", "u32"],
|
|
14840
14977
|
returns: "u32"
|
|
14841
14978
|
},
|
|
14842
14979
|
audioIsPlaybackDeviceDefault: {
|
|
@@ -14860,7 +14997,7 @@ function getOpenTUILib(libPath) {
|
|
|
14860
14997
|
returns: "u32"
|
|
14861
14998
|
},
|
|
14862
14999
|
audioGetCaptureDeviceName: {
|
|
14863
|
-
args: ["u32", "u32", "
|
|
15000
|
+
args: ["u32", "u32", "buffer", "u32"],
|
|
14864
15001
|
returns: "u32"
|
|
14865
15002
|
},
|
|
14866
15003
|
audioIsCaptureDeviceDefault: {
|
|
@@ -14888,7 +15025,7 @@ function getOpenTUILib(libPath) {
|
|
|
14888
15025
|
returns: "bool"
|
|
14889
15026
|
},
|
|
14890
15027
|
audioReadCapture: {
|
|
14891
|
-
args: ["u32", "
|
|
15028
|
+
args: ["u32", "buffer", "u32", "u32", "ptr"],
|
|
14892
15029
|
returns: "i32"
|
|
14893
15030
|
},
|
|
14894
15031
|
audioGetCaptureStats: {
|
|
@@ -14944,7 +15081,7 @@ function getOpenTUILib(libPath) {
|
|
|
14944
15081
|
returns: "i32"
|
|
14945
15082
|
},
|
|
14946
15083
|
audioLoad: {
|
|
14947
|
-
args: ["u32", "
|
|
15084
|
+
args: ["u32", "buffer", "u32", "ptr"],
|
|
14948
15085
|
returns: "i32"
|
|
14949
15086
|
},
|
|
14950
15087
|
audioUnload: {
|
|
@@ -14964,7 +15101,7 @@ function getOpenTUILib(libPath) {
|
|
|
14964
15101
|
returns: "i32"
|
|
14965
15102
|
},
|
|
14966
15103
|
audioCreateGroup: {
|
|
14967
|
-
args: ["u32", "
|
|
15104
|
+
args: ["u32", "buffer", "u32", "ptr"],
|
|
14968
15105
|
returns: "i32"
|
|
14969
15106
|
},
|
|
14970
15107
|
audioSetGroupVolume: {
|
|
@@ -14976,7 +15113,7 @@ function getOpenTUILib(libPath) {
|
|
|
14976
15113
|
returns: "i32"
|
|
14977
15114
|
},
|
|
14978
15115
|
audioMixToBuffer: {
|
|
14979
|
-
args: ["u32", "
|
|
15116
|
+
args: ["u32", "buffer", "u32", "u8"],
|
|
14980
15117
|
returns: "i32"
|
|
14981
15118
|
},
|
|
14982
15119
|
audioEnableTap: {
|
|
@@ -14984,7 +15121,7 @@ function getOpenTUILib(libPath) {
|
|
|
14984
15121
|
returns: "i32"
|
|
14985
15122
|
},
|
|
14986
15123
|
audioReadTap: {
|
|
14987
|
-
args: ["u32", "
|
|
15124
|
+
args: ["u32", "buffer", "u32", "u8", "ptr"],
|
|
14988
15125
|
returns: "i32"
|
|
14989
15126
|
},
|
|
14990
15127
|
audioGetStats: {
|
|
@@ -15012,7 +15149,7 @@ function getOpenTUILib(libPath) {
|
|
|
15012
15149
|
returns: "i32"
|
|
15013
15150
|
},
|
|
15014
15151
|
streamDrainSpans: {
|
|
15015
|
-
args: ["ptr", "
|
|
15152
|
+
args: ["ptr", "buffer", "u32"],
|
|
15016
15153
|
returns: "u32"
|
|
15017
15154
|
},
|
|
15018
15155
|
streamClose: {
|
|
@@ -15199,7 +15336,6 @@ class FFIRenderLib {
|
|
|
15199
15336
|
opentui;
|
|
15200
15337
|
iccCacheClient = false;
|
|
15201
15338
|
yogaLayout = new Float32Array(6);
|
|
15202
|
-
yogaLayoutPtr = ptr(this.yogaLayout);
|
|
15203
15339
|
ffiStructStorage = {
|
|
15204
15340
|
logicalCursor: {
|
|
15205
15341
|
...allocStruct(LogicalCursorStruct),
|
|
@@ -15219,6 +15355,8 @@ class FFIRenderLib {
|
|
|
15219
15355
|
...allocStruct(MeasureResultStruct),
|
|
15220
15356
|
result: { lineCount: 0, widthColsMax: 0 }
|
|
15221
15357
|
},
|
|
15358
|
+
embeddedTerminalCursor: allocStruct(EmbeddedTerminalCursorStruct),
|
|
15359
|
+
embeddedTerminalKeyOptions: allocStruct(EmbeddedTerminalKeyOptionsStruct),
|
|
15222
15360
|
audioStreamStats: {
|
|
15223
15361
|
...allocStruct(AudioStreamStatsStruct),
|
|
15224
15362
|
result: {
|
|
@@ -15264,6 +15402,134 @@ class FFIRenderLib {
|
|
|
15264
15402
|
nativeRenderableSetMeasureTarget(handle, kind, target) {
|
|
15265
15403
|
return Boolean(this.opentui.symbols.nativeRenderableSetMeasureTarget(handle, kind, target));
|
|
15266
15404
|
}
|
|
15405
|
+
createEmbeddedTerminal(options) {
|
|
15406
|
+
const cols = embeddedTerminalDimension(options.cols, "columns");
|
|
15407
|
+
const rows = embeddedTerminalDimension(options.rows, "rows");
|
|
15408
|
+
const maxScrollback = toSafeFFIU32Length(options.maxScrollback ?? 1e4, "Embedded terminal maxScrollback");
|
|
15409
|
+
const out = new Uint32Array(1);
|
|
15410
|
+
embeddedTerminalResult(this.opentui.symbols.createEmbeddedTerminal(cols, rows, maxScrollback, out), "creation");
|
|
15411
|
+
if (!out[0])
|
|
15412
|
+
throw new Error("Embedded terminal creation returned an invalid handle");
|
|
15413
|
+
return out[0];
|
|
15414
|
+
}
|
|
15415
|
+
destroyEmbeddedTerminal(handle) {
|
|
15416
|
+
this.opentui.symbols.destroyEmbeddedTerminal(handle);
|
|
15417
|
+
}
|
|
15418
|
+
embeddedTerminalWrite(handle, data) {
|
|
15419
|
+
const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
|
|
15420
|
+
const length = toSafeFFIU32Length(bytes.byteLength, "Embedded terminal write length");
|
|
15421
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalWrite(handle, length === 0 ? null : bytes, length), "write");
|
|
15422
|
+
}
|
|
15423
|
+
embeddedTerminalResize(handle, cols, rows) {
|
|
15424
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalResize(handle, embeddedTerminalDimension(cols, "columns"), embeddedTerminalDimension(rows, "rows")), "resize");
|
|
15425
|
+
}
|
|
15426
|
+
embeddedTerminalInvalidate(handle) {
|
|
15427
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalInvalidate(handle), "invalidation");
|
|
15428
|
+
}
|
|
15429
|
+
embeddedTerminalScroll(handle, delta) {
|
|
15430
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalScroll(handle, embeddedTerminalI32(delta, "scroll delta")), "scroll");
|
|
15431
|
+
}
|
|
15432
|
+
embeddedTerminalSetSelection(handle, start, end) {
|
|
15433
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalSetSelection(handle, embeddedTerminalDimension(start.x + 1, "selection start x") - 1, embeddedTerminalDimension(start.y + 1, "selection start y") - 1, embeddedTerminalDimension(end.x + 1, "selection end x") - 1, embeddedTerminalDimension(end.y + 1, "selection end y") - 1), "selection update");
|
|
15434
|
+
}
|
|
15435
|
+
embeddedTerminalClearSelection(handle) {
|
|
15436
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalClearSelection(handle), "selection clear");
|
|
15437
|
+
}
|
|
15438
|
+
embeddedTerminalGetSelectedText(handle) {
|
|
15439
|
+
const required = new Uint32Array(1);
|
|
15440
|
+
const read = (output2) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output2), output2.byteLength, required);
|
|
15441
|
+
const initial = new Uint8Array(256);
|
|
15442
|
+
const status = read(initial);
|
|
15443
|
+
if (status >= 0)
|
|
15444
|
+
return initial.slice(0, status);
|
|
15445
|
+
if (status !== -4 || required[0] <= initial.byteLength)
|
|
15446
|
+
embeddedTerminalResult(status, "selection query");
|
|
15447
|
+
const output = new Uint8Array(required[0]);
|
|
15448
|
+
const length = embeddedTerminalResult(read(output), "selection query");
|
|
15449
|
+
return output.slice(0, length);
|
|
15450
|
+
}
|
|
15451
|
+
embeddedTerminalCompose(handle, target, x, y) {
|
|
15452
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCompose(handle, target, embeddedTerminalI32(x, "composition x"), embeddedTerminalI32(y, "composition y")), "compose");
|
|
15453
|
+
}
|
|
15454
|
+
embeddedTerminalCursor(handle) {
|
|
15455
|
+
const storage = this.ffiStructStorage.embeddedTerminalCursor;
|
|
15456
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.buffer), "cursor query");
|
|
15457
|
+
const result = EmbeddedTerminalCursorStruct.unpack(storage.buffer);
|
|
15458
|
+
return {
|
|
15459
|
+
x: result.x,
|
|
15460
|
+
y: result.y,
|
|
15461
|
+
hasValue: result.hasValue,
|
|
15462
|
+
visible: result.visible,
|
|
15463
|
+
blinking: result.blinking,
|
|
15464
|
+
wideTail: result.wideTail,
|
|
15465
|
+
style: ["bar", "block", "underline", "block-hollow"][result.style] ?? "block",
|
|
15466
|
+
...result.colorHasValue ? { color: { r: result.colorR, g: result.colorG, b: result.colorB } } : {}
|
|
15467
|
+
};
|
|
15468
|
+
}
|
|
15469
|
+
embeddedTerminalEncodeKey(handle, key) {
|
|
15470
|
+
const options = this.ffiStructStorage.embeddedTerminalKeyOptions;
|
|
15471
|
+
EmbeddedTerminalKeyOptionsStruct.packInto({
|
|
15472
|
+
action: { release: 0, press: 1, repeat: 2 }[key.action ?? "press"],
|
|
15473
|
+
composing: key.composing ? 1 : 0,
|
|
15474
|
+
mods: key.mods ?? 0,
|
|
15475
|
+
consumedMods: key.consumedMods ?? 0,
|
|
15476
|
+
padding: 0,
|
|
15477
|
+
unshiftedCodepoint: key.unshiftedCodepoint ?? 0
|
|
15478
|
+
}, options.view, 0);
|
|
15479
|
+
const keyCode = key.key ? this.encoder.encode(key.key) : new Uint8Array;
|
|
15480
|
+
const keyCodeLength = toSafeFFIU32Length(keyCode.byteLength, "Embedded terminal physical key length");
|
|
15481
|
+
const text = key.text ? this.encoder.encode(key.text) : new Uint8Array;
|
|
15482
|
+
const textLength = toSafeFFIU32Length(text.byteLength, "Embedded terminal key text length");
|
|
15483
|
+
const required = new Uint32Array(1);
|
|
15484
|
+
const encode = (output2) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.buffer, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output2, output2.byteLength, required);
|
|
15485
|
+
const initial = new Uint8Array(Math.max(64, textLength));
|
|
15486
|
+
const status = encode(initial);
|
|
15487
|
+
if (status >= 0)
|
|
15488
|
+
return initial.slice(0, status);
|
|
15489
|
+
if (status !== -4 || required[0] <= initial.byteLength)
|
|
15490
|
+
embeddedTerminalResult(status, "key encoding");
|
|
15491
|
+
const output = new Uint8Array(required[0]);
|
|
15492
|
+
const length = embeddedTerminalResult(encode(output), "key encoding");
|
|
15493
|
+
return output.slice(0, length);
|
|
15494
|
+
}
|
|
15495
|
+
embeddedTerminalEncodeMouse(handle, mouse) {
|
|
15496
|
+
const output = new Uint8Array(128);
|
|
15497
|
+
const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodeMouse(handle, { press: 0, release: 1, motion: 2 }[mouse.action], mouse.button ? { unknown: 0, left: 1, right: 2, middle: 3, four: 4, five: 5, six: 6, seven: 7 }[mouse.button] : -1, mouse.mods ?? 0, embeddedTerminalF32(mouse.x, "mouse x"), embeddedTerminalF32(mouse.y, "mouse y"), mouse.anyButtonPressed ? 1 : 0, output, output.byteLength), "mouse encoding");
|
|
15498
|
+
return output.slice(0, length);
|
|
15499
|
+
}
|
|
15500
|
+
embeddedTerminalEncodePaste(handle, input) {
|
|
15501
|
+
const inputLength = toSafeFFIU32Length(input.byteLength, "Embedded terminal paste length");
|
|
15502
|
+
const outputLength = toSafeFFIU32Length(inputLength + 16, "Embedded terminal paste output length");
|
|
15503
|
+
const output = new Uint8Array(outputLength);
|
|
15504
|
+
const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodePaste(handle, inputLength === 0 ? null : input, inputLength, output, output.byteLength), "paste encoding");
|
|
15505
|
+
return output.slice(0, length);
|
|
15506
|
+
}
|
|
15507
|
+
embeddedTerminalEncodeFocus(handle, focused) {
|
|
15508
|
+
const output = new Uint8Array(16);
|
|
15509
|
+
const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodeFocus(handle, focused ? 1 : 0, output, output.byteLength), "focus encoding");
|
|
15510
|
+
return output.slice(0, length);
|
|
15511
|
+
}
|
|
15512
|
+
embeddedTerminalDrainResponses(handle) {
|
|
15513
|
+
const chunks = [];
|
|
15514
|
+
while (true) {
|
|
15515
|
+
const output = new Uint8Array(64 * 1024);
|
|
15516
|
+
const status = this.opentui.symbols.embeddedTerminalDrainResponses(handle, output, output.byteLength);
|
|
15517
|
+
if (status === -4)
|
|
15518
|
+
continue;
|
|
15519
|
+
const length = embeddedTerminalResult(status, "response drain");
|
|
15520
|
+
if (length > 0)
|
|
15521
|
+
chunks.push(output.slice(0, length));
|
|
15522
|
+
if (length < output.byteLength)
|
|
15523
|
+
break;
|
|
15524
|
+
}
|
|
15525
|
+
const result = new Uint8Array(chunks.reduce((total, chunk) => total + chunk.byteLength, 0));
|
|
15526
|
+
let offset = 0;
|
|
15527
|
+
for (const chunk of chunks) {
|
|
15528
|
+
result.set(chunk, offset);
|
|
15529
|
+
offset += chunk.byteLength;
|
|
15530
|
+
}
|
|
15531
|
+
return result;
|
|
15532
|
+
}
|
|
15267
15533
|
constructor(libPath) {
|
|
15268
15534
|
this.opentui = getOpenTUILib(libPath);
|
|
15269
15535
|
this.imageRetainIccCache();
|
|
@@ -15417,7 +15683,7 @@ class FFIRenderLib {
|
|
|
15417
15683
|
setTerminalEnvVar(renderer, key, value) {
|
|
15418
15684
|
const keyBytes = this.encoder.encode(key);
|
|
15419
15685
|
const valueBytes = this.encoder.encode(value);
|
|
15420
|
-
return this.opentui.symbols.setTerminalEnvVar(renderer,
|
|
15686
|
+
return this.opentui.symbols.setTerminalEnvVar(renderer, viewOrNull(keyBytes), keyBytes.byteLength, viewOrNull(valueBytes), valueBytes.byteLength);
|
|
15421
15687
|
}
|
|
15422
15688
|
destroyRenderer(renderer, flushInput = false) {
|
|
15423
15689
|
this.opentui.symbols.destroyRenderer(renderer, ffiBool(flushInput));
|
|
@@ -15429,7 +15695,7 @@ class FFIRenderLib {
|
|
|
15429
15695
|
this.opentui.symbols.setClearOnShutdown(renderer, ffiBool(clear));
|
|
15430
15696
|
}
|
|
15431
15697
|
setBackgroundColor(renderer, color) {
|
|
15432
|
-
this.opentui.symbols.setBackgroundColor(renderer,
|
|
15698
|
+
this.opentui.symbols.setBackgroundColor(renderer, rgbaBuffer(color));
|
|
15433
15699
|
}
|
|
15434
15700
|
setRenderOffset(renderer, offset) {
|
|
15435
15701
|
this.opentui.symbols.setRenderOffset(renderer, offset);
|
|
@@ -15457,7 +15723,7 @@ class FFIRenderLib {
|
|
|
15457
15723
|
}
|
|
15458
15724
|
getRenderStats(renderer) {
|
|
15459
15725
|
const statsBuffer = new ArrayBuffer(NativeRenderStatsStruct.size);
|
|
15460
|
-
this.opentui.symbols.getRenderStats(renderer,
|
|
15726
|
+
this.opentui.symbols.getRenderStats(renderer, statsBuffer);
|
|
15461
15727
|
const stats = NativeRenderStatsStruct.unpack(statsBuffer);
|
|
15462
15728
|
return {
|
|
15463
15729
|
nativeLastFrameTime: stats.lastFrameTime,
|
|
@@ -15492,7 +15758,7 @@ class FFIRenderLib {
|
|
|
15492
15758
|
for (let index = 0;index < palette.length; index++) {
|
|
15493
15759
|
paletteBuffer.set(palette[index].buffer, index * 4);
|
|
15494
15760
|
}
|
|
15495
|
-
this.opentui.symbols.rendererSetPaletteState(renderer,
|
|
15761
|
+
this.opentui.symbols.rendererSetPaletteState(renderer, paletteBuffer, palette.length, rgbaBuffer(defaultForeground), rgbaBuffer(defaultBackground), paletteEpoch >>> 0);
|
|
15496
15762
|
}
|
|
15497
15763
|
bufferGetCharPtr(buffer) {
|
|
15498
15764
|
const ptr3 = this.opentui.symbols.bufferGetCharPtr(buffer);
|
|
@@ -15531,14 +15797,14 @@ class FFIRenderLib {
|
|
|
15531
15797
|
bufferGetId(buffer) {
|
|
15532
15798
|
const maxLen = 256;
|
|
15533
15799
|
const outBuffer = new Uint8Array(maxLen);
|
|
15534
|
-
const actualLen = this.opentui.symbols.bufferGetId(buffer,
|
|
15800
|
+
const actualLen = this.opentui.symbols.bufferGetId(buffer, outBuffer, maxLen);
|
|
15535
15801
|
return this.decoder.decode(outBuffer.slice(0, actualLen));
|
|
15536
15802
|
}
|
|
15537
15803
|
bufferGetRealCharSize(buffer) {
|
|
15538
15804
|
return this.opentui.symbols.bufferGetRealCharSize(buffer);
|
|
15539
15805
|
}
|
|
15540
15806
|
bufferWriteResolvedChars(buffer, outputBuffer, addLineBreaks) {
|
|
15541
|
-
return this.opentui.symbols.bufferWriteResolvedChars(buffer,
|
|
15807
|
+
return this.opentui.symbols.bufferWriteResolvedChars(buffer, viewOrNull(outputBuffer), outputBuffer.byteLength, ffiBool(addLineBreaks));
|
|
15542
15808
|
}
|
|
15543
15809
|
getBufferWidth(buffer) {
|
|
15544
15810
|
return this.opentui.symbols.getBufferWidth(buffer);
|
|
@@ -15547,39 +15813,39 @@ class FFIRenderLib {
|
|
|
15547
15813
|
return this.opentui.symbols.getBufferHeight(buffer);
|
|
15548
15814
|
}
|
|
15549
15815
|
bufferClear(buffer, color) {
|
|
15550
|
-
this.opentui.symbols.bufferClear(buffer,
|
|
15816
|
+
this.opentui.symbols.bufferClear(buffer, rgbaBuffer(color));
|
|
15551
15817
|
}
|
|
15552
15818
|
bufferDrawText(buffer, text, x, y, color, bgColor, attributes) {
|
|
15553
15819
|
const textBytes = this.encoder.encode(text);
|
|
15554
|
-
const bg2 =
|
|
15555
|
-
const fg2 =
|
|
15556
|
-
this.opentui.symbols.bufferDrawText(buffer,
|
|
15820
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
15821
|
+
const fg2 = rgbaBuffer(color);
|
|
15822
|
+
this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg2, bg2, attributes ?? 0);
|
|
15557
15823
|
}
|
|
15558
15824
|
bufferSetCellWithAlphaBlending(buffer, x, y, char, color, bgColor, attributes) {
|
|
15559
15825
|
const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
|
|
15560
|
-
const bg2 =
|
|
15561
|
-
const fg2 =
|
|
15826
|
+
const bg2 = rgbaBuffer(bgColor);
|
|
15827
|
+
const fg2 = rgbaBuffer(color);
|
|
15562
15828
|
this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
|
|
15563
15829
|
}
|
|
15564
15830
|
bufferSetCell(buffer, x, y, char, color, bgColor, attributes) {
|
|
15565
15831
|
const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
|
|
15566
|
-
const bg2 =
|
|
15567
|
-
const fg2 =
|
|
15832
|
+
const bg2 = rgbaBuffer(bgColor);
|
|
15833
|
+
const fg2 = rgbaBuffer(color);
|
|
15568
15834
|
this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
|
|
15569
15835
|
}
|
|
15570
15836
|
bufferFillRect(buffer, x, y, width, height, color) {
|
|
15571
|
-
const bg2 =
|
|
15837
|
+
const bg2 = rgbaBuffer(color);
|
|
15572
15838
|
this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg2);
|
|
15573
15839
|
}
|
|
15574
|
-
bufferColorMatrix(buffer,
|
|
15575
|
-
this.opentui.symbols.bufferColorMatrix(buffer,
|
|
15840
|
+
bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target) {
|
|
15841
|
+
this.opentui.symbols.bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target);
|
|
15576
15842
|
}
|
|
15577
|
-
bufferColorMatrixUniform(buffer,
|
|
15578
|
-
this.opentui.symbols.bufferColorMatrixUniform(buffer,
|
|
15843
|
+
bufferColorMatrixUniform(buffer, matrix, strength, target) {
|
|
15844
|
+
this.opentui.symbols.bufferColorMatrixUniform(buffer, matrix, strength, target);
|
|
15579
15845
|
}
|
|
15580
|
-
bufferDrawSuperSampleBuffer(buffer, x, y,
|
|
15846
|
+
bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
|
|
15581
15847
|
const formatId = format === "bgra8unorm" ? 0 : 1;
|
|
15582
|
-
this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y,
|
|
15848
|
+
this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, formatId, alignedBytesPerRow);
|
|
15583
15849
|
}
|
|
15584
15850
|
bufferDrawImage(buffer, image, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol) {
|
|
15585
15851
|
const protocolId = { auto: 0, kitty: 1, sixel: 2, blocks: 3 }[protocol];
|
|
@@ -15599,38 +15865,38 @@ class FFIRenderLib {
|
|
|
15599
15865
|
}, storage.view, 0);
|
|
15600
15866
|
return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.buffer));
|
|
15601
15867
|
}
|
|
15602
|
-
bufferDrawPackedBuffer(buffer,
|
|
15603
|
-
this.opentui.symbols.bufferDrawPackedBuffer(buffer,
|
|
15868
|
+
bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
|
|
15869
|
+
this.opentui.symbols.bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
|
|
15604
15870
|
}
|
|
15605
|
-
bufferDrawGrayscaleBuffer(buffer, posX, posY,
|
|
15606
|
-
this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY,
|
|
15871
|
+
bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
|
|
15872
|
+
this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
|
|
15607
15873
|
}
|
|
15608
|
-
bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY,
|
|
15609
|
-
this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY,
|
|
15874
|
+
bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
|
|
15875
|
+
this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
|
|
15610
15876
|
}
|
|
15611
15877
|
bufferDrawGrid(buffer, borderChars, borderFg, borderBg, columnOffsets, columnCount, rowOffsets, rowCount, options) {
|
|
15612
15878
|
GridDrawOptionsStruct.packInto({ drawInner: options.drawInner, drawOuter: options.drawOuter }, this.ffiStructStorage.gridDrawOptions.view, 0);
|
|
15613
|
-
this.opentui.symbols.bufferDrawGrid(buffer,
|
|
15879
|
+
this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
|
|
15614
15880
|
}
|
|
15615
15881
|
bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
|
|
15616
15882
|
const titleBytes = title ? this.encoder.encode(title) : null;
|
|
15617
15883
|
const titleLen = titleBytes?.byteLength ?? 0;
|
|
15618
|
-
const
|
|
15884
|
+
const titleBuffer = titleBytes ? titleBytes : null;
|
|
15619
15885
|
const bottomTitleBytes = bottomTitle ? this.encoder.encode(bottomTitle) : null;
|
|
15620
15886
|
const bottomTitleLen = bottomTitleBytes?.byteLength ?? 0;
|
|
15621
|
-
const
|
|
15622
|
-
this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height,
|
|
15887
|
+
const bottomTitleBuffer = bottomTitleBytes ? bottomTitleBytes : null;
|
|
15888
|
+
this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, rgbaBuffer(borderColor), rgbaBuffer(backgroundColor), rgbaBuffer(titleColor), titleBuffer, titleLen, bottomTitleBuffer, bottomTitleLen);
|
|
15623
15889
|
}
|
|
15624
15890
|
bufferResize(buffer, width, height) {
|
|
15625
15891
|
this.opentui.symbols.bufferResize(buffer, width, height);
|
|
15626
15892
|
}
|
|
15627
15893
|
linkAlloc(url) {
|
|
15628
15894
|
const urlBytes = this.encoder.encode(url);
|
|
15629
|
-
return this.opentui.symbols.linkAlloc(
|
|
15895
|
+
return this.opentui.symbols.linkAlloc(viewOrNull(urlBytes), urlBytes.byteLength);
|
|
15630
15896
|
}
|
|
15631
15897
|
linkGetUrl(linkId, maxLen = 512) {
|
|
15632
15898
|
const outBuffer = new Uint8Array(maxLen);
|
|
15633
|
-
const actualLen = this.opentui.symbols.linkGetUrl(linkId,
|
|
15899
|
+
const actualLen = this.opentui.symbols.linkGetUrl(linkId, viewOrNull(outBuffer), maxLen);
|
|
15634
15900
|
return this.decoder.decode(outBuffer.slice(0, actualLen));
|
|
15635
15901
|
}
|
|
15636
15902
|
attributesWithLink(baseAttributes, linkId) {
|
|
@@ -15646,11 +15912,11 @@ class FFIRenderLib {
|
|
|
15646
15912
|
this.opentui.symbols.setCursorPosition(renderer, x, y, ffiBool(visible));
|
|
15647
15913
|
}
|
|
15648
15914
|
setCursorColor(renderer, color) {
|
|
15649
|
-
this.opentui.symbols.setCursorColor(renderer,
|
|
15915
|
+
this.opentui.symbols.setCursorColor(renderer, rgbaBuffer(color));
|
|
15650
15916
|
}
|
|
15651
15917
|
getCursorState(renderer) {
|
|
15652
15918
|
const cursorBuffer = new ArrayBuffer(CursorStateStruct.size);
|
|
15653
|
-
this.opentui.symbols.getCursorState(renderer,
|
|
15919
|
+
this.opentui.symbols.getCursorState(renderer, cursorBuffer);
|
|
15654
15920
|
const struct = CursorStateStruct.unpack(cursorBuffer);
|
|
15655
15921
|
return {
|
|
15656
15922
|
x: struct.x,
|
|
@@ -15691,7 +15957,7 @@ class FFIRenderLib {
|
|
|
15691
15957
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
15692
15958
|
const idToUse = id || "unnamed buffer";
|
|
15693
15959
|
const idBytes = this.encoder.encode(idToUse);
|
|
15694
|
-
const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode,
|
|
15960
|
+
const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode, idBytes, idBytes.byteLength);
|
|
15695
15961
|
if (!bufferPtr) {
|
|
15696
15962
|
throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
|
|
15697
15963
|
}
|
|
@@ -15715,12 +15981,12 @@ class FFIRenderLib {
|
|
|
15715
15981
|
}
|
|
15716
15982
|
setTerminalTitle(renderer, title) {
|
|
15717
15983
|
const titleBytes = this.encoder.encode(title);
|
|
15718
|
-
this.opentui.symbols.setTerminalTitle(renderer,
|
|
15984
|
+
this.opentui.symbols.setTerminalTitle(renderer, viewOrNull(titleBytes), titleBytes.byteLength);
|
|
15719
15985
|
}
|
|
15720
15986
|
copyToClipboardOSC52(renderer, target, textUtf8) {
|
|
15721
15987
|
if (textUtf8.byteLength > 4294967295)
|
|
15722
15988
|
return false;
|
|
15723
|
-
return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target,
|
|
15989
|
+
return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target, viewOrNull(textUtf8), textUtf8.byteLength));
|
|
15724
15990
|
}
|
|
15725
15991
|
clearClipboardOSC52(renderer, target) {
|
|
15726
15992
|
return Boolean(this.opentui.symbols.clearClipboardOSC52(renderer, target));
|
|
@@ -15895,7 +16161,7 @@ class FFIRenderLib {
|
|
|
15895
16161
|
const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data;
|
|
15896
16162
|
if (bytes.length === 0)
|
|
15897
16163
|
return;
|
|
15898
|
-
this.opentui.symbols.writeOut(renderer,
|
|
16164
|
+
this.opentui.symbols.writeOut(renderer, viewOrNull(bytes), bytes.byteLength);
|
|
15899
16165
|
}
|
|
15900
16166
|
yogaConfigCreate() {
|
|
15901
16167
|
const config = this.opentui.symbols.yogaConfigCreate();
|
|
@@ -16007,7 +16273,7 @@ class FFIRenderLib {
|
|
|
16007
16273
|
}
|
|
16008
16274
|
yogaNodeGetComputedLayout(node) {
|
|
16009
16275
|
const layout = this.yogaLayout;
|
|
16010
|
-
this.opentui.symbols.yogaNodeGetComputedLayout(node, this.
|
|
16276
|
+
this.opentui.symbols.yogaNodeGetComputedLayout(node, this.yogaLayout);
|
|
16011
16277
|
return {
|
|
16012
16278
|
left: layout[0],
|
|
16013
16279
|
top: layout[1],
|
|
@@ -16104,16 +16370,16 @@ class FFIRenderLib {
|
|
|
16104
16370
|
this.opentui.symbols.textBufferClear(buffer);
|
|
16105
16371
|
}
|
|
16106
16372
|
textBufferSetDefaultFg(buffer, fg2) {
|
|
16107
|
-
const
|
|
16108
|
-
this.opentui.symbols.textBufferSetDefaultFg(buffer,
|
|
16373
|
+
const fgBuffer = optionalRgbaBuffer(fg2);
|
|
16374
|
+
this.opentui.symbols.textBufferSetDefaultFg(buffer, fgBuffer);
|
|
16109
16375
|
}
|
|
16110
16376
|
textBufferSetDefaultBg(buffer, bg2) {
|
|
16111
|
-
const
|
|
16112
|
-
this.opentui.symbols.textBufferSetDefaultBg(buffer,
|
|
16377
|
+
const bgBuffer = optionalRgbaBuffer(bg2);
|
|
16378
|
+
this.opentui.symbols.textBufferSetDefaultBg(buffer, bgBuffer);
|
|
16113
16379
|
}
|
|
16114
16380
|
textBufferSetDefaultAttributes(buffer, attributes) {
|
|
16115
16381
|
const attrValue = attributes === null ? null : new Uint32Array([attributes]);
|
|
16116
|
-
this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue
|
|
16382
|
+
this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue);
|
|
16117
16383
|
}
|
|
16118
16384
|
textBufferResetDefaults(buffer) {
|
|
16119
16385
|
this.opentui.symbols.textBufferResetDefaults(buffer);
|
|
@@ -16125,14 +16391,14 @@ class FFIRenderLib {
|
|
|
16125
16391
|
this.opentui.symbols.textBufferSetTabWidth(buffer, width);
|
|
16126
16392
|
}
|
|
16127
16393
|
textBufferRegisterMemBuffer(buffer, bytes, owned = false) {
|
|
16128
|
-
const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer,
|
|
16394
|
+
const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
|
|
16129
16395
|
if (result === 65535) {
|
|
16130
16396
|
throw new Error("Failed to register memory buffer");
|
|
16131
16397
|
}
|
|
16132
16398
|
return result;
|
|
16133
16399
|
}
|
|
16134
16400
|
textBufferReplaceMemBuffer(buffer, memId, bytes, owned = false) {
|
|
16135
|
-
return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId,
|
|
16401
|
+
return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
|
|
16136
16402
|
}
|
|
16137
16403
|
textBufferClearMemRegistry(buffer) {
|
|
16138
16404
|
this.opentui.symbols.textBufferClearMemRegistry(buffer);
|
|
@@ -16141,14 +16407,14 @@ class FFIRenderLib {
|
|
|
16141
16407
|
this.opentui.symbols.textBufferSetTextFromMem(buffer, memId);
|
|
16142
16408
|
}
|
|
16143
16409
|
textBufferAppend(buffer, bytes) {
|
|
16144
|
-
this.opentui.symbols.textBufferAppend(buffer,
|
|
16410
|
+
this.opentui.symbols.textBufferAppend(buffer, retainedPtrOrNull(bytes), bytes.byteLength);
|
|
16145
16411
|
}
|
|
16146
16412
|
textBufferAppendFromMemId(buffer, memId) {
|
|
16147
16413
|
this.opentui.symbols.textBufferAppendFromMemId(buffer, memId);
|
|
16148
16414
|
}
|
|
16149
16415
|
textBufferLoadFile(buffer, path3) {
|
|
16150
16416
|
const pathBytes = this.encoder.encode(path3);
|
|
16151
|
-
return this.opentui.symbols.textBufferLoadFile(buffer,
|
|
16417
|
+
return this.opentui.symbols.textBufferLoadFile(buffer, viewOrNull(pathBytes), pathBytes.byteLength);
|
|
16152
16418
|
}
|
|
16153
16419
|
textBufferSetStyledText(buffer, chunks) {
|
|
16154
16420
|
if (chunks.length === 0) {
|
|
@@ -16161,12 +16427,12 @@ class FFIRenderLib {
|
|
|
16161
16427
|
textBufferGetLineCount(buffer) {
|
|
16162
16428
|
return this.opentui.symbols.textBufferGetLineCount(buffer);
|
|
16163
16429
|
}
|
|
16164
|
-
textBufferGetPlainText(buffer,
|
|
16165
|
-
return this.opentui.symbols.textBufferGetPlainText(buffer,
|
|
16430
|
+
textBufferGetPlainText(buffer, outBuffer, maxLen) {
|
|
16431
|
+
return this.opentui.symbols.textBufferGetPlainText(buffer, outBuffer, maxLen);
|
|
16166
16432
|
}
|
|
16167
16433
|
getPlainTextBytes(buffer, maxLength) {
|
|
16168
16434
|
const outBuffer = new Uint8Array(maxLength);
|
|
16169
|
-
const actualLen = this.textBufferGetPlainText(buffer,
|
|
16435
|
+
const actualLen = this.textBufferGetPlainText(buffer, viewOrNull(outBuffer), maxLength);
|
|
16170
16436
|
if (actualLen === 0) {
|
|
16171
16437
|
return null;
|
|
16172
16438
|
}
|
|
@@ -16174,7 +16440,7 @@ class FFIRenderLib {
|
|
|
16174
16440
|
}
|
|
16175
16441
|
textBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
|
|
16176
16442
|
const outBuffer = new Uint8Array(maxLength);
|
|
16177
|
-
const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset,
|
|
16443
|
+
const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
|
|
16178
16444
|
const len = actualLen;
|
|
16179
16445
|
if (len === 0) {
|
|
16180
16446
|
return null;
|
|
@@ -16183,7 +16449,7 @@ class FFIRenderLib {
|
|
|
16183
16449
|
}
|
|
16184
16450
|
textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
|
|
16185
16451
|
const outBuffer = new Uint8Array(maxLength);
|
|
16186
|
-
const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol,
|
|
16452
|
+
const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, viewOrNull(outBuffer), maxLength);
|
|
16187
16453
|
const len = actualLen;
|
|
16188
16454
|
if (len === 0) {
|
|
16189
16455
|
return null;
|
|
@@ -16201,8 +16467,8 @@ class FFIRenderLib {
|
|
|
16201
16467
|
this.opentui.symbols.destroyTextBufferView(view);
|
|
16202
16468
|
}
|
|
16203
16469
|
textBufferViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
16204
|
-
const bg2 =
|
|
16205
|
-
const fg2 =
|
|
16470
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16471
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16206
16472
|
this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg2, fg2);
|
|
16207
16473
|
}
|
|
16208
16474
|
textBufferViewResetSelection(view) {
|
|
@@ -16221,18 +16487,18 @@ class FFIRenderLib {
|
|
|
16221
16487
|
return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
|
|
16222
16488
|
}
|
|
16223
16489
|
textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16224
|
-
const bg2 =
|
|
16225
|
-
const fg2 =
|
|
16490
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16491
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16226
16492
|
return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16227
16493
|
}
|
|
16228
16494
|
textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16229
|
-
const bg2 =
|
|
16230
|
-
const fg2 =
|
|
16495
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16496
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16231
16497
|
this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
|
|
16232
16498
|
}
|
|
16233
16499
|
textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16234
|
-
const bg2 =
|
|
16235
|
-
const fg2 =
|
|
16500
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16501
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16236
16502
|
return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16237
16503
|
}
|
|
16238
16504
|
textBufferViewResetLocalSelection(view) {
|
|
@@ -16256,7 +16522,7 @@ class FFIRenderLib {
|
|
|
16256
16522
|
}
|
|
16257
16523
|
textBufferViewGetLineInfo(view) {
|
|
16258
16524
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16259
|
-
this.textBufferViewGetLineInfoDirect(view,
|
|
16525
|
+
this.textBufferViewGetLineInfoDirect(view, outBuffer);
|
|
16260
16526
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16261
16527
|
const lineStartCols = struct.startCols;
|
|
16262
16528
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16271,7 +16537,7 @@ class FFIRenderLib {
|
|
|
16271
16537
|
}
|
|
16272
16538
|
textBufferViewGetLogicalLineInfo(view) {
|
|
16273
16539
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16274
|
-
this.textBufferViewGetLogicalLineInfoDirect(view,
|
|
16540
|
+
this.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16275
16541
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16276
16542
|
const lineStartCols = struct.startCols;
|
|
16277
16543
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16287,21 +16553,21 @@ class FFIRenderLib {
|
|
|
16287
16553
|
textBufferViewGetVirtualLineCount(view) {
|
|
16288
16554
|
return this.opentui.symbols.textBufferViewGetVirtualLineCount(view);
|
|
16289
16555
|
}
|
|
16290
|
-
textBufferViewGetLineInfoDirect(view,
|
|
16291
|
-
this.opentui.symbols.textBufferViewGetLineInfoDirect(view,
|
|
16556
|
+
textBufferViewGetLineInfoDirect(view, outBuffer) {
|
|
16557
|
+
this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outBuffer);
|
|
16292
16558
|
}
|
|
16293
|
-
textBufferViewGetLogicalLineInfoDirect(view,
|
|
16294
|
-
this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view,
|
|
16559
|
+
textBufferViewGetLogicalLineInfoDirect(view, outBuffer) {
|
|
16560
|
+
this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16295
16561
|
}
|
|
16296
|
-
textBufferViewGetSelectedText(view,
|
|
16297
|
-
return this.opentui.symbols.textBufferViewGetSelectedText(view,
|
|
16562
|
+
textBufferViewGetSelectedText(view, outBuffer, maxLen) {
|
|
16563
|
+
return this.opentui.symbols.textBufferViewGetSelectedText(view, outBuffer, maxLen);
|
|
16298
16564
|
}
|
|
16299
|
-
textBufferViewGetPlainText(view,
|
|
16300
|
-
return this.opentui.symbols.textBufferViewGetPlainText(view,
|
|
16565
|
+
textBufferViewGetPlainText(view, outBuffer, maxLen) {
|
|
16566
|
+
return this.opentui.symbols.textBufferViewGetPlainText(view, outBuffer, maxLen);
|
|
16301
16567
|
}
|
|
16302
16568
|
textBufferViewGetSelectedTextBytes(view, maxLength) {
|
|
16303
16569
|
const outBuffer = new Uint8Array(maxLength);
|
|
16304
|
-
const actualLen = this.textBufferViewGetSelectedText(view,
|
|
16570
|
+
const actualLen = this.textBufferViewGetSelectedText(view, viewOrNull(outBuffer), maxLength);
|
|
16305
16571
|
if (actualLen === 0) {
|
|
16306
16572
|
return null;
|
|
16307
16573
|
}
|
|
@@ -16309,7 +16575,7 @@ class FFIRenderLib {
|
|
|
16309
16575
|
}
|
|
16310
16576
|
textBufferViewGetPlainTextBytes(view, maxLength) {
|
|
16311
16577
|
const outBuffer = new Uint8Array(maxLength);
|
|
16312
|
-
const actualLen = this.textBufferViewGetPlainText(view,
|
|
16578
|
+
const actualLen = this.textBufferViewGetPlainText(view, viewOrNull(outBuffer), maxLength);
|
|
16313
16579
|
if (actualLen === 0) {
|
|
16314
16580
|
return null;
|
|
16315
16581
|
}
|
|
@@ -16319,7 +16585,7 @@ class FFIRenderLib {
|
|
|
16319
16585
|
this.opentui.symbols.textBufferViewSetTabIndicator(view, indicator);
|
|
16320
16586
|
}
|
|
16321
16587
|
textBufferViewSetTabIndicatorColor(view, color) {
|
|
16322
|
-
this.opentui.symbols.textBufferViewSetTabIndicatorColor(view,
|
|
16588
|
+
this.opentui.symbols.textBufferViewSetTabIndicatorColor(view, rgbaBuffer(color));
|
|
16323
16589
|
}
|
|
16324
16590
|
textBufferViewSetTruncate(view, truncate) {
|
|
16325
16591
|
this.opentui.symbols.textBufferViewSetTruncate(view, ffiBool(truncate));
|
|
@@ -16334,11 +16600,11 @@ class FFIRenderLib {
|
|
|
16334
16600
|
}
|
|
16335
16601
|
textBufferAddHighlightByCharRange(buffer, highlight) {
|
|
16336
16602
|
const packedHighlight = HighlightStruct.pack(highlight);
|
|
16337
|
-
this.opentui.symbols.textBufferAddHighlightByCharRange(buffer,
|
|
16603
|
+
this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, packedHighlight);
|
|
16338
16604
|
}
|
|
16339
16605
|
textBufferAddHighlight(buffer, lineIdx, highlight) {
|
|
16340
16606
|
const packedHighlight = HighlightStruct.pack(highlight);
|
|
16341
|
-
this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx,
|
|
16607
|
+
this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, packedHighlight);
|
|
16342
16608
|
}
|
|
16343
16609
|
textBufferRemoveHighlightsByRef(buffer, hlRef) {
|
|
16344
16610
|
this.opentui.symbols.textBufferRemoveHighlightsByRef(buffer, hlRef);
|
|
@@ -16354,7 +16620,7 @@ class FFIRenderLib {
|
|
|
16354
16620
|
}
|
|
16355
16621
|
textBufferGetLineHighlights(buffer, lineIdx) {
|
|
16356
16622
|
const outCountBuf = new Uint32Array(1);
|
|
16357
|
-
const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx,
|
|
16623
|
+
const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, outCountBuf);
|
|
16358
16624
|
if (!nativePtr)
|
|
16359
16625
|
return [];
|
|
16360
16626
|
const count = outCountBuf[0];
|
|
@@ -16373,7 +16639,7 @@ class FFIRenderLib {
|
|
|
16373
16639
|
}
|
|
16374
16640
|
getBuildOptions() {
|
|
16375
16641
|
const optionsBuffer = new ArrayBuffer(BuildOptionsStruct.size);
|
|
16376
|
-
this.opentui.symbols.getBuildOptions(
|
|
16642
|
+
this.opentui.symbols.getBuildOptions(optionsBuffer);
|
|
16377
16643
|
const options = BuildOptionsStruct.unpack(optionsBuffer);
|
|
16378
16644
|
return {
|
|
16379
16645
|
gpaSafeStats: !!options.gpaSafeStats,
|
|
@@ -16382,7 +16648,7 @@ class FFIRenderLib {
|
|
|
16382
16648
|
}
|
|
16383
16649
|
getAllocatorStats() {
|
|
16384
16650
|
const statsBuffer = new ArrayBuffer(AllocatorStatsStruct.size);
|
|
16385
|
-
this.opentui.symbols.getAllocatorStats(
|
|
16651
|
+
this.opentui.symbols.getAllocatorStats(statsBuffer);
|
|
16386
16652
|
const stats = AllocatorStatsStruct.unpack(statsBuffer);
|
|
16387
16653
|
return {
|
|
16388
16654
|
totalRequestedBytes: toNumber(stats.totalRequestedBytes),
|
|
@@ -16419,7 +16685,7 @@ class FFIRenderLib {
|
|
|
16419
16685
|
const y = new Uint32Array(1);
|
|
16420
16686
|
const width = new Uint32Array(1);
|
|
16421
16687
|
const height = new Uint32Array(1);
|
|
16422
|
-
this.opentui.symbols.editorViewGetViewport(view,
|
|
16688
|
+
this.opentui.symbols.editorViewGetViewport(view, x, y, width, height);
|
|
16423
16689
|
return {
|
|
16424
16690
|
offsetX: x[0],
|
|
16425
16691
|
offsetY: y[0],
|
|
@@ -16449,7 +16715,7 @@ class FFIRenderLib {
|
|
|
16449
16715
|
}
|
|
16450
16716
|
editorViewGetLineInfo(view) {
|
|
16451
16717
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16452
|
-
this.opentui.symbols.editorViewGetLineInfoDirect(view,
|
|
16718
|
+
this.opentui.symbols.editorViewGetLineInfoDirect(view, outBuffer);
|
|
16453
16719
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16454
16720
|
const lineStartCols = struct.startCols;
|
|
16455
16721
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16464,7 +16730,7 @@ class FFIRenderLib {
|
|
|
16464
16730
|
}
|
|
16465
16731
|
editorViewGetLogicalLineInfo(view) {
|
|
16466
16732
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16467
|
-
this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view,
|
|
16733
|
+
this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16468
16734
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16469
16735
|
const lineStartCols = struct.startCols;
|
|
16470
16736
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16489,20 +16755,20 @@ class FFIRenderLib {
|
|
|
16489
16755
|
this.opentui.symbols.destroyEditBuffer(buffer);
|
|
16490
16756
|
}
|
|
16491
16757
|
editBufferSetText(buffer, textBytes) {
|
|
16492
|
-
this.opentui.symbols.editBufferSetText(buffer,
|
|
16758
|
+
this.opentui.symbols.editBufferSetText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16493
16759
|
}
|
|
16494
16760
|
editBufferSetTextFromMem(buffer, memId) {
|
|
16495
16761
|
this.opentui.symbols.editBufferSetTextFromMem(buffer, memId);
|
|
16496
16762
|
}
|
|
16497
16763
|
editBufferReplaceText(buffer, textBytes) {
|
|
16498
|
-
this.opentui.symbols.editBufferReplaceText(buffer,
|
|
16764
|
+
this.opentui.symbols.editBufferReplaceText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16499
16765
|
}
|
|
16500
16766
|
editBufferReplaceTextFromMem(buffer, memId) {
|
|
16501
16767
|
this.opentui.symbols.editBufferReplaceTextFromMem(buffer, memId);
|
|
16502
16768
|
}
|
|
16503
16769
|
editBufferGetText(buffer, maxLength) {
|
|
16504
16770
|
const outBuffer = new Uint8Array(maxLength);
|
|
16505
|
-
const actualLen = this.opentui.symbols.editBufferGetText(buffer,
|
|
16771
|
+
const actualLen = this.opentui.symbols.editBufferGetText(buffer, viewOrNull(outBuffer), maxLength);
|
|
16506
16772
|
const len = actualLen;
|
|
16507
16773
|
if (len === 0)
|
|
16508
16774
|
return null;
|
|
@@ -16510,11 +16776,11 @@ class FFIRenderLib {
|
|
|
16510
16776
|
}
|
|
16511
16777
|
editBufferInsertChar(buffer, char) {
|
|
16512
16778
|
const charBytes = this.encoder.encode(char);
|
|
16513
|
-
this.opentui.symbols.editBufferInsertChar(buffer,
|
|
16779
|
+
this.opentui.symbols.editBufferInsertChar(buffer, viewOrNull(charBytes), charBytes.byteLength);
|
|
16514
16780
|
}
|
|
16515
16781
|
editBufferInsertText(buffer, text) {
|
|
16516
16782
|
const textBytes = this.encoder.encode(text);
|
|
16517
|
-
this.opentui.symbols.editBufferInsertText(buffer,
|
|
16783
|
+
this.opentui.symbols.editBufferInsertText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16518
16784
|
}
|
|
16519
16785
|
editBufferDeleteChar(buffer) {
|
|
16520
16786
|
this.opentui.symbols.editBufferDeleteChar(buffer);
|
|
@@ -16576,7 +16842,7 @@ class FFIRenderLib {
|
|
|
16576
16842
|
}
|
|
16577
16843
|
editBufferUndo(buffer, maxLength) {
|
|
16578
16844
|
const outBuffer = new Uint8Array(maxLength);
|
|
16579
|
-
const actualLen = this.opentui.symbols.editBufferUndo(buffer,
|
|
16845
|
+
const actualLen = this.opentui.symbols.editBufferUndo(buffer, viewOrNull(outBuffer), maxLength);
|
|
16580
16846
|
const len = actualLen;
|
|
16581
16847
|
if (len === 0)
|
|
16582
16848
|
return null;
|
|
@@ -16584,7 +16850,7 @@ class FFIRenderLib {
|
|
|
16584
16850
|
}
|
|
16585
16851
|
editBufferRedo(buffer, maxLength) {
|
|
16586
16852
|
const outBuffer = new Uint8Array(maxLength);
|
|
16587
|
-
const actualLen = this.opentui.symbols.editBufferRedo(buffer,
|
|
16853
|
+
const actualLen = this.opentui.symbols.editBufferRedo(buffer, viewOrNull(outBuffer), maxLength);
|
|
16588
16854
|
const len = actualLen;
|
|
16589
16855
|
if (len === 0)
|
|
16590
16856
|
return null;
|
|
@@ -16636,7 +16902,7 @@ class FFIRenderLib {
|
|
|
16636
16902
|
}
|
|
16637
16903
|
editBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
|
|
16638
16904
|
const outBuffer = new Uint8Array(maxLength);
|
|
16639
|
-
const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset,
|
|
16905
|
+
const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
|
|
16640
16906
|
const len = actualLen;
|
|
16641
16907
|
if (len === 0)
|
|
16642
16908
|
return null;
|
|
@@ -16644,15 +16910,15 @@ class FFIRenderLib {
|
|
|
16644
16910
|
}
|
|
16645
16911
|
editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
|
|
16646
16912
|
const outBuffer = new Uint8Array(maxLength);
|
|
16647
|
-
const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol,
|
|
16913
|
+
const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, viewOrNull(outBuffer), maxLength);
|
|
16648
16914
|
const len = actualLen;
|
|
16649
16915
|
if (len === 0)
|
|
16650
16916
|
return null;
|
|
16651
16917
|
return usesBunFFI ? outBuffer.slice(0, len) : trimNodeFFIOutputBytes(outBuffer, len);
|
|
16652
16918
|
}
|
|
16653
16919
|
editorViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
16654
|
-
const bg2 =
|
|
16655
|
-
const fg2 =
|
|
16920
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16921
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16656
16922
|
this.opentui.symbols.editorViewSetSelection(view, start, end, bg2, fg2);
|
|
16657
16923
|
}
|
|
16658
16924
|
editorViewResetSelection(view) {
|
|
@@ -16668,18 +16934,18 @@ class FFIRenderLib {
|
|
|
16668
16934
|
return { start, end };
|
|
16669
16935
|
}
|
|
16670
16936
|
editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16671
|
-
const bg2 =
|
|
16672
|
-
const fg2 =
|
|
16937
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16938
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16673
16939
|
return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
|
|
16674
16940
|
}
|
|
16675
16941
|
editorViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16676
|
-
const bg2 =
|
|
16677
|
-
const fg2 =
|
|
16942
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16943
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16678
16944
|
this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
|
|
16679
16945
|
}
|
|
16680
16946
|
editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16681
|
-
const bg2 =
|
|
16682
|
-
const fg2 =
|
|
16947
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16948
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16683
16949
|
return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
|
|
16684
16950
|
}
|
|
16685
16951
|
editorViewResetLocalSelection(view) {
|
|
@@ -16687,7 +16953,7 @@ class FFIRenderLib {
|
|
|
16687
16953
|
}
|
|
16688
16954
|
editorViewGetSelectedTextBytes(view, maxLength) {
|
|
16689
16955
|
const outBuffer = new Uint8Array(maxLength);
|
|
16690
|
-
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view,
|
|
16956
|
+
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, viewOrNull(outBuffer), maxLength);
|
|
16691
16957
|
const len = actualLen;
|
|
16692
16958
|
if (len === 0)
|
|
16693
16959
|
return null;
|
|
@@ -16696,12 +16962,12 @@ class FFIRenderLib {
|
|
|
16696
16962
|
editorViewGetCursor(view) {
|
|
16697
16963
|
const row = new Uint32Array(1);
|
|
16698
16964
|
const col = new Uint32Array(1);
|
|
16699
|
-
this.opentui.symbols.editorViewGetCursor(view,
|
|
16965
|
+
this.opentui.symbols.editorViewGetCursor(view, row, col);
|
|
16700
16966
|
return { row: row[0], col: col[0] };
|
|
16701
16967
|
}
|
|
16702
16968
|
editorViewGetText(view, maxLength) {
|
|
16703
16969
|
const outBuffer = new Uint8Array(maxLength);
|
|
16704
|
-
const actualLen = this.opentui.symbols.editorViewGetText(view,
|
|
16970
|
+
const actualLen = this.opentui.symbols.editorViewGetText(view, viewOrNull(outBuffer), maxLength);
|
|
16705
16971
|
const len = actualLen;
|
|
16706
16972
|
if (len === 0)
|
|
16707
16973
|
return null;
|
|
@@ -16778,7 +17044,7 @@ class FFIRenderLib {
|
|
|
16778
17044
|
}
|
|
16779
17045
|
getTerminalCapabilities(renderer) {
|
|
16780
17046
|
const capsBuffer = new ArrayBuffer(TerminalCapabilitiesStruct.size);
|
|
16781
|
-
this.opentui.symbols.getTerminalCapabilities(renderer,
|
|
17047
|
+
this.opentui.symbols.getTerminalCapabilities(renderer, capsBuffer);
|
|
16782
17048
|
const caps = TerminalCapabilitiesStruct.unpack(capsBuffer);
|
|
16783
17049
|
return {
|
|
16784
17050
|
kitty_keyboard: caps.kitty_keyboard,
|
|
@@ -16811,14 +17077,14 @@ class FFIRenderLib {
|
|
|
16811
17077
|
}
|
|
16812
17078
|
processCapabilityResponse(renderer, response) {
|
|
16813
17079
|
const responseBytes = this.encoder.encode(response);
|
|
16814
|
-
this.opentui.symbols.processCapabilityResponse(renderer,
|
|
17080
|
+
this.opentui.symbols.processCapabilityResponse(renderer, viewOrNull(responseBytes), responseBytes.byteLength);
|
|
16815
17081
|
}
|
|
16816
17082
|
encodeUnicode(text, widthMethod) {
|
|
16817
17083
|
const textBytes = this.encoder.encode(text);
|
|
16818
17084
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
16819
17085
|
const outPtrBuffer = new ArrayBuffer(8);
|
|
16820
17086
|
const outLenBuffer = new ArrayBuffer(8);
|
|
16821
|
-
const success = this.opentui.symbols.encodeUnicode(
|
|
17087
|
+
const success = this.opentui.symbols.encodeUnicode(viewOrNull(textBytes), textBytes.byteLength, outPtrBuffer, outLenBuffer, widthMethodCode);
|
|
16822
17088
|
if (!success) {
|
|
16823
17089
|
return null;
|
|
16824
17090
|
}
|
|
@@ -16838,11 +17104,11 @@ class FFIRenderLib {
|
|
|
16838
17104
|
this.opentui.symbols.freeUnicode(encoded.ptr, encoded.data.length);
|
|
16839
17105
|
}
|
|
16840
17106
|
bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
|
|
16841
|
-
this.opentui.symbols.bufferDrawChar(buffer, char, x, y,
|
|
17107
|
+
this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg2), rgbaBuffer(bg2), attributes);
|
|
16842
17108
|
}
|
|
16843
17109
|
createAudioEngine(options) {
|
|
16844
17110
|
const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
|
|
16845
|
-
const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer
|
|
17111
|
+
const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer);
|
|
16846
17112
|
return engineHandle ? engineHandle : null;
|
|
16847
17113
|
}
|
|
16848
17114
|
destroyAudioEngine(engine) {
|
|
@@ -16856,7 +17122,7 @@ class FFIRenderLib {
|
|
|
16856
17122
|
}
|
|
16857
17123
|
audioGetPlaybackDeviceName(engine, index) {
|
|
16858
17124
|
const outBuffer = new Uint8Array(512);
|
|
16859
|
-
const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index,
|
|
17125
|
+
const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index, outBuffer, outBuffer.length));
|
|
16860
17126
|
const safeBytesWritten = Math.max(0, Math.min(outBuffer.length, bytesWritten));
|
|
16861
17127
|
return this.decoder.decode(outBuffer.subarray(0, safeBytesWritten));
|
|
16862
17128
|
}
|
|
@@ -16946,7 +17212,7 @@ class FFIRenderLib {
|
|
|
16946
17212
|
} catch {
|
|
16947
17213
|
return -1;
|
|
16948
17214
|
}
|
|
16949
|
-
return this.opentui.symbols.audioStart(engine, optionsBuffer
|
|
17215
|
+
return this.opentui.symbols.audioStart(engine, optionsBuffer);
|
|
16950
17216
|
}
|
|
16951
17217
|
audioStartMixer(engine) {
|
|
16952
17218
|
return this.opentui.symbols.audioStartMixer(engine);
|
|
@@ -17005,7 +17271,7 @@ class FFIRenderLib {
|
|
|
17005
17271
|
audioLoad(engine, data) {
|
|
17006
17272
|
const outBuffer = new ArrayBuffer(4);
|
|
17007
17273
|
const dataLength = toSafeFFIU32Length(data.byteLength, "Audio data length");
|
|
17008
|
-
const status = this.opentui.symbols.audioLoad(engine,
|
|
17274
|
+
const status = this.opentui.symbols.audioLoad(engine, data, dataLength, outBuffer);
|
|
17009
17275
|
if (status !== 0) {
|
|
17010
17276
|
return { status, soundId: null };
|
|
17011
17277
|
}
|
|
@@ -17020,7 +17286,7 @@ class FFIRenderLib {
|
|
|
17020
17286
|
return { status: -1, voiceId: null };
|
|
17021
17287
|
const outBuffer = new ArrayBuffer(4);
|
|
17022
17288
|
const optionsBuffer = options ? AudioVoiceOptionsStruct.pack(options) : null;
|
|
17023
|
-
const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer
|
|
17289
|
+
const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer, outBuffer);
|
|
17024
17290
|
if (status !== 0) {
|
|
17025
17291
|
return { status, voiceId: null };
|
|
17026
17292
|
}
|
|
@@ -17039,7 +17305,7 @@ class FFIRenderLib {
|
|
|
17039
17305
|
const outBuffer = new ArrayBuffer(4);
|
|
17040
17306
|
const nameBytes = this.encoder.encode(name);
|
|
17041
17307
|
const nameLength = toSafeFFIU32Length(nameBytes.byteLength, "Audio group name length");
|
|
17042
|
-
const status = this.opentui.symbols.audioCreateGroup(engine,
|
|
17308
|
+
const status = this.opentui.symbols.audioCreateGroup(engine, nameBytes, nameLength, outBuffer);
|
|
17043
17309
|
if (status !== 0) {
|
|
17044
17310
|
return { status, groupId: null };
|
|
17045
17311
|
}
|
|
@@ -17053,14 +17319,14 @@ class FFIRenderLib {
|
|
|
17053
17319
|
return this.opentui.symbols.audioSetMasterVolume(engine, volume);
|
|
17054
17320
|
}
|
|
17055
17321
|
audioMixToBuffer(engine, outBuffer, frameCount, channels) {
|
|
17056
|
-
return this.opentui.symbols.audioMixToBuffer(engine,
|
|
17322
|
+
return this.opentui.symbols.audioMixToBuffer(engine, outBuffer, frameCount, channels);
|
|
17057
17323
|
}
|
|
17058
17324
|
audioEnableTap(engine, enabled, capacityFrames) {
|
|
17059
17325
|
return this.opentui.symbols.audioEnableTap(engine, ffiBool(enabled), capacityFrames);
|
|
17060
17326
|
}
|
|
17061
17327
|
audioReadTap(engine, outBuffer, frameCount, channels) {
|
|
17062
17328
|
const outFramesReadBuffer = new ArrayBuffer(4);
|
|
17063
|
-
const status = this.opentui.symbols.audioReadTap(engine,
|
|
17329
|
+
const status = this.opentui.symbols.audioReadTap(engine, outBuffer, frameCount, channels, outFramesReadBuffer);
|
|
17064
17330
|
if (status !== 0) {
|
|
17065
17331
|
return { status, framesRead: 0 };
|
|
17066
17332
|
}
|
|
@@ -17069,7 +17335,7 @@ class FFIRenderLib {
|
|
|
17069
17335
|
}
|
|
17070
17336
|
audioGetStats(engine) {
|
|
17071
17337
|
const statsBuffer = new ArrayBuffer(AudioStatsStruct.size);
|
|
17072
|
-
const status = this.opentui.symbols.audioGetStats(engine,
|
|
17338
|
+
const status = this.opentui.symbols.audioGetStats(engine, statsBuffer);
|
|
17073
17339
|
if (status !== 0) {
|
|
17074
17340
|
return null;
|
|
17075
17341
|
}
|
|
@@ -17094,7 +17360,7 @@ class FFIRenderLib {
|
|
|
17094
17360
|
}
|
|
17095
17361
|
createNativeSpanFeed(options) {
|
|
17096
17362
|
const optionsBuffer = options == null ? null : NativeSpanFeedOptionsStruct.pack(options);
|
|
17097
|
-
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer
|
|
17363
|
+
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer);
|
|
17098
17364
|
if (!streamPtr) {
|
|
17099
17365
|
throw new Error("Failed to create stream");
|
|
17100
17366
|
}
|
|
@@ -17109,13 +17375,13 @@ class FFIRenderLib {
|
|
|
17109
17375
|
}
|
|
17110
17376
|
streamWrite(stream, data) {
|
|
17111
17377
|
const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
|
|
17112
|
-
return this.opentui.symbols.streamWrite(stream,
|
|
17378
|
+
return this.opentui.symbols.streamWrite(stream, viewOrNull(bytes), bytes.byteLength);
|
|
17113
17379
|
}
|
|
17114
17380
|
streamCommit(stream) {
|
|
17115
17381
|
return this.opentui.symbols.streamCommit(stream);
|
|
17116
17382
|
}
|
|
17117
17383
|
streamDrainSpans(stream, outBuffer, maxSpans) {
|
|
17118
|
-
const count = this.opentui.symbols.streamDrainSpans(stream,
|
|
17384
|
+
const count = this.opentui.symbols.streamDrainSpans(stream, outBuffer, maxSpans);
|
|
17119
17385
|
return toNumber(count);
|
|
17120
17386
|
}
|
|
17121
17387
|
streamClose(stream) {
|
|
@@ -17123,11 +17389,11 @@ class FFIRenderLib {
|
|
|
17123
17389
|
}
|
|
17124
17390
|
streamSetOptions(stream, options) {
|
|
17125
17391
|
const optionsBuffer = NativeSpanFeedOptionsStruct.pack(options);
|
|
17126
|
-
return this.opentui.symbols.streamSetOptions(stream,
|
|
17392
|
+
return this.opentui.symbols.streamSetOptions(stream, optionsBuffer);
|
|
17127
17393
|
}
|
|
17128
17394
|
streamGetStats(stream) {
|
|
17129
17395
|
const statsBuffer = new ArrayBuffer(NativeSpanFeedStatsStruct.size);
|
|
17130
|
-
const status = this.opentui.symbols.streamGetStats(stream,
|
|
17396
|
+
const status = this.opentui.symbols.streamGetStats(stream, statsBuffer);
|
|
17131
17397
|
if (status !== 0) {
|
|
17132
17398
|
return null;
|
|
17133
17399
|
}
|
|
@@ -17141,7 +17407,7 @@ class FFIRenderLib {
|
|
|
17141
17407
|
}
|
|
17142
17408
|
streamReserve(stream, minLen) {
|
|
17143
17409
|
const reserveBuffer = new ArrayBuffer(ReserveInfoStruct.size);
|
|
17144
|
-
const status = this.opentui.symbols.streamReserve(stream, minLen,
|
|
17410
|
+
const status = this.opentui.symbols.streamReserve(stream, minLen, reserveBuffer);
|
|
17145
17411
|
if (status !== 0) {
|
|
17146
17412
|
return { status, info: null };
|
|
17147
17413
|
}
|
|
@@ -17162,13 +17428,13 @@ class FFIRenderLib {
|
|
|
17162
17428
|
}
|
|
17163
17429
|
syntaxStyleRegister(style, name, fg2, bg2, attributes) {
|
|
17164
17430
|
const nameBytes = this.encoder.encode(name);
|
|
17165
|
-
const
|
|
17166
|
-
const
|
|
17167
|
-
return this.opentui.symbols.syntaxStyleRegister(style,
|
|
17431
|
+
const fgBuffer = optionalRgbaBuffer(fg2);
|
|
17432
|
+
const bgBuffer = optionalRgbaBuffer(bg2);
|
|
17433
|
+
return this.opentui.symbols.syntaxStyleRegister(style, viewOrNull(nameBytes), nameBytes.byteLength, fgBuffer, bgBuffer, attributes);
|
|
17168
17434
|
}
|
|
17169
17435
|
syntaxStyleResolveByName(style, name) {
|
|
17170
17436
|
const nameBytes = this.encoder.encode(name);
|
|
17171
|
-
const id = this.opentui.symbols.syntaxStyleResolveByName(style,
|
|
17437
|
+
const id = this.opentui.symbols.syntaxStyleResolveByName(style, viewOrNull(nameBytes), nameBytes.byteLength);
|
|
17172
17438
|
return id === 0 ? null : id;
|
|
17173
17439
|
}
|
|
17174
17440
|
syntaxStyleGetStyleCount(style) {
|
|
@@ -17266,7 +17532,7 @@ class FFIRenderLib {
|
|
|
17266
17532
|
this.opentui.symbols.editorViewSetTabIndicator(view, indicator);
|
|
17267
17533
|
}
|
|
17268
17534
|
editorViewSetTabIndicatorColor(view, color) {
|
|
17269
|
-
this.opentui.symbols.editorViewSetTabIndicatorColor(view,
|
|
17535
|
+
this.opentui.symbols.editorViewSetTabIndicatorColor(view, rgbaBuffer(color));
|
|
17270
17536
|
}
|
|
17271
17537
|
onNativeEvent(name, handler) {
|
|
17272
17538
|
this._nativeEvents.on(name, handler);
|
|
@@ -18269,5 +18535,5 @@ var yoga_default = Yoga;
|
|
|
18269
18535
|
|
|
18270
18536
|
export { toArrayBuffer, singleton, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, sleep, stringWidth2 as stringWidth, resolveBundledFilePath, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, SystemClock, nonAlphanumericKeys, terminalNamedSingleStrokeKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, destroyTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, createHostClipboard, createClipboard, ClipboardTarget, createRendererClipboardAdapter, Clipboard, detectLinks, OptimizedBuffer, TextBuffer, SpanInfoStruct, NativeAudioStreamFormat, NativeAudioStreamState, NativeAudioStreamStateNames, NativeAudioStreamCloseReason, NativeAudioStreamState2 as NativeAudioStreamState1, NativeAudioStreamCloseReason2 as NativeAudioStreamCloseReason1, NativeAudioStreamFormat2 as NativeAudioStreamFormat1, NativeClipboardOperationStatus, NativeClipboardStartStatus, NativeClipboardCancelStatus, NativeClipboardCopyStatus, NativeClipboardDestroyStatus, NativeClipboardShutdownStatus, LogLevel2 as LogLevel, NativeMeasureTargetKind, setRenderLibPath, resolveRenderLib, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel as LogLevel1, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, ALIGN_BASELINE, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_AROUND, ALIGN_SPACE_EVENLY, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOX, DIMENSION_WIDTH, DIMENSION_HEIGHT, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTL, DISPLAY_FLEX, DISPLAY_NONE, DISPLAY_CONTENTS, EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_START, EDGE_END, EDGE_HORIZONTAL, EDGE_VERTICAL, EDGE_ALL, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASIS, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ALL, ERRATA_CLASSIC, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE, GUTTER_COLUMN, GUTTER_ROW, GUTTER_ALL, JUSTIFY_FLEX_START, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_EVENLY, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_VERBOSE, LOG_LEVEL_FATAL, MEASURE_MODE_UNDEFINED, MEASURE_MODE_EXACTLY, MEASURE_MODE_AT_MOST, NODE_TYPE_DEFAULT, NODE_TYPE_TEXT, OVERFLOW_VISIBLE, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, POSITION_TYPE_STATIC, POSITION_TYPE_RELATIVE, POSITION_TYPE_ABSOLUTE, UNIT_UNDEFINED, UNIT_POINT, UNIT_PERCENT, UNIT_AUTO, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSE, Config, Node, exports_yoga, yoga_default };
|
|
18271
18537
|
|
|
18272
|
-
//# debugId=
|
|
18273
|
-
//# sourceMappingURL=chunk-bun-
|
|
18538
|
+
//# debugId=353B3B712CF6E51464756E2164756E21
|
|
18539
|
+
//# sourceMappingURL=chunk-bun-9335djz2.js.map
|