@opentui/core 0.5.3 → 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 +2 -2
- package/buffer.d.ts +2 -2
- package/{chunk-bun-26r5c5w5.js → chunk-bun-9335djz2.js} +450 -183
- package/{chunk-bun-26r5c5w5.js.map → chunk-bun-9335djz2.js.map} +7 -7
- package/{chunk-bun-t68f2fmr.js → chunk-bun-da1keqyp.js} +14 -4
- package/{chunk-bun-t68f2fmr.js.map → chunk-bun-da1keqyp.js.map} +4 -4
- package/{chunk-node-aj3n20gq.js → chunk-node-2h23nsbj.js} +450 -183
- package/{chunk-node-aj3n20gq.js.map → chunk-node-2h23nsbj.js.map} +7 -7
- package/{chunk-node-kq7as74d.js → chunk-node-ks0581vk.js} +14 -4
- package/{chunk-node-kq7as74d.js.map → chunk-node-ks0581vk.js.map} +4 -4
- package/index.bun.js +403 -6
- package/index.bun.js.map +5 -4
- package/index.node.js +403 -6
- package/index.node.js.map +5 -3
- 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/utils.d.ts +2 -1
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig-structs.d.ts +2 -0
- package/zig.d.ts +65 -7
|
@@ -620,7 +620,7 @@ function toNodeFFIType(type, position) {
|
|
|
620
620
|
case FFIType.napi_value:
|
|
621
621
|
throw new Error(NODE_NAPI_UNSUPPORTED);
|
|
622
622
|
case FFIType.buffer:
|
|
623
|
-
return "
|
|
623
|
+
return "pointer";
|
|
624
624
|
default:
|
|
625
625
|
return unsupportedNodeFFIType(type);
|
|
626
626
|
}
|
|
@@ -4585,6 +4585,7 @@ function createTextAttributes({
|
|
|
4585
4585
|
dim = false,
|
|
4586
4586
|
blink = false,
|
|
4587
4587
|
inverse = false,
|
|
4588
|
+
reverse = false,
|
|
4588
4589
|
hidden = false,
|
|
4589
4590
|
strikethrough = false
|
|
4590
4591
|
} = {}) {
|
|
@@ -4599,7 +4600,7 @@ function createTextAttributes({
|
|
|
4599
4600
|
attributes |= TextAttributes.DIM;
|
|
4600
4601
|
if (blink)
|
|
4601
4602
|
attributes |= TextAttributes.BLINK;
|
|
4602
|
-
if (inverse)
|
|
4603
|
+
if (inverse || reverse)
|
|
4603
4604
|
attributes |= TextAttributes.INVERSE;
|
|
4604
4605
|
if (hidden)
|
|
4605
4606
|
attributes |= TextAttributes.HIDDEN;
|
|
@@ -11415,7 +11416,7 @@ class OptimizedBuffer {
|
|
|
11415
11416
|
if (matrix.length !== 16)
|
|
11416
11417
|
throw new RangeError(`colorMatrix matrix must have length 16, got ${matrix.length}`);
|
|
11417
11418
|
const cellMaskCount = Math.floor(cellMask.length / 3);
|
|
11418
|
-
this.lib.bufferColorMatrix(this.bufferPtr,
|
|
11419
|
+
this.lib.bufferColorMatrix(this.bufferPtr, matrix, cellMask, cellMaskCount, strength, target);
|
|
11419
11420
|
}
|
|
11420
11421
|
colorMatrixUniform(matrix, strength = 1, target = 3 /* Both */) {
|
|
11421
11422
|
this.guard();
|
|
@@ -11423,7 +11424,7 @@ class OptimizedBuffer {
|
|
|
11423
11424
|
throw new RangeError(`colorMatrixUniform matrix must have length 16, got ${matrix.length}`);
|
|
11424
11425
|
if (strength === 0)
|
|
11425
11426
|
return;
|
|
11426
|
-
this.lib.bufferColorMatrixUniform(this.bufferPtr,
|
|
11427
|
+
this.lib.bufferColorMatrixUniform(this.bufferPtr, matrix, strength, target);
|
|
11427
11428
|
}
|
|
11428
11429
|
drawFrameBuffer(destX, destY, frameBuffer, sourceX, sourceY, sourceWidth, sourceHeight) {
|
|
11429
11430
|
this.guard();
|
|
@@ -11444,9 +11445,9 @@ class OptimizedBuffer {
|
|
|
11444
11445
|
this.guard();
|
|
11445
11446
|
this.lib.bufferDrawEditorView(this.bufferPtr, editorView.ptr, x, y);
|
|
11446
11447
|
}
|
|
11447
|
-
drawSuperSampleBuffer(x, y,
|
|
11448
|
+
drawSuperSampleBuffer(x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
|
|
11448
11449
|
this.guard();
|
|
11449
|
-
this.lib.bufferDrawSuperSampleBuffer(this.bufferPtr, x, y, toPointer(
|
|
11450
|
+
this.lib.bufferDrawSuperSampleBuffer(this.bufferPtr, x, y, typeof pixelData === "number" || typeof pixelData === "bigint" ? toPointer(pixelData) : pixelData, pixelDataLength, format, alignedBytesPerRow);
|
|
11450
11451
|
}
|
|
11451
11452
|
drawImage(image, x, y, width, height, pixelWidth = 0, pixelHeight = 0, sourceX = 0, sourceY = 0, sourceWidth = image.width, sourceHeight = image.height, protocol = "auto") {
|
|
11452
11453
|
this.guard();
|
|
@@ -11465,17 +11466,17 @@ class OptimizedBuffer {
|
|
|
11465
11466
|
}
|
|
11466
11467
|
return this.lib.bufferDrawImage(this.bufferPtr, image.ptr, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol);
|
|
11467
11468
|
}
|
|
11468
|
-
drawPackedBuffer(
|
|
11469
|
+
drawPackedBuffer(data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
|
|
11469
11470
|
this.guard();
|
|
11470
|
-
this.lib.bufferDrawPackedBuffer(this.bufferPtr, toPointer(
|
|
11471
|
+
this.lib.bufferDrawPackedBuffer(this.bufferPtr, typeof data === "number" || typeof data === "bigint" ? toPointer(data) : data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
|
|
11471
11472
|
}
|
|
11472
11473
|
drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
|
|
11473
11474
|
this.guard();
|
|
11474
|
-
this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY,
|
|
11475
|
+
this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
|
|
11475
11476
|
}
|
|
11476
11477
|
drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
|
|
11477
11478
|
this.guard();
|
|
11478
|
-
this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY,
|
|
11479
|
+
this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
|
|
11479
11480
|
}
|
|
11480
11481
|
resize(width, height) {
|
|
11481
11482
|
this.guard();
|
|
@@ -13179,6 +13180,28 @@ var CursorStateStruct = defineStruct([
|
|
|
13179
13180
|
["b", "f32"],
|
|
13180
13181
|
["a", "f32"]
|
|
13181
13182
|
]);
|
|
13183
|
+
var EmbeddedTerminalCursorStruct = defineStruct([
|
|
13184
|
+
["x", "u16"],
|
|
13185
|
+
["y", "u16"],
|
|
13186
|
+
["hasValue", "bool_u8"],
|
|
13187
|
+
["visible", "bool_u8"],
|
|
13188
|
+
["blinking", "bool_u8"],
|
|
13189
|
+
["wideTail", "bool_u8"],
|
|
13190
|
+
["style", "u8"],
|
|
13191
|
+
["colorHasValue", "bool_u8"],
|
|
13192
|
+
["colorR", "u8"],
|
|
13193
|
+
["colorG", "u8"],
|
|
13194
|
+
["colorB", "u8"],
|
|
13195
|
+
["padding", "u8"]
|
|
13196
|
+
]);
|
|
13197
|
+
var EmbeddedTerminalKeyOptionsStruct = defineStruct([
|
|
13198
|
+
["action", "u8"],
|
|
13199
|
+
["composing", "u8"],
|
|
13200
|
+
["mods", "u16"],
|
|
13201
|
+
["consumedMods", "u16"],
|
|
13202
|
+
["padding", "u16"],
|
|
13203
|
+
["unshiftedCodepoint", "u32"]
|
|
13204
|
+
]);
|
|
13182
13205
|
var CursorStyleOptionsStruct = defineStruct([
|
|
13183
13206
|
["style", "u8", { default: 255 }],
|
|
13184
13207
|
["blinking", "u8", { default: 255 }],
|
|
@@ -13495,14 +13518,50 @@ function toSafeFFIU32Length(value, label) {
|
|
|
13495
13518
|
function isFFIU32(value) {
|
|
13496
13519
|
return Number.isInteger(value) && value >= 0 && value <= MAX_FFI_U32;
|
|
13497
13520
|
}
|
|
13498
|
-
function
|
|
13499
|
-
return value.byteLength === 0 ? null :
|
|
13521
|
+
function viewOrNull(value) {
|
|
13522
|
+
return value.byteLength === 0 ? null : value;
|
|
13523
|
+
}
|
|
13524
|
+
function retainedPtrOrNull(value) {
|
|
13525
|
+
if (value.byteLength === 0)
|
|
13526
|
+
return null;
|
|
13527
|
+
value.buffer;
|
|
13528
|
+
return ptr(value);
|
|
13529
|
+
}
|
|
13530
|
+
var EMBEDDED_TERMINAL_ERRORS = {
|
|
13531
|
+
[-1]: "invalid value or handle",
|
|
13532
|
+
[-2]: "out of memory",
|
|
13533
|
+
[-3]: "embedded terminal support is unavailable",
|
|
13534
|
+
[-4]: "output buffer is too small",
|
|
13535
|
+
[-5]: "processing failed"
|
|
13536
|
+
};
|
|
13537
|
+
function embeddedTerminalResult(status, operation) {
|
|
13538
|
+
if (status >= 0)
|
|
13539
|
+
return status;
|
|
13540
|
+
throw new Error(`Embedded terminal ${operation} failed: ${EMBEDDED_TERMINAL_ERRORS[status] ?? `status ${status}`}`);
|
|
13541
|
+
}
|
|
13542
|
+
function embeddedTerminalDimension(value, name) {
|
|
13543
|
+
if (!Number.isInteger(value) || value < 1 || value > 65535) {
|
|
13544
|
+
throw new RangeError(`Embedded terminal ${name} must be an integer between 1 and 65535`);
|
|
13545
|
+
}
|
|
13546
|
+
return value;
|
|
13500
13547
|
}
|
|
13501
|
-
function
|
|
13502
|
-
|
|
13548
|
+
function embeddedTerminalI32(value, name) {
|
|
13549
|
+
if (!Number.isInteger(value) || value < -2147483648 || value > 2147483647) {
|
|
13550
|
+
throw new RangeError(`Embedded terminal ${name} must be a signed 32-bit integer`);
|
|
13551
|
+
}
|
|
13552
|
+
return value;
|
|
13503
13553
|
}
|
|
13504
|
-
function
|
|
13505
|
-
|
|
13554
|
+
function embeddedTerminalF32(value, name) {
|
|
13555
|
+
if (!Number.isFinite(value) || Math.abs(value) > 340282346638528860000000000000000000000) {
|
|
13556
|
+
throw new RangeError(`Embedded terminal ${name} must be a finite 32-bit float`);
|
|
13557
|
+
}
|
|
13558
|
+
return value;
|
|
13559
|
+
}
|
|
13560
|
+
function rgbaBuffer(value) {
|
|
13561
|
+
return value.buffer;
|
|
13562
|
+
}
|
|
13563
|
+
function optionalRgbaBuffer(value) {
|
|
13564
|
+
return value ? rgbaBuffer(value) : null;
|
|
13506
13565
|
}
|
|
13507
13566
|
function getOpenTUILib(libPath) {
|
|
13508
13567
|
const resolvedLibPath = libPath || targetLibPath;
|
|
@@ -13538,6 +13597,70 @@ function getOpenTUILib(libPath) {
|
|
|
13538
13597
|
args: ["u32", "u32", "u32"],
|
|
13539
13598
|
returns: "bool"
|
|
13540
13599
|
},
|
|
13600
|
+
createEmbeddedTerminal: {
|
|
13601
|
+
args: ["u16", "u16", "u32", "ptr"],
|
|
13602
|
+
returns: "i32"
|
|
13603
|
+
},
|
|
13604
|
+
destroyEmbeddedTerminal: {
|
|
13605
|
+
args: ["u32"],
|
|
13606
|
+
returns: "void"
|
|
13607
|
+
},
|
|
13608
|
+
embeddedTerminalWrite: {
|
|
13609
|
+
args: ["u32", "ptr", "u32"],
|
|
13610
|
+
returns: "i32"
|
|
13611
|
+
},
|
|
13612
|
+
embeddedTerminalResize: {
|
|
13613
|
+
args: ["u32", "u16", "u16"],
|
|
13614
|
+
returns: "i32"
|
|
13615
|
+
},
|
|
13616
|
+
embeddedTerminalInvalidate: {
|
|
13617
|
+
args: ["u32"],
|
|
13618
|
+
returns: "i32"
|
|
13619
|
+
},
|
|
13620
|
+
embeddedTerminalScroll: {
|
|
13621
|
+
args: ["u32", "i32"],
|
|
13622
|
+
returns: "i32"
|
|
13623
|
+
},
|
|
13624
|
+
embeddedTerminalSetSelection: {
|
|
13625
|
+
args: ["u32", "u16", "u16", "u16", "u16"],
|
|
13626
|
+
returns: "i32"
|
|
13627
|
+
},
|
|
13628
|
+
embeddedTerminalClearSelection: {
|
|
13629
|
+
args: ["u32"],
|
|
13630
|
+
returns: "i32"
|
|
13631
|
+
},
|
|
13632
|
+
embeddedTerminalGetSelectedText: {
|
|
13633
|
+
args: ["u32", "buffer", "u32", "buffer"],
|
|
13634
|
+
returns: "i32"
|
|
13635
|
+
},
|
|
13636
|
+
embeddedTerminalCompose: {
|
|
13637
|
+
args: ["u32", "u32", "i32", "i32"],
|
|
13638
|
+
returns: "i32"
|
|
13639
|
+
},
|
|
13640
|
+
embeddedTerminalCursor: {
|
|
13641
|
+
args: ["u32", "ptr"],
|
|
13642
|
+
returns: "i32"
|
|
13643
|
+
},
|
|
13644
|
+
embeddedTerminalEncodeKey: {
|
|
13645
|
+
args: ["u32", "ptr", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
|
|
13646
|
+
returns: "i32"
|
|
13647
|
+
},
|
|
13648
|
+
embeddedTerminalEncodeMouse: {
|
|
13649
|
+
args: ["u32", "u8", "i8", "u16", "f32", "f32", "u8", "ptr", "u32"],
|
|
13650
|
+
returns: "i32"
|
|
13651
|
+
},
|
|
13652
|
+
embeddedTerminalEncodePaste: {
|
|
13653
|
+
args: ["u32", "ptr", "u32", "ptr", "u32"],
|
|
13654
|
+
returns: "i32"
|
|
13655
|
+
},
|
|
13656
|
+
embeddedTerminalEncodeFocus: {
|
|
13657
|
+
args: ["u32", "u8", "ptr", "u32"],
|
|
13658
|
+
returns: "i32"
|
|
13659
|
+
},
|
|
13660
|
+
embeddedTerminalDrainResponses: {
|
|
13661
|
+
args: ["u32", "ptr", "u32"],
|
|
13662
|
+
returns: "i32"
|
|
13663
|
+
},
|
|
13541
13664
|
createRenderer: {
|
|
13542
13665
|
args: ["u32", "u32", "u8", "u8", "ptr"],
|
|
13543
13666
|
returns: "u32"
|
|
@@ -13547,7 +13670,7 @@ function getOpenTUILib(libPath) {
|
|
|
13547
13670
|
returns: "bool"
|
|
13548
13671
|
},
|
|
13549
13672
|
destroyRenderer: {
|
|
13550
|
-
args: ["u32"],
|
|
13673
|
+
args: ["u32", "bool"],
|
|
13551
13674
|
returns: "void"
|
|
13552
13675
|
},
|
|
13553
13676
|
setUseThread: {
|
|
@@ -13559,7 +13682,7 @@ function getOpenTUILib(libPath) {
|
|
|
13559
13682
|
returns: "void"
|
|
13560
13683
|
},
|
|
13561
13684
|
setBackgroundColor: {
|
|
13562
|
-
args: ["u32", "
|
|
13685
|
+
args: ["u32", "buffer"],
|
|
13563
13686
|
returns: "void"
|
|
13564
13687
|
},
|
|
13565
13688
|
setRenderOffset: {
|
|
@@ -13619,7 +13742,7 @@ function getOpenTUILib(libPath) {
|
|
|
13619
13742
|
returns: "u32"
|
|
13620
13743
|
},
|
|
13621
13744
|
rendererSetPaletteState: {
|
|
13622
|
-
args: ["u32", "
|
|
13745
|
+
args: ["u32", "buffer", "u32", "buffer", "buffer", "u32"],
|
|
13623
13746
|
returns: "void"
|
|
13624
13747
|
},
|
|
13625
13748
|
queryPixelResolution: {
|
|
@@ -13631,7 +13754,7 @@ function getOpenTUILib(libPath) {
|
|
|
13631
13754
|
returns: "void"
|
|
13632
13755
|
},
|
|
13633
13756
|
createOptimizedBuffer: {
|
|
13634
|
-
args: ["u32", "u32", "bool", "u8", "
|
|
13757
|
+
args: ["u32", "u32", "bool", "u8", "buffer", "u32"],
|
|
13635
13758
|
returns: "u32"
|
|
13636
13759
|
},
|
|
13637
13760
|
destroyOptimizedBuffer: {
|
|
@@ -13651,7 +13774,7 @@ function getOpenTUILib(libPath) {
|
|
|
13651
13774
|
returns: "u32"
|
|
13652
13775
|
},
|
|
13653
13776
|
bufferClear: {
|
|
13654
|
-
args: ["u32", "
|
|
13777
|
+
args: ["u32", "buffer"],
|
|
13655
13778
|
returns: "void"
|
|
13656
13779
|
},
|
|
13657
13780
|
bufferGetCharPtr: {
|
|
@@ -13679,7 +13802,7 @@ function getOpenTUILib(libPath) {
|
|
|
13679
13802
|
returns: "void"
|
|
13680
13803
|
},
|
|
13681
13804
|
bufferGetId: {
|
|
13682
|
-
args: ["u32", "
|
|
13805
|
+
args: ["u32", "buffer", "u32"],
|
|
13683
13806
|
returns: "u32"
|
|
13684
13807
|
},
|
|
13685
13808
|
bufferGetRealCharSize: {
|
|
@@ -13691,19 +13814,19 @@ function getOpenTUILib(libPath) {
|
|
|
13691
13814
|
returns: "u32"
|
|
13692
13815
|
},
|
|
13693
13816
|
bufferDrawText: {
|
|
13694
|
-
args: ["u32", "ptr", "u32", "u32", "u32", "
|
|
13817
|
+
args: ["u32", "ptr", "u32", "u32", "u32", "buffer", "ptr", "u32"],
|
|
13695
13818
|
returns: "void"
|
|
13696
13819
|
},
|
|
13697
13820
|
bufferSetCellWithAlphaBlending: {
|
|
13698
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
13821
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
13699
13822
|
returns: "void"
|
|
13700
13823
|
},
|
|
13701
13824
|
bufferSetCell: {
|
|
13702
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
13825
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
13703
13826
|
returns: "void"
|
|
13704
13827
|
},
|
|
13705
13828
|
bufferFillRect: {
|
|
13706
|
-
args: ["u32", "u32", "u32", "u32", "u32", "
|
|
13829
|
+
args: ["u32", "u32", "u32", "u32", "u32", "buffer"],
|
|
13707
13830
|
returns: "void"
|
|
13708
13831
|
},
|
|
13709
13832
|
bufferColorMatrix: {
|
|
@@ -13743,7 +13866,7 @@ function getOpenTUILib(libPath) {
|
|
|
13743
13866
|
returns: "void"
|
|
13744
13867
|
},
|
|
13745
13868
|
setCursorColor: {
|
|
13746
|
-
args: ["u32", "
|
|
13869
|
+
args: ["u32", "buffer"],
|
|
13747
13870
|
returns: "void"
|
|
13748
13871
|
},
|
|
13749
13872
|
getCursorState: {
|
|
@@ -13871,11 +13994,26 @@ function getOpenTUILib(libPath) {
|
|
|
13871
13994
|
returns: "void"
|
|
13872
13995
|
},
|
|
13873
13996
|
bufferDrawGrid: {
|
|
13874
|
-
args: ["u32", "
|
|
13997
|
+
args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "ptr"],
|
|
13875
13998
|
returns: "void"
|
|
13876
13999
|
},
|
|
13877
14000
|
bufferDrawBox: {
|
|
13878
|
-
args: [
|
|
14001
|
+
args: [
|
|
14002
|
+
"u32",
|
|
14003
|
+
"i32",
|
|
14004
|
+
"i32",
|
|
14005
|
+
"u32",
|
|
14006
|
+
"u32",
|
|
14007
|
+
"buffer",
|
|
14008
|
+
"u32",
|
|
14009
|
+
"buffer",
|
|
14010
|
+
"buffer",
|
|
14011
|
+
"buffer",
|
|
14012
|
+
"ptr",
|
|
14013
|
+
"u32",
|
|
14014
|
+
"ptr",
|
|
14015
|
+
"u32"
|
|
14016
|
+
],
|
|
13879
14017
|
returns: "void"
|
|
13880
14018
|
},
|
|
13881
14019
|
bufferPushScissorRect: {
|
|
@@ -14207,7 +14345,7 @@ function getOpenTUILib(libPath) {
|
|
|
14207
14345
|
returns: "void"
|
|
14208
14346
|
},
|
|
14209
14347
|
textBufferViewSetTabIndicatorColor: {
|
|
14210
|
-
args: ["u32", "
|
|
14348
|
+
args: ["u32", "buffer"],
|
|
14211
14349
|
returns: "void"
|
|
14212
14350
|
},
|
|
14213
14351
|
textBufferViewSetTruncate: {
|
|
@@ -14243,7 +14381,7 @@ function getOpenTUILib(libPath) {
|
|
|
14243
14381
|
returns: "void"
|
|
14244
14382
|
},
|
|
14245
14383
|
editorViewGetViewport: {
|
|
14246
|
-
args: ["u32", "
|
|
14384
|
+
args: ["u32", "buffer", "buffer", "buffer", "buffer"],
|
|
14247
14385
|
returns: "void"
|
|
14248
14386
|
},
|
|
14249
14387
|
editorViewSetScrollMargin: {
|
|
@@ -14467,7 +14605,7 @@ function getOpenTUILib(libPath) {
|
|
|
14467
14605
|
returns: "u32"
|
|
14468
14606
|
},
|
|
14469
14607
|
editorViewGetCursor: {
|
|
14470
|
-
args: ["u32", "
|
|
14608
|
+
args: ["u32", "buffer", "buffer"],
|
|
14471
14609
|
returns: "void"
|
|
14472
14610
|
},
|
|
14473
14611
|
editorViewGetText: {
|
|
@@ -14523,7 +14661,7 @@ function getOpenTUILib(libPath) {
|
|
|
14523
14661
|
returns: "void"
|
|
14524
14662
|
},
|
|
14525
14663
|
editorViewSetTabIndicatorColor: {
|
|
14526
|
-
args: ["u32", "
|
|
14664
|
+
args: ["u32", "buffer"],
|
|
14527
14665
|
returns: "void"
|
|
14528
14666
|
},
|
|
14529
14667
|
getArenaAllocatedBytes: {
|
|
@@ -14562,21 +14700,21 @@ function getOpenTUILib(libPath) {
|
|
|
14562
14700
|
imageRetainIccCache: { args: [], returns: "void" },
|
|
14563
14701
|
imageReleaseIccCache: { args: [], returns: "void" },
|
|
14564
14702
|
imageTestFailIccProfileCopyAllocationOnce: { args: [], returns: "void" },
|
|
14565
|
-
imageDecode: { args: ["ptr", "u32", "
|
|
14566
|
-
imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "
|
|
14703
|
+
imageDecode: { args: ["ptr", "u32", "buffer"], returns: "u32" },
|
|
14704
|
+
imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "buffer"], returns: "u32" },
|
|
14567
14705
|
imageDestroy: { args: ["u32"], returns: "void" },
|
|
14568
|
-
imageRetain: { args: ["u32", "
|
|
14706
|
+
imageRetain: { args: ["u32", "buffer"], returns: "u32" },
|
|
14569
14707
|
imageGetInfo: { args: ["u32", "ptr"], returns: "u32" },
|
|
14570
14708
|
imageMaterialize: { args: ["u32"], returns: "u32" },
|
|
14571
14709
|
imageEnsureEncodedPng: { args: ["u32"], returns: "u32" },
|
|
14572
14710
|
imageGetPixelsPtr: { args: ["u32"], returns: "ptr" },
|
|
14573
|
-
imageClone: { args: ["u32", "
|
|
14711
|
+
imageClone: { args: ["u32", "buffer"], returns: "u32" },
|
|
14574
14712
|
imageCopyPixels: { args: ["u32", "ptr", "u64", "u32", "u8"], returns: "u32" },
|
|
14575
|
-
imageResize: { args: ["u32", "u32", "u32", "u32", "
|
|
14576
|
-
imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "
|
|
14577
|
-
imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "
|
|
14578
|
-
imageTransform: { args: ["u32", "u32", "
|
|
14579
|
-
imageComposite: { args: ["u32", "u32", "i32", "i32", "u32", "u8", "
|
|
14713
|
+
imageResize: { args: ["u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
|
|
14714
|
+
imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
|
|
14715
|
+
imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "buffer", "buffer"], returns: "u32" },
|
|
14716
|
+
imageTransform: { args: ["u32", "u32", "buffer"], returns: "u32" },
|
|
14717
|
+
imageComposite: { args: ["u32", "u32", "i32", "i32", "u32", "u8", "buffer"], returns: "u32" },
|
|
14580
14718
|
getTerminalCapabilities: {
|
|
14581
14719
|
args: ["u32", "ptr"],
|
|
14582
14720
|
returns: "void"
|
|
@@ -14594,7 +14732,7 @@ function getOpenTUILib(libPath) {
|
|
|
14594
14732
|
returns: "void"
|
|
14595
14733
|
},
|
|
14596
14734
|
bufferDrawChar: {
|
|
14597
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
14735
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
14598
14736
|
returns: "void"
|
|
14599
14737
|
},
|
|
14600
14738
|
yogaConfigCreate: {
|
|
@@ -14814,7 +14952,7 @@ function getOpenTUILib(libPath) {
|
|
|
14814
14952
|
returns: "u32"
|
|
14815
14953
|
},
|
|
14816
14954
|
audioGetPlaybackDeviceName: {
|
|
14817
|
-
args: ["u32", "u32", "
|
|
14955
|
+
args: ["u32", "u32", "buffer", "u32"],
|
|
14818
14956
|
returns: "u32"
|
|
14819
14957
|
},
|
|
14820
14958
|
audioIsPlaybackDeviceDefault: {
|
|
@@ -14838,7 +14976,7 @@ function getOpenTUILib(libPath) {
|
|
|
14838
14976
|
returns: "u32"
|
|
14839
14977
|
},
|
|
14840
14978
|
audioGetCaptureDeviceName: {
|
|
14841
|
-
args: ["u32", "u32", "
|
|
14979
|
+
args: ["u32", "u32", "buffer", "u32"],
|
|
14842
14980
|
returns: "u32"
|
|
14843
14981
|
},
|
|
14844
14982
|
audioIsCaptureDeviceDefault: {
|
|
@@ -14866,7 +15004,7 @@ function getOpenTUILib(libPath) {
|
|
|
14866
15004
|
returns: "bool"
|
|
14867
15005
|
},
|
|
14868
15006
|
audioReadCapture: {
|
|
14869
|
-
args: ["u32", "
|
|
15007
|
+
args: ["u32", "buffer", "u32", "u32", "ptr"],
|
|
14870
15008
|
returns: "i32"
|
|
14871
15009
|
},
|
|
14872
15010
|
audioGetCaptureStats: {
|
|
@@ -14922,7 +15060,7 @@ function getOpenTUILib(libPath) {
|
|
|
14922
15060
|
returns: "i32"
|
|
14923
15061
|
},
|
|
14924
15062
|
audioLoad: {
|
|
14925
|
-
args: ["u32", "
|
|
15063
|
+
args: ["u32", "buffer", "u32", "ptr"],
|
|
14926
15064
|
returns: "i32"
|
|
14927
15065
|
},
|
|
14928
15066
|
audioUnload: {
|
|
@@ -14942,7 +15080,7 @@ function getOpenTUILib(libPath) {
|
|
|
14942
15080
|
returns: "i32"
|
|
14943
15081
|
},
|
|
14944
15082
|
audioCreateGroup: {
|
|
14945
|
-
args: ["u32", "
|
|
15083
|
+
args: ["u32", "buffer", "u32", "ptr"],
|
|
14946
15084
|
returns: "i32"
|
|
14947
15085
|
},
|
|
14948
15086
|
audioSetGroupVolume: {
|
|
@@ -14954,7 +15092,7 @@ function getOpenTUILib(libPath) {
|
|
|
14954
15092
|
returns: "i32"
|
|
14955
15093
|
},
|
|
14956
15094
|
audioMixToBuffer: {
|
|
14957
|
-
args: ["u32", "
|
|
15095
|
+
args: ["u32", "buffer", "u32", "u8"],
|
|
14958
15096
|
returns: "i32"
|
|
14959
15097
|
},
|
|
14960
15098
|
audioEnableTap: {
|
|
@@ -14962,7 +15100,7 @@ function getOpenTUILib(libPath) {
|
|
|
14962
15100
|
returns: "i32"
|
|
14963
15101
|
},
|
|
14964
15102
|
audioReadTap: {
|
|
14965
|
-
args: ["u32", "
|
|
15103
|
+
args: ["u32", "buffer", "u32", "u8", "ptr"],
|
|
14966
15104
|
returns: "i32"
|
|
14967
15105
|
},
|
|
14968
15106
|
audioGetStats: {
|
|
@@ -14990,7 +15128,7 @@ function getOpenTUILib(libPath) {
|
|
|
14990
15128
|
returns: "i32"
|
|
14991
15129
|
},
|
|
14992
15130
|
streamDrainSpans: {
|
|
14993
|
-
args: ["ptr", "
|
|
15131
|
+
args: ["ptr", "buffer", "u32"],
|
|
14994
15132
|
returns: "u32"
|
|
14995
15133
|
},
|
|
14996
15134
|
streamClose: {
|
|
@@ -15177,7 +15315,6 @@ class FFIRenderLib {
|
|
|
15177
15315
|
opentui;
|
|
15178
15316
|
iccCacheClient = false;
|
|
15179
15317
|
yogaLayout = new Float32Array(6);
|
|
15180
|
-
yogaLayoutPtr = ptr(this.yogaLayout);
|
|
15181
15318
|
ffiStructStorage = {
|
|
15182
15319
|
logicalCursor: {
|
|
15183
15320
|
...allocStruct(LogicalCursorStruct),
|
|
@@ -15197,6 +15334,8 @@ class FFIRenderLib {
|
|
|
15197
15334
|
...allocStruct(MeasureResultStruct),
|
|
15198
15335
|
result: { lineCount: 0, widthColsMax: 0 }
|
|
15199
15336
|
},
|
|
15337
|
+
embeddedTerminalCursor: allocStruct(EmbeddedTerminalCursorStruct),
|
|
15338
|
+
embeddedTerminalKeyOptions: allocStruct(EmbeddedTerminalKeyOptionsStruct),
|
|
15200
15339
|
audioStreamStats: {
|
|
15201
15340
|
...allocStruct(AudioStreamStatsStruct),
|
|
15202
15341
|
result: {
|
|
@@ -15242,6 +15381,134 @@ class FFIRenderLib {
|
|
|
15242
15381
|
nativeRenderableSetMeasureTarget(handle, kind, target) {
|
|
15243
15382
|
return Boolean(this.opentui.symbols.nativeRenderableSetMeasureTarget(handle, kind, target));
|
|
15244
15383
|
}
|
|
15384
|
+
createEmbeddedTerminal(options) {
|
|
15385
|
+
const cols = embeddedTerminalDimension(options.cols, "columns");
|
|
15386
|
+
const rows = embeddedTerminalDimension(options.rows, "rows");
|
|
15387
|
+
const maxScrollback = toSafeFFIU32Length(options.maxScrollback ?? 1e4, "Embedded terminal maxScrollback");
|
|
15388
|
+
const out = new Uint32Array(1);
|
|
15389
|
+
embeddedTerminalResult(this.opentui.symbols.createEmbeddedTerminal(cols, rows, maxScrollback, out), "creation");
|
|
15390
|
+
if (!out[0])
|
|
15391
|
+
throw new Error("Embedded terminal creation returned an invalid handle");
|
|
15392
|
+
return out[0];
|
|
15393
|
+
}
|
|
15394
|
+
destroyEmbeddedTerminal(handle) {
|
|
15395
|
+
this.opentui.symbols.destroyEmbeddedTerminal(handle);
|
|
15396
|
+
}
|
|
15397
|
+
embeddedTerminalWrite(handle, data) {
|
|
15398
|
+
const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
|
|
15399
|
+
const length = toSafeFFIU32Length(bytes.byteLength, "Embedded terminal write length");
|
|
15400
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalWrite(handle, length === 0 ? null : bytes, length), "write");
|
|
15401
|
+
}
|
|
15402
|
+
embeddedTerminalResize(handle, cols, rows) {
|
|
15403
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalResize(handle, embeddedTerminalDimension(cols, "columns"), embeddedTerminalDimension(rows, "rows")), "resize");
|
|
15404
|
+
}
|
|
15405
|
+
embeddedTerminalInvalidate(handle) {
|
|
15406
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalInvalidate(handle), "invalidation");
|
|
15407
|
+
}
|
|
15408
|
+
embeddedTerminalScroll(handle, delta) {
|
|
15409
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalScroll(handle, embeddedTerminalI32(delta, "scroll delta")), "scroll");
|
|
15410
|
+
}
|
|
15411
|
+
embeddedTerminalSetSelection(handle, start, end) {
|
|
15412
|
+
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");
|
|
15413
|
+
}
|
|
15414
|
+
embeddedTerminalClearSelection(handle) {
|
|
15415
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalClearSelection(handle), "selection clear");
|
|
15416
|
+
}
|
|
15417
|
+
embeddedTerminalGetSelectedText(handle) {
|
|
15418
|
+
const required = new Uint32Array(1);
|
|
15419
|
+
const read = (output2) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output2), output2.byteLength, required);
|
|
15420
|
+
const initial = new Uint8Array(256);
|
|
15421
|
+
const status = read(initial);
|
|
15422
|
+
if (status >= 0)
|
|
15423
|
+
return initial.slice(0, status);
|
|
15424
|
+
if (status !== -4 || required[0] <= initial.byteLength)
|
|
15425
|
+
embeddedTerminalResult(status, "selection query");
|
|
15426
|
+
const output = new Uint8Array(required[0]);
|
|
15427
|
+
const length = embeddedTerminalResult(read(output), "selection query");
|
|
15428
|
+
return output.slice(0, length);
|
|
15429
|
+
}
|
|
15430
|
+
embeddedTerminalCompose(handle, target, x, y) {
|
|
15431
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCompose(handle, target, embeddedTerminalI32(x, "composition x"), embeddedTerminalI32(y, "composition y")), "compose");
|
|
15432
|
+
}
|
|
15433
|
+
embeddedTerminalCursor(handle) {
|
|
15434
|
+
const storage = this.ffiStructStorage.embeddedTerminalCursor;
|
|
15435
|
+
embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.buffer), "cursor query");
|
|
15436
|
+
const result = EmbeddedTerminalCursorStruct.unpack(storage.buffer);
|
|
15437
|
+
return {
|
|
15438
|
+
x: result.x,
|
|
15439
|
+
y: result.y,
|
|
15440
|
+
hasValue: result.hasValue,
|
|
15441
|
+
visible: result.visible,
|
|
15442
|
+
blinking: result.blinking,
|
|
15443
|
+
wideTail: result.wideTail,
|
|
15444
|
+
style: ["bar", "block", "underline", "block-hollow"][result.style] ?? "block",
|
|
15445
|
+
...result.colorHasValue ? { color: { r: result.colorR, g: result.colorG, b: result.colorB } } : {}
|
|
15446
|
+
};
|
|
15447
|
+
}
|
|
15448
|
+
embeddedTerminalEncodeKey(handle, key) {
|
|
15449
|
+
const options = this.ffiStructStorage.embeddedTerminalKeyOptions;
|
|
15450
|
+
EmbeddedTerminalKeyOptionsStruct.packInto({
|
|
15451
|
+
action: { release: 0, press: 1, repeat: 2 }[key.action ?? "press"],
|
|
15452
|
+
composing: key.composing ? 1 : 0,
|
|
15453
|
+
mods: key.mods ?? 0,
|
|
15454
|
+
consumedMods: key.consumedMods ?? 0,
|
|
15455
|
+
padding: 0,
|
|
15456
|
+
unshiftedCodepoint: key.unshiftedCodepoint ?? 0
|
|
15457
|
+
}, options.view, 0);
|
|
15458
|
+
const keyCode = key.key ? this.encoder.encode(key.key) : new Uint8Array;
|
|
15459
|
+
const keyCodeLength = toSafeFFIU32Length(keyCode.byteLength, "Embedded terminal physical key length");
|
|
15460
|
+
const text = key.text ? this.encoder.encode(key.text) : new Uint8Array;
|
|
15461
|
+
const textLength = toSafeFFIU32Length(text.byteLength, "Embedded terminal key text length");
|
|
15462
|
+
const required = new Uint32Array(1);
|
|
15463
|
+
const encode = (output2) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.buffer, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output2, output2.byteLength, required);
|
|
15464
|
+
const initial = new Uint8Array(Math.max(64, textLength));
|
|
15465
|
+
const status = encode(initial);
|
|
15466
|
+
if (status >= 0)
|
|
15467
|
+
return initial.slice(0, status);
|
|
15468
|
+
if (status !== -4 || required[0] <= initial.byteLength)
|
|
15469
|
+
embeddedTerminalResult(status, "key encoding");
|
|
15470
|
+
const output = new Uint8Array(required[0]);
|
|
15471
|
+
const length = embeddedTerminalResult(encode(output), "key encoding");
|
|
15472
|
+
return output.slice(0, length);
|
|
15473
|
+
}
|
|
15474
|
+
embeddedTerminalEncodeMouse(handle, mouse) {
|
|
15475
|
+
const output = new Uint8Array(128);
|
|
15476
|
+
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");
|
|
15477
|
+
return output.slice(0, length);
|
|
15478
|
+
}
|
|
15479
|
+
embeddedTerminalEncodePaste(handle, input) {
|
|
15480
|
+
const inputLength = toSafeFFIU32Length(input.byteLength, "Embedded terminal paste length");
|
|
15481
|
+
const outputLength = toSafeFFIU32Length(inputLength + 16, "Embedded terminal paste output length");
|
|
15482
|
+
const output = new Uint8Array(outputLength);
|
|
15483
|
+
const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodePaste(handle, inputLength === 0 ? null : input, inputLength, output, output.byteLength), "paste encoding");
|
|
15484
|
+
return output.slice(0, length);
|
|
15485
|
+
}
|
|
15486
|
+
embeddedTerminalEncodeFocus(handle, focused) {
|
|
15487
|
+
const output = new Uint8Array(16);
|
|
15488
|
+
const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodeFocus(handle, focused ? 1 : 0, output, output.byteLength), "focus encoding");
|
|
15489
|
+
return output.slice(0, length);
|
|
15490
|
+
}
|
|
15491
|
+
embeddedTerminalDrainResponses(handle) {
|
|
15492
|
+
const chunks = [];
|
|
15493
|
+
while (true) {
|
|
15494
|
+
const output = new Uint8Array(64 * 1024);
|
|
15495
|
+
const status = this.opentui.symbols.embeddedTerminalDrainResponses(handle, output, output.byteLength);
|
|
15496
|
+
if (status === -4)
|
|
15497
|
+
continue;
|
|
15498
|
+
const length = embeddedTerminalResult(status, "response drain");
|
|
15499
|
+
if (length > 0)
|
|
15500
|
+
chunks.push(output.slice(0, length));
|
|
15501
|
+
if (length < output.byteLength)
|
|
15502
|
+
break;
|
|
15503
|
+
}
|
|
15504
|
+
const result = new Uint8Array(chunks.reduce((total, chunk) => total + chunk.byteLength, 0));
|
|
15505
|
+
let offset = 0;
|
|
15506
|
+
for (const chunk of chunks) {
|
|
15507
|
+
result.set(chunk, offset);
|
|
15508
|
+
offset += chunk.byteLength;
|
|
15509
|
+
}
|
|
15510
|
+
return result;
|
|
15511
|
+
}
|
|
15245
15512
|
constructor(libPath) {
|
|
15246
15513
|
this.opentui = getOpenTUILib(libPath);
|
|
15247
15514
|
this.imageRetainIccCache();
|
|
@@ -15395,10 +15662,10 @@ class FFIRenderLib {
|
|
|
15395
15662
|
setTerminalEnvVar(renderer, key, value) {
|
|
15396
15663
|
const keyBytes = this.encoder.encode(key);
|
|
15397
15664
|
const valueBytes = this.encoder.encode(value);
|
|
15398
|
-
return this.opentui.symbols.setTerminalEnvVar(renderer,
|
|
15665
|
+
return this.opentui.symbols.setTerminalEnvVar(renderer, viewOrNull(keyBytes), keyBytes.byteLength, viewOrNull(valueBytes), valueBytes.byteLength);
|
|
15399
15666
|
}
|
|
15400
|
-
destroyRenderer(renderer) {
|
|
15401
|
-
this.opentui.symbols.destroyRenderer(renderer);
|
|
15667
|
+
destroyRenderer(renderer, flushInput = false) {
|
|
15668
|
+
this.opentui.symbols.destroyRenderer(renderer, ffiBool(flushInput));
|
|
15402
15669
|
}
|
|
15403
15670
|
setUseThread(renderer, useThread) {
|
|
15404
15671
|
this.opentui.symbols.setUseThread(renderer, ffiBool(useThread));
|
|
@@ -15407,7 +15674,7 @@ class FFIRenderLib {
|
|
|
15407
15674
|
this.opentui.symbols.setClearOnShutdown(renderer, ffiBool(clear));
|
|
15408
15675
|
}
|
|
15409
15676
|
setBackgroundColor(renderer, color) {
|
|
15410
|
-
this.opentui.symbols.setBackgroundColor(renderer,
|
|
15677
|
+
this.opentui.symbols.setBackgroundColor(renderer, rgbaBuffer(color));
|
|
15411
15678
|
}
|
|
15412
15679
|
setRenderOffset(renderer, offset) {
|
|
15413
15680
|
this.opentui.symbols.setRenderOffset(renderer, offset);
|
|
@@ -15435,7 +15702,7 @@ class FFIRenderLib {
|
|
|
15435
15702
|
}
|
|
15436
15703
|
getRenderStats(renderer) {
|
|
15437
15704
|
const statsBuffer = new ArrayBuffer(NativeRenderStatsStruct.size);
|
|
15438
|
-
this.opentui.symbols.getRenderStats(renderer,
|
|
15705
|
+
this.opentui.symbols.getRenderStats(renderer, statsBuffer);
|
|
15439
15706
|
const stats = NativeRenderStatsStruct.unpack(statsBuffer);
|
|
15440
15707
|
return {
|
|
15441
15708
|
nativeLastFrameTime: stats.lastFrameTime,
|
|
@@ -15470,7 +15737,7 @@ class FFIRenderLib {
|
|
|
15470
15737
|
for (let index = 0;index < palette.length; index++) {
|
|
15471
15738
|
paletteBuffer.set(palette[index].buffer, index * 4);
|
|
15472
15739
|
}
|
|
15473
|
-
this.opentui.symbols.rendererSetPaletteState(renderer,
|
|
15740
|
+
this.opentui.symbols.rendererSetPaletteState(renderer, paletteBuffer, palette.length, rgbaBuffer(defaultForeground), rgbaBuffer(defaultBackground), paletteEpoch >>> 0);
|
|
15474
15741
|
}
|
|
15475
15742
|
bufferGetCharPtr(buffer) {
|
|
15476
15743
|
const ptr3 = this.opentui.symbols.bufferGetCharPtr(buffer);
|
|
@@ -15509,14 +15776,14 @@ class FFIRenderLib {
|
|
|
15509
15776
|
bufferGetId(buffer) {
|
|
15510
15777
|
const maxLen = 256;
|
|
15511
15778
|
const outBuffer = new Uint8Array(maxLen);
|
|
15512
|
-
const actualLen = this.opentui.symbols.bufferGetId(buffer,
|
|
15779
|
+
const actualLen = this.opentui.symbols.bufferGetId(buffer, outBuffer, maxLen);
|
|
15513
15780
|
return this.decoder.decode(outBuffer.slice(0, actualLen));
|
|
15514
15781
|
}
|
|
15515
15782
|
bufferGetRealCharSize(buffer) {
|
|
15516
15783
|
return this.opentui.symbols.bufferGetRealCharSize(buffer);
|
|
15517
15784
|
}
|
|
15518
15785
|
bufferWriteResolvedChars(buffer, outputBuffer, addLineBreaks) {
|
|
15519
|
-
return this.opentui.symbols.bufferWriteResolvedChars(buffer,
|
|
15786
|
+
return this.opentui.symbols.bufferWriteResolvedChars(buffer, viewOrNull(outputBuffer), outputBuffer.byteLength, ffiBool(addLineBreaks));
|
|
15520
15787
|
}
|
|
15521
15788
|
getBufferWidth(buffer) {
|
|
15522
15789
|
return this.opentui.symbols.getBufferWidth(buffer);
|
|
@@ -15525,39 +15792,39 @@ class FFIRenderLib {
|
|
|
15525
15792
|
return this.opentui.symbols.getBufferHeight(buffer);
|
|
15526
15793
|
}
|
|
15527
15794
|
bufferClear(buffer, color) {
|
|
15528
|
-
this.opentui.symbols.bufferClear(buffer,
|
|
15795
|
+
this.opentui.symbols.bufferClear(buffer, rgbaBuffer(color));
|
|
15529
15796
|
}
|
|
15530
15797
|
bufferDrawText(buffer, text, x, y, color, bgColor, attributes) {
|
|
15531
15798
|
const textBytes = this.encoder.encode(text);
|
|
15532
|
-
const bg2 =
|
|
15533
|
-
const fg2 =
|
|
15534
|
-
this.opentui.symbols.bufferDrawText(buffer,
|
|
15799
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
15800
|
+
const fg2 = rgbaBuffer(color);
|
|
15801
|
+
this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg2, bg2, attributes ?? 0);
|
|
15535
15802
|
}
|
|
15536
15803
|
bufferSetCellWithAlphaBlending(buffer, x, y, char, color, bgColor, attributes) {
|
|
15537
15804
|
const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
|
|
15538
|
-
const bg2 =
|
|
15539
|
-
const fg2 =
|
|
15805
|
+
const bg2 = rgbaBuffer(bgColor);
|
|
15806
|
+
const fg2 = rgbaBuffer(color);
|
|
15540
15807
|
this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
|
|
15541
15808
|
}
|
|
15542
15809
|
bufferSetCell(buffer, x, y, char, color, bgColor, attributes) {
|
|
15543
15810
|
const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
|
|
15544
|
-
const bg2 =
|
|
15545
|
-
const fg2 =
|
|
15811
|
+
const bg2 = rgbaBuffer(bgColor);
|
|
15812
|
+
const fg2 = rgbaBuffer(color);
|
|
15546
15813
|
this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
|
|
15547
15814
|
}
|
|
15548
15815
|
bufferFillRect(buffer, x, y, width, height, color) {
|
|
15549
|
-
const bg2 =
|
|
15816
|
+
const bg2 = rgbaBuffer(color);
|
|
15550
15817
|
this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg2);
|
|
15551
15818
|
}
|
|
15552
|
-
bufferColorMatrix(buffer,
|
|
15553
|
-
this.opentui.symbols.bufferColorMatrix(buffer,
|
|
15819
|
+
bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target) {
|
|
15820
|
+
this.opentui.symbols.bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target);
|
|
15554
15821
|
}
|
|
15555
|
-
bufferColorMatrixUniform(buffer,
|
|
15556
|
-
this.opentui.symbols.bufferColorMatrixUniform(buffer,
|
|
15822
|
+
bufferColorMatrixUniform(buffer, matrix, strength, target) {
|
|
15823
|
+
this.opentui.symbols.bufferColorMatrixUniform(buffer, matrix, strength, target);
|
|
15557
15824
|
}
|
|
15558
|
-
bufferDrawSuperSampleBuffer(buffer, x, y,
|
|
15825
|
+
bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
|
|
15559
15826
|
const formatId = format === "bgra8unorm" ? 0 : 1;
|
|
15560
|
-
this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y,
|
|
15827
|
+
this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, formatId, alignedBytesPerRow);
|
|
15561
15828
|
}
|
|
15562
15829
|
bufferDrawImage(buffer, image, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol) {
|
|
15563
15830
|
const protocolId = { auto: 0, kitty: 1, sixel: 2, blocks: 3 }[protocol];
|
|
@@ -15577,38 +15844,38 @@ class FFIRenderLib {
|
|
|
15577
15844
|
}, storage.view, 0);
|
|
15578
15845
|
return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.buffer));
|
|
15579
15846
|
}
|
|
15580
|
-
bufferDrawPackedBuffer(buffer,
|
|
15581
|
-
this.opentui.symbols.bufferDrawPackedBuffer(buffer,
|
|
15847
|
+
bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
|
|
15848
|
+
this.opentui.symbols.bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
|
|
15582
15849
|
}
|
|
15583
|
-
bufferDrawGrayscaleBuffer(buffer, posX, posY,
|
|
15584
|
-
this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY,
|
|
15850
|
+
bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
|
|
15851
|
+
this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
|
|
15585
15852
|
}
|
|
15586
|
-
bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY,
|
|
15587
|
-
this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY,
|
|
15853
|
+
bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
|
|
15854
|
+
this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
|
|
15588
15855
|
}
|
|
15589
15856
|
bufferDrawGrid(buffer, borderChars, borderFg, borderBg, columnOffsets, columnCount, rowOffsets, rowCount, options) {
|
|
15590
15857
|
GridDrawOptionsStruct.packInto({ drawInner: options.drawInner, drawOuter: options.drawOuter }, this.ffiStructStorage.gridDrawOptions.view, 0);
|
|
15591
|
-
this.opentui.symbols.bufferDrawGrid(buffer,
|
|
15858
|
+
this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
|
|
15592
15859
|
}
|
|
15593
15860
|
bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
|
|
15594
15861
|
const titleBytes = title ? this.encoder.encode(title) : null;
|
|
15595
15862
|
const titleLen = titleBytes?.byteLength ?? 0;
|
|
15596
|
-
const
|
|
15863
|
+
const titleBuffer = titleBytes ? titleBytes : null;
|
|
15597
15864
|
const bottomTitleBytes = bottomTitle ? this.encoder.encode(bottomTitle) : null;
|
|
15598
15865
|
const bottomTitleLen = bottomTitleBytes?.byteLength ?? 0;
|
|
15599
|
-
const
|
|
15600
|
-
this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height,
|
|
15866
|
+
const bottomTitleBuffer = bottomTitleBytes ? bottomTitleBytes : null;
|
|
15867
|
+
this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, rgbaBuffer(borderColor), rgbaBuffer(backgroundColor), rgbaBuffer(titleColor), titleBuffer, titleLen, bottomTitleBuffer, bottomTitleLen);
|
|
15601
15868
|
}
|
|
15602
15869
|
bufferResize(buffer, width, height) {
|
|
15603
15870
|
this.opentui.symbols.bufferResize(buffer, width, height);
|
|
15604
15871
|
}
|
|
15605
15872
|
linkAlloc(url) {
|
|
15606
15873
|
const urlBytes = this.encoder.encode(url);
|
|
15607
|
-
return this.opentui.symbols.linkAlloc(
|
|
15874
|
+
return this.opentui.symbols.linkAlloc(viewOrNull(urlBytes), urlBytes.byteLength);
|
|
15608
15875
|
}
|
|
15609
15876
|
linkGetUrl(linkId, maxLen = 512) {
|
|
15610
15877
|
const outBuffer = new Uint8Array(maxLen);
|
|
15611
|
-
const actualLen = this.opentui.symbols.linkGetUrl(linkId,
|
|
15878
|
+
const actualLen = this.opentui.symbols.linkGetUrl(linkId, viewOrNull(outBuffer), maxLen);
|
|
15612
15879
|
return this.decoder.decode(outBuffer.slice(0, actualLen));
|
|
15613
15880
|
}
|
|
15614
15881
|
attributesWithLink(baseAttributes, linkId) {
|
|
@@ -15624,11 +15891,11 @@ class FFIRenderLib {
|
|
|
15624
15891
|
this.opentui.symbols.setCursorPosition(renderer, x, y, ffiBool(visible));
|
|
15625
15892
|
}
|
|
15626
15893
|
setCursorColor(renderer, color) {
|
|
15627
|
-
this.opentui.symbols.setCursorColor(renderer,
|
|
15894
|
+
this.opentui.symbols.setCursorColor(renderer, rgbaBuffer(color));
|
|
15628
15895
|
}
|
|
15629
15896
|
getCursorState(renderer) {
|
|
15630
15897
|
const cursorBuffer = new ArrayBuffer(CursorStateStruct.size);
|
|
15631
|
-
this.opentui.symbols.getCursorState(renderer,
|
|
15898
|
+
this.opentui.symbols.getCursorState(renderer, cursorBuffer);
|
|
15632
15899
|
const struct = CursorStateStruct.unpack(cursorBuffer);
|
|
15633
15900
|
return {
|
|
15634
15901
|
x: struct.x,
|
|
@@ -15669,7 +15936,7 @@ class FFIRenderLib {
|
|
|
15669
15936
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
15670
15937
|
const idToUse = id || "unnamed buffer";
|
|
15671
15938
|
const idBytes = this.encoder.encode(idToUse);
|
|
15672
|
-
const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode,
|
|
15939
|
+
const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode, idBytes, idBytes.byteLength);
|
|
15673
15940
|
if (!bufferPtr) {
|
|
15674
15941
|
throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
|
|
15675
15942
|
}
|
|
@@ -15693,12 +15960,12 @@ class FFIRenderLib {
|
|
|
15693
15960
|
}
|
|
15694
15961
|
setTerminalTitle(renderer, title) {
|
|
15695
15962
|
const titleBytes = this.encoder.encode(title);
|
|
15696
|
-
this.opentui.symbols.setTerminalTitle(renderer,
|
|
15963
|
+
this.opentui.symbols.setTerminalTitle(renderer, viewOrNull(titleBytes), titleBytes.byteLength);
|
|
15697
15964
|
}
|
|
15698
15965
|
copyToClipboardOSC52(renderer, target, textUtf8) {
|
|
15699
15966
|
if (textUtf8.byteLength > 4294967295)
|
|
15700
15967
|
return false;
|
|
15701
|
-
return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target,
|
|
15968
|
+
return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target, viewOrNull(textUtf8), textUtf8.byteLength));
|
|
15702
15969
|
}
|
|
15703
15970
|
clearClipboardOSC52(renderer, target) {
|
|
15704
15971
|
return Boolean(this.opentui.symbols.clearClipboardOSC52(renderer, target));
|
|
@@ -15873,7 +16140,7 @@ class FFIRenderLib {
|
|
|
15873
16140
|
const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data;
|
|
15874
16141
|
if (bytes.length === 0)
|
|
15875
16142
|
return;
|
|
15876
|
-
this.opentui.symbols.writeOut(renderer,
|
|
16143
|
+
this.opentui.symbols.writeOut(renderer, viewOrNull(bytes), bytes.byteLength);
|
|
15877
16144
|
}
|
|
15878
16145
|
yogaConfigCreate() {
|
|
15879
16146
|
const config = this.opentui.symbols.yogaConfigCreate();
|
|
@@ -15985,7 +16252,7 @@ class FFIRenderLib {
|
|
|
15985
16252
|
}
|
|
15986
16253
|
yogaNodeGetComputedLayout(node) {
|
|
15987
16254
|
const layout = this.yogaLayout;
|
|
15988
|
-
this.opentui.symbols.yogaNodeGetComputedLayout(node, this.
|
|
16255
|
+
this.opentui.symbols.yogaNodeGetComputedLayout(node, this.yogaLayout);
|
|
15989
16256
|
return {
|
|
15990
16257
|
left: layout[0],
|
|
15991
16258
|
top: layout[1],
|
|
@@ -16082,16 +16349,16 @@ class FFIRenderLib {
|
|
|
16082
16349
|
this.opentui.symbols.textBufferClear(buffer);
|
|
16083
16350
|
}
|
|
16084
16351
|
textBufferSetDefaultFg(buffer, fg2) {
|
|
16085
|
-
const
|
|
16086
|
-
this.opentui.symbols.textBufferSetDefaultFg(buffer,
|
|
16352
|
+
const fgBuffer = optionalRgbaBuffer(fg2);
|
|
16353
|
+
this.opentui.symbols.textBufferSetDefaultFg(buffer, fgBuffer);
|
|
16087
16354
|
}
|
|
16088
16355
|
textBufferSetDefaultBg(buffer, bg2) {
|
|
16089
|
-
const
|
|
16090
|
-
this.opentui.symbols.textBufferSetDefaultBg(buffer,
|
|
16356
|
+
const bgBuffer = optionalRgbaBuffer(bg2);
|
|
16357
|
+
this.opentui.symbols.textBufferSetDefaultBg(buffer, bgBuffer);
|
|
16091
16358
|
}
|
|
16092
16359
|
textBufferSetDefaultAttributes(buffer, attributes) {
|
|
16093
16360
|
const attrValue = attributes === null ? null : new Uint32Array([attributes]);
|
|
16094
|
-
this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue
|
|
16361
|
+
this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue);
|
|
16095
16362
|
}
|
|
16096
16363
|
textBufferResetDefaults(buffer) {
|
|
16097
16364
|
this.opentui.symbols.textBufferResetDefaults(buffer);
|
|
@@ -16103,14 +16370,14 @@ class FFIRenderLib {
|
|
|
16103
16370
|
this.opentui.symbols.textBufferSetTabWidth(buffer, width);
|
|
16104
16371
|
}
|
|
16105
16372
|
textBufferRegisterMemBuffer(buffer, bytes, owned = false) {
|
|
16106
|
-
const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer,
|
|
16373
|
+
const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
|
|
16107
16374
|
if (result === 65535) {
|
|
16108
16375
|
throw new Error("Failed to register memory buffer");
|
|
16109
16376
|
}
|
|
16110
16377
|
return result;
|
|
16111
16378
|
}
|
|
16112
16379
|
textBufferReplaceMemBuffer(buffer, memId, bytes, owned = false) {
|
|
16113
|
-
return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId,
|
|
16380
|
+
return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
|
|
16114
16381
|
}
|
|
16115
16382
|
textBufferClearMemRegistry(buffer) {
|
|
16116
16383
|
this.opentui.symbols.textBufferClearMemRegistry(buffer);
|
|
@@ -16119,14 +16386,14 @@ class FFIRenderLib {
|
|
|
16119
16386
|
this.opentui.symbols.textBufferSetTextFromMem(buffer, memId);
|
|
16120
16387
|
}
|
|
16121
16388
|
textBufferAppend(buffer, bytes) {
|
|
16122
|
-
this.opentui.symbols.textBufferAppend(buffer,
|
|
16389
|
+
this.opentui.symbols.textBufferAppend(buffer, retainedPtrOrNull(bytes), bytes.byteLength);
|
|
16123
16390
|
}
|
|
16124
16391
|
textBufferAppendFromMemId(buffer, memId) {
|
|
16125
16392
|
this.opentui.symbols.textBufferAppendFromMemId(buffer, memId);
|
|
16126
16393
|
}
|
|
16127
16394
|
textBufferLoadFile(buffer, path3) {
|
|
16128
16395
|
const pathBytes = this.encoder.encode(path3);
|
|
16129
|
-
return this.opentui.symbols.textBufferLoadFile(buffer,
|
|
16396
|
+
return this.opentui.symbols.textBufferLoadFile(buffer, viewOrNull(pathBytes), pathBytes.byteLength);
|
|
16130
16397
|
}
|
|
16131
16398
|
textBufferSetStyledText(buffer, chunks) {
|
|
16132
16399
|
if (chunks.length === 0) {
|
|
@@ -16139,12 +16406,12 @@ class FFIRenderLib {
|
|
|
16139
16406
|
textBufferGetLineCount(buffer) {
|
|
16140
16407
|
return this.opentui.symbols.textBufferGetLineCount(buffer);
|
|
16141
16408
|
}
|
|
16142
|
-
textBufferGetPlainText(buffer,
|
|
16143
|
-
return this.opentui.symbols.textBufferGetPlainText(buffer,
|
|
16409
|
+
textBufferGetPlainText(buffer, outBuffer, maxLen) {
|
|
16410
|
+
return this.opentui.symbols.textBufferGetPlainText(buffer, outBuffer, maxLen);
|
|
16144
16411
|
}
|
|
16145
16412
|
getPlainTextBytes(buffer, maxLength) {
|
|
16146
16413
|
const outBuffer = new Uint8Array(maxLength);
|
|
16147
|
-
const actualLen = this.textBufferGetPlainText(buffer,
|
|
16414
|
+
const actualLen = this.textBufferGetPlainText(buffer, viewOrNull(outBuffer), maxLength);
|
|
16148
16415
|
if (actualLen === 0) {
|
|
16149
16416
|
return null;
|
|
16150
16417
|
}
|
|
@@ -16152,7 +16419,7 @@ class FFIRenderLib {
|
|
|
16152
16419
|
}
|
|
16153
16420
|
textBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
|
|
16154
16421
|
const outBuffer = new Uint8Array(maxLength);
|
|
16155
|
-
const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset,
|
|
16422
|
+
const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
|
|
16156
16423
|
const len = actualLen;
|
|
16157
16424
|
if (len === 0) {
|
|
16158
16425
|
return null;
|
|
@@ -16161,7 +16428,7 @@ class FFIRenderLib {
|
|
|
16161
16428
|
}
|
|
16162
16429
|
textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
|
|
16163
16430
|
const outBuffer = new Uint8Array(maxLength);
|
|
16164
|
-
const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol,
|
|
16431
|
+
const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, viewOrNull(outBuffer), maxLength);
|
|
16165
16432
|
const len = actualLen;
|
|
16166
16433
|
if (len === 0) {
|
|
16167
16434
|
return null;
|
|
@@ -16179,8 +16446,8 @@ class FFIRenderLib {
|
|
|
16179
16446
|
this.opentui.symbols.destroyTextBufferView(view);
|
|
16180
16447
|
}
|
|
16181
16448
|
textBufferViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
16182
|
-
const bg2 =
|
|
16183
|
-
const fg2 =
|
|
16449
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16450
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16184
16451
|
this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg2, fg2);
|
|
16185
16452
|
}
|
|
16186
16453
|
textBufferViewResetSelection(view) {
|
|
@@ -16199,18 +16466,18 @@ class FFIRenderLib {
|
|
|
16199
16466
|
return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
|
|
16200
16467
|
}
|
|
16201
16468
|
textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16202
|
-
const bg2 =
|
|
16203
|
-
const fg2 =
|
|
16469
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16470
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16204
16471
|
return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16205
16472
|
}
|
|
16206
16473
|
textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16207
|
-
const bg2 =
|
|
16208
|
-
const fg2 =
|
|
16474
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16475
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16209
16476
|
this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
|
|
16210
16477
|
}
|
|
16211
16478
|
textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16212
|
-
const bg2 =
|
|
16213
|
-
const fg2 =
|
|
16479
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16480
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16214
16481
|
return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16215
16482
|
}
|
|
16216
16483
|
textBufferViewResetLocalSelection(view) {
|
|
@@ -16234,7 +16501,7 @@ class FFIRenderLib {
|
|
|
16234
16501
|
}
|
|
16235
16502
|
textBufferViewGetLineInfo(view) {
|
|
16236
16503
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16237
|
-
this.textBufferViewGetLineInfoDirect(view,
|
|
16504
|
+
this.textBufferViewGetLineInfoDirect(view, outBuffer);
|
|
16238
16505
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16239
16506
|
const lineStartCols = struct.startCols;
|
|
16240
16507
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16249,7 +16516,7 @@ class FFIRenderLib {
|
|
|
16249
16516
|
}
|
|
16250
16517
|
textBufferViewGetLogicalLineInfo(view) {
|
|
16251
16518
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16252
|
-
this.textBufferViewGetLogicalLineInfoDirect(view,
|
|
16519
|
+
this.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16253
16520
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16254
16521
|
const lineStartCols = struct.startCols;
|
|
16255
16522
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16265,21 +16532,21 @@ class FFIRenderLib {
|
|
|
16265
16532
|
textBufferViewGetVirtualLineCount(view) {
|
|
16266
16533
|
return this.opentui.symbols.textBufferViewGetVirtualLineCount(view);
|
|
16267
16534
|
}
|
|
16268
|
-
textBufferViewGetLineInfoDirect(view,
|
|
16269
|
-
this.opentui.symbols.textBufferViewGetLineInfoDirect(view,
|
|
16535
|
+
textBufferViewGetLineInfoDirect(view, outBuffer) {
|
|
16536
|
+
this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outBuffer);
|
|
16270
16537
|
}
|
|
16271
|
-
textBufferViewGetLogicalLineInfoDirect(view,
|
|
16272
|
-
this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view,
|
|
16538
|
+
textBufferViewGetLogicalLineInfoDirect(view, outBuffer) {
|
|
16539
|
+
this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16273
16540
|
}
|
|
16274
|
-
textBufferViewGetSelectedText(view,
|
|
16275
|
-
return this.opentui.symbols.textBufferViewGetSelectedText(view,
|
|
16541
|
+
textBufferViewGetSelectedText(view, outBuffer, maxLen) {
|
|
16542
|
+
return this.opentui.symbols.textBufferViewGetSelectedText(view, outBuffer, maxLen);
|
|
16276
16543
|
}
|
|
16277
|
-
textBufferViewGetPlainText(view,
|
|
16278
|
-
return this.opentui.symbols.textBufferViewGetPlainText(view,
|
|
16544
|
+
textBufferViewGetPlainText(view, outBuffer, maxLen) {
|
|
16545
|
+
return this.opentui.symbols.textBufferViewGetPlainText(view, outBuffer, maxLen);
|
|
16279
16546
|
}
|
|
16280
16547
|
textBufferViewGetSelectedTextBytes(view, maxLength) {
|
|
16281
16548
|
const outBuffer = new Uint8Array(maxLength);
|
|
16282
|
-
const actualLen = this.textBufferViewGetSelectedText(view,
|
|
16549
|
+
const actualLen = this.textBufferViewGetSelectedText(view, viewOrNull(outBuffer), maxLength);
|
|
16283
16550
|
if (actualLen === 0) {
|
|
16284
16551
|
return null;
|
|
16285
16552
|
}
|
|
@@ -16287,7 +16554,7 @@ class FFIRenderLib {
|
|
|
16287
16554
|
}
|
|
16288
16555
|
textBufferViewGetPlainTextBytes(view, maxLength) {
|
|
16289
16556
|
const outBuffer = new Uint8Array(maxLength);
|
|
16290
|
-
const actualLen = this.textBufferViewGetPlainText(view,
|
|
16557
|
+
const actualLen = this.textBufferViewGetPlainText(view, viewOrNull(outBuffer), maxLength);
|
|
16291
16558
|
if (actualLen === 0) {
|
|
16292
16559
|
return null;
|
|
16293
16560
|
}
|
|
@@ -16297,7 +16564,7 @@ class FFIRenderLib {
|
|
|
16297
16564
|
this.opentui.symbols.textBufferViewSetTabIndicator(view, indicator);
|
|
16298
16565
|
}
|
|
16299
16566
|
textBufferViewSetTabIndicatorColor(view, color) {
|
|
16300
|
-
this.opentui.symbols.textBufferViewSetTabIndicatorColor(view,
|
|
16567
|
+
this.opentui.symbols.textBufferViewSetTabIndicatorColor(view, rgbaBuffer(color));
|
|
16301
16568
|
}
|
|
16302
16569
|
textBufferViewSetTruncate(view, truncate) {
|
|
16303
16570
|
this.opentui.symbols.textBufferViewSetTruncate(view, ffiBool(truncate));
|
|
@@ -16312,11 +16579,11 @@ class FFIRenderLib {
|
|
|
16312
16579
|
}
|
|
16313
16580
|
textBufferAddHighlightByCharRange(buffer, highlight) {
|
|
16314
16581
|
const packedHighlight = HighlightStruct.pack(highlight);
|
|
16315
|
-
this.opentui.symbols.textBufferAddHighlightByCharRange(buffer,
|
|
16582
|
+
this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, packedHighlight);
|
|
16316
16583
|
}
|
|
16317
16584
|
textBufferAddHighlight(buffer, lineIdx, highlight) {
|
|
16318
16585
|
const packedHighlight = HighlightStruct.pack(highlight);
|
|
16319
|
-
this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx,
|
|
16586
|
+
this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, packedHighlight);
|
|
16320
16587
|
}
|
|
16321
16588
|
textBufferRemoveHighlightsByRef(buffer, hlRef) {
|
|
16322
16589
|
this.opentui.symbols.textBufferRemoveHighlightsByRef(buffer, hlRef);
|
|
@@ -16332,7 +16599,7 @@ class FFIRenderLib {
|
|
|
16332
16599
|
}
|
|
16333
16600
|
textBufferGetLineHighlights(buffer, lineIdx) {
|
|
16334
16601
|
const outCountBuf = new Uint32Array(1);
|
|
16335
|
-
const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx,
|
|
16602
|
+
const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, outCountBuf);
|
|
16336
16603
|
if (!nativePtr)
|
|
16337
16604
|
return [];
|
|
16338
16605
|
const count = outCountBuf[0];
|
|
@@ -16351,7 +16618,7 @@ class FFIRenderLib {
|
|
|
16351
16618
|
}
|
|
16352
16619
|
getBuildOptions() {
|
|
16353
16620
|
const optionsBuffer = new ArrayBuffer(BuildOptionsStruct.size);
|
|
16354
|
-
this.opentui.symbols.getBuildOptions(
|
|
16621
|
+
this.opentui.symbols.getBuildOptions(optionsBuffer);
|
|
16355
16622
|
const options = BuildOptionsStruct.unpack(optionsBuffer);
|
|
16356
16623
|
return {
|
|
16357
16624
|
gpaSafeStats: !!options.gpaSafeStats,
|
|
@@ -16360,7 +16627,7 @@ class FFIRenderLib {
|
|
|
16360
16627
|
}
|
|
16361
16628
|
getAllocatorStats() {
|
|
16362
16629
|
const statsBuffer = new ArrayBuffer(AllocatorStatsStruct.size);
|
|
16363
|
-
this.opentui.symbols.getAllocatorStats(
|
|
16630
|
+
this.opentui.symbols.getAllocatorStats(statsBuffer);
|
|
16364
16631
|
const stats = AllocatorStatsStruct.unpack(statsBuffer);
|
|
16365
16632
|
return {
|
|
16366
16633
|
totalRequestedBytes: toNumber(stats.totalRequestedBytes),
|
|
@@ -16397,7 +16664,7 @@ class FFIRenderLib {
|
|
|
16397
16664
|
const y = new Uint32Array(1);
|
|
16398
16665
|
const width = new Uint32Array(1);
|
|
16399
16666
|
const height = new Uint32Array(1);
|
|
16400
|
-
this.opentui.symbols.editorViewGetViewport(view,
|
|
16667
|
+
this.opentui.symbols.editorViewGetViewport(view, x, y, width, height);
|
|
16401
16668
|
return {
|
|
16402
16669
|
offsetX: x[0],
|
|
16403
16670
|
offsetY: y[0],
|
|
@@ -16427,7 +16694,7 @@ class FFIRenderLib {
|
|
|
16427
16694
|
}
|
|
16428
16695
|
editorViewGetLineInfo(view) {
|
|
16429
16696
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16430
|
-
this.opentui.symbols.editorViewGetLineInfoDirect(view,
|
|
16697
|
+
this.opentui.symbols.editorViewGetLineInfoDirect(view, outBuffer);
|
|
16431
16698
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16432
16699
|
const lineStartCols = struct.startCols;
|
|
16433
16700
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16442,7 +16709,7 @@ class FFIRenderLib {
|
|
|
16442
16709
|
}
|
|
16443
16710
|
editorViewGetLogicalLineInfo(view) {
|
|
16444
16711
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16445
|
-
this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view,
|
|
16712
|
+
this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16446
16713
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16447
16714
|
const lineStartCols = struct.startCols;
|
|
16448
16715
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16467,20 +16734,20 @@ class FFIRenderLib {
|
|
|
16467
16734
|
this.opentui.symbols.destroyEditBuffer(buffer);
|
|
16468
16735
|
}
|
|
16469
16736
|
editBufferSetText(buffer, textBytes) {
|
|
16470
|
-
this.opentui.symbols.editBufferSetText(buffer,
|
|
16737
|
+
this.opentui.symbols.editBufferSetText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16471
16738
|
}
|
|
16472
16739
|
editBufferSetTextFromMem(buffer, memId) {
|
|
16473
16740
|
this.opentui.symbols.editBufferSetTextFromMem(buffer, memId);
|
|
16474
16741
|
}
|
|
16475
16742
|
editBufferReplaceText(buffer, textBytes) {
|
|
16476
|
-
this.opentui.symbols.editBufferReplaceText(buffer,
|
|
16743
|
+
this.opentui.symbols.editBufferReplaceText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16477
16744
|
}
|
|
16478
16745
|
editBufferReplaceTextFromMem(buffer, memId) {
|
|
16479
16746
|
this.opentui.symbols.editBufferReplaceTextFromMem(buffer, memId);
|
|
16480
16747
|
}
|
|
16481
16748
|
editBufferGetText(buffer, maxLength) {
|
|
16482
16749
|
const outBuffer = new Uint8Array(maxLength);
|
|
16483
|
-
const actualLen = this.opentui.symbols.editBufferGetText(buffer,
|
|
16750
|
+
const actualLen = this.opentui.symbols.editBufferGetText(buffer, viewOrNull(outBuffer), maxLength);
|
|
16484
16751
|
const len = actualLen;
|
|
16485
16752
|
if (len === 0)
|
|
16486
16753
|
return null;
|
|
@@ -16488,11 +16755,11 @@ class FFIRenderLib {
|
|
|
16488
16755
|
}
|
|
16489
16756
|
editBufferInsertChar(buffer, char) {
|
|
16490
16757
|
const charBytes = this.encoder.encode(char);
|
|
16491
|
-
this.opentui.symbols.editBufferInsertChar(buffer,
|
|
16758
|
+
this.opentui.symbols.editBufferInsertChar(buffer, viewOrNull(charBytes), charBytes.byteLength);
|
|
16492
16759
|
}
|
|
16493
16760
|
editBufferInsertText(buffer, text) {
|
|
16494
16761
|
const textBytes = this.encoder.encode(text);
|
|
16495
|
-
this.opentui.symbols.editBufferInsertText(buffer,
|
|
16762
|
+
this.opentui.symbols.editBufferInsertText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16496
16763
|
}
|
|
16497
16764
|
editBufferDeleteChar(buffer) {
|
|
16498
16765
|
this.opentui.symbols.editBufferDeleteChar(buffer);
|
|
@@ -16554,7 +16821,7 @@ class FFIRenderLib {
|
|
|
16554
16821
|
}
|
|
16555
16822
|
editBufferUndo(buffer, maxLength) {
|
|
16556
16823
|
const outBuffer = new Uint8Array(maxLength);
|
|
16557
|
-
const actualLen = this.opentui.symbols.editBufferUndo(buffer,
|
|
16824
|
+
const actualLen = this.opentui.symbols.editBufferUndo(buffer, viewOrNull(outBuffer), maxLength);
|
|
16558
16825
|
const len = actualLen;
|
|
16559
16826
|
if (len === 0)
|
|
16560
16827
|
return null;
|
|
@@ -16562,7 +16829,7 @@ class FFIRenderLib {
|
|
|
16562
16829
|
}
|
|
16563
16830
|
editBufferRedo(buffer, maxLength) {
|
|
16564
16831
|
const outBuffer = new Uint8Array(maxLength);
|
|
16565
|
-
const actualLen = this.opentui.symbols.editBufferRedo(buffer,
|
|
16832
|
+
const actualLen = this.opentui.symbols.editBufferRedo(buffer, viewOrNull(outBuffer), maxLength);
|
|
16566
16833
|
const len = actualLen;
|
|
16567
16834
|
if (len === 0)
|
|
16568
16835
|
return null;
|
|
@@ -16614,7 +16881,7 @@ class FFIRenderLib {
|
|
|
16614
16881
|
}
|
|
16615
16882
|
editBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
|
|
16616
16883
|
const outBuffer = new Uint8Array(maxLength);
|
|
16617
|
-
const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset,
|
|
16884
|
+
const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
|
|
16618
16885
|
const len = actualLen;
|
|
16619
16886
|
if (len === 0)
|
|
16620
16887
|
return null;
|
|
@@ -16622,15 +16889,15 @@ class FFIRenderLib {
|
|
|
16622
16889
|
}
|
|
16623
16890
|
editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
|
|
16624
16891
|
const outBuffer = new Uint8Array(maxLength);
|
|
16625
|
-
const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol,
|
|
16892
|
+
const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, viewOrNull(outBuffer), maxLength);
|
|
16626
16893
|
const len = actualLen;
|
|
16627
16894
|
if (len === 0)
|
|
16628
16895
|
return null;
|
|
16629
16896
|
return usesBunFFI ? outBuffer.slice(0, len) : trimNodeFFIOutputBytes(outBuffer, len);
|
|
16630
16897
|
}
|
|
16631
16898
|
editorViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
16632
|
-
const bg2 =
|
|
16633
|
-
const fg2 =
|
|
16899
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16900
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16634
16901
|
this.opentui.symbols.editorViewSetSelection(view, start, end, bg2, fg2);
|
|
16635
16902
|
}
|
|
16636
16903
|
editorViewResetSelection(view) {
|
|
@@ -16646,18 +16913,18 @@ class FFIRenderLib {
|
|
|
16646
16913
|
return { start, end };
|
|
16647
16914
|
}
|
|
16648
16915
|
editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16649
|
-
const bg2 =
|
|
16650
|
-
const fg2 =
|
|
16916
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16917
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16651
16918
|
return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
|
|
16652
16919
|
}
|
|
16653
16920
|
editorViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16654
|
-
const bg2 =
|
|
16655
|
-
const fg2 =
|
|
16921
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16922
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16656
16923
|
this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
|
|
16657
16924
|
}
|
|
16658
16925
|
editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16659
|
-
const bg2 =
|
|
16660
|
-
const fg2 =
|
|
16926
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16927
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16661
16928
|
return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
|
|
16662
16929
|
}
|
|
16663
16930
|
editorViewResetLocalSelection(view) {
|
|
@@ -16665,7 +16932,7 @@ class FFIRenderLib {
|
|
|
16665
16932
|
}
|
|
16666
16933
|
editorViewGetSelectedTextBytes(view, maxLength) {
|
|
16667
16934
|
const outBuffer = new Uint8Array(maxLength);
|
|
16668
|
-
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view,
|
|
16935
|
+
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, viewOrNull(outBuffer), maxLength);
|
|
16669
16936
|
const len = actualLen;
|
|
16670
16937
|
if (len === 0)
|
|
16671
16938
|
return null;
|
|
@@ -16674,12 +16941,12 @@ class FFIRenderLib {
|
|
|
16674
16941
|
editorViewGetCursor(view) {
|
|
16675
16942
|
const row = new Uint32Array(1);
|
|
16676
16943
|
const col = new Uint32Array(1);
|
|
16677
|
-
this.opentui.symbols.editorViewGetCursor(view,
|
|
16944
|
+
this.opentui.symbols.editorViewGetCursor(view, row, col);
|
|
16678
16945
|
return { row: row[0], col: col[0] };
|
|
16679
16946
|
}
|
|
16680
16947
|
editorViewGetText(view, maxLength) {
|
|
16681
16948
|
const outBuffer = new Uint8Array(maxLength);
|
|
16682
|
-
const actualLen = this.opentui.symbols.editorViewGetText(view,
|
|
16949
|
+
const actualLen = this.opentui.symbols.editorViewGetText(view, viewOrNull(outBuffer), maxLength);
|
|
16683
16950
|
const len = actualLen;
|
|
16684
16951
|
if (len === 0)
|
|
16685
16952
|
return null;
|
|
@@ -16756,7 +17023,7 @@ class FFIRenderLib {
|
|
|
16756
17023
|
}
|
|
16757
17024
|
getTerminalCapabilities(renderer) {
|
|
16758
17025
|
const capsBuffer = new ArrayBuffer(TerminalCapabilitiesStruct.size);
|
|
16759
|
-
this.opentui.symbols.getTerminalCapabilities(renderer,
|
|
17026
|
+
this.opentui.symbols.getTerminalCapabilities(renderer, capsBuffer);
|
|
16760
17027
|
const caps = TerminalCapabilitiesStruct.unpack(capsBuffer);
|
|
16761
17028
|
return {
|
|
16762
17029
|
kitty_keyboard: caps.kitty_keyboard,
|
|
@@ -16789,14 +17056,14 @@ class FFIRenderLib {
|
|
|
16789
17056
|
}
|
|
16790
17057
|
processCapabilityResponse(renderer, response) {
|
|
16791
17058
|
const responseBytes = this.encoder.encode(response);
|
|
16792
|
-
this.opentui.symbols.processCapabilityResponse(renderer,
|
|
17059
|
+
this.opentui.symbols.processCapabilityResponse(renderer, viewOrNull(responseBytes), responseBytes.byteLength);
|
|
16793
17060
|
}
|
|
16794
17061
|
encodeUnicode(text, widthMethod) {
|
|
16795
17062
|
const textBytes = this.encoder.encode(text);
|
|
16796
17063
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
16797
17064
|
const outPtrBuffer = new ArrayBuffer(8);
|
|
16798
17065
|
const outLenBuffer = new ArrayBuffer(8);
|
|
16799
|
-
const success = this.opentui.symbols.encodeUnicode(
|
|
17066
|
+
const success = this.opentui.symbols.encodeUnicode(viewOrNull(textBytes), textBytes.byteLength, outPtrBuffer, outLenBuffer, widthMethodCode);
|
|
16800
17067
|
if (!success) {
|
|
16801
17068
|
return null;
|
|
16802
17069
|
}
|
|
@@ -16816,11 +17083,11 @@ class FFIRenderLib {
|
|
|
16816
17083
|
this.opentui.symbols.freeUnicode(encoded.ptr, encoded.data.length);
|
|
16817
17084
|
}
|
|
16818
17085
|
bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
|
|
16819
|
-
this.opentui.symbols.bufferDrawChar(buffer, char, x, y,
|
|
17086
|
+
this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg2), rgbaBuffer(bg2), attributes);
|
|
16820
17087
|
}
|
|
16821
17088
|
createAudioEngine(options) {
|
|
16822
17089
|
const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
|
|
16823
|
-
const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer
|
|
17090
|
+
const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer);
|
|
16824
17091
|
return engineHandle ? engineHandle : null;
|
|
16825
17092
|
}
|
|
16826
17093
|
destroyAudioEngine(engine) {
|
|
@@ -16834,7 +17101,7 @@ class FFIRenderLib {
|
|
|
16834
17101
|
}
|
|
16835
17102
|
audioGetPlaybackDeviceName(engine, index) {
|
|
16836
17103
|
const outBuffer = new Uint8Array(512);
|
|
16837
|
-
const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index,
|
|
17104
|
+
const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index, outBuffer, outBuffer.length));
|
|
16838
17105
|
const safeBytesWritten = Math.max(0, Math.min(outBuffer.length, bytesWritten));
|
|
16839
17106
|
return this.decoder.decode(outBuffer.subarray(0, safeBytesWritten));
|
|
16840
17107
|
}
|
|
@@ -16924,7 +17191,7 @@ class FFIRenderLib {
|
|
|
16924
17191
|
} catch {
|
|
16925
17192
|
return -1;
|
|
16926
17193
|
}
|
|
16927
|
-
return this.opentui.symbols.audioStart(engine, optionsBuffer
|
|
17194
|
+
return this.opentui.symbols.audioStart(engine, optionsBuffer);
|
|
16928
17195
|
}
|
|
16929
17196
|
audioStartMixer(engine) {
|
|
16930
17197
|
return this.opentui.symbols.audioStartMixer(engine);
|
|
@@ -16983,7 +17250,7 @@ class FFIRenderLib {
|
|
|
16983
17250
|
audioLoad(engine, data) {
|
|
16984
17251
|
const outBuffer = new ArrayBuffer(4);
|
|
16985
17252
|
const dataLength = toSafeFFIU32Length(data.byteLength, "Audio data length");
|
|
16986
|
-
const status = this.opentui.symbols.audioLoad(engine,
|
|
17253
|
+
const status = this.opentui.symbols.audioLoad(engine, data, dataLength, outBuffer);
|
|
16987
17254
|
if (status !== 0) {
|
|
16988
17255
|
return { status, soundId: null };
|
|
16989
17256
|
}
|
|
@@ -16998,7 +17265,7 @@ class FFIRenderLib {
|
|
|
16998
17265
|
return { status: -1, voiceId: null };
|
|
16999
17266
|
const outBuffer = new ArrayBuffer(4);
|
|
17000
17267
|
const optionsBuffer = options ? AudioVoiceOptionsStruct.pack(options) : null;
|
|
17001
|
-
const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer
|
|
17268
|
+
const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer, outBuffer);
|
|
17002
17269
|
if (status !== 0) {
|
|
17003
17270
|
return { status, voiceId: null };
|
|
17004
17271
|
}
|
|
@@ -17017,7 +17284,7 @@ class FFIRenderLib {
|
|
|
17017
17284
|
const outBuffer = new ArrayBuffer(4);
|
|
17018
17285
|
const nameBytes = this.encoder.encode(name);
|
|
17019
17286
|
const nameLength = toSafeFFIU32Length(nameBytes.byteLength, "Audio group name length");
|
|
17020
|
-
const status = this.opentui.symbols.audioCreateGroup(engine,
|
|
17287
|
+
const status = this.opentui.symbols.audioCreateGroup(engine, nameBytes, nameLength, outBuffer);
|
|
17021
17288
|
if (status !== 0) {
|
|
17022
17289
|
return { status, groupId: null };
|
|
17023
17290
|
}
|
|
@@ -17031,14 +17298,14 @@ class FFIRenderLib {
|
|
|
17031
17298
|
return this.opentui.symbols.audioSetMasterVolume(engine, volume);
|
|
17032
17299
|
}
|
|
17033
17300
|
audioMixToBuffer(engine, outBuffer, frameCount, channels) {
|
|
17034
|
-
return this.opentui.symbols.audioMixToBuffer(engine,
|
|
17301
|
+
return this.opentui.symbols.audioMixToBuffer(engine, outBuffer, frameCount, channels);
|
|
17035
17302
|
}
|
|
17036
17303
|
audioEnableTap(engine, enabled, capacityFrames) {
|
|
17037
17304
|
return this.opentui.symbols.audioEnableTap(engine, ffiBool(enabled), capacityFrames);
|
|
17038
17305
|
}
|
|
17039
17306
|
audioReadTap(engine, outBuffer, frameCount, channels) {
|
|
17040
17307
|
const outFramesReadBuffer = new ArrayBuffer(4);
|
|
17041
|
-
const status = this.opentui.symbols.audioReadTap(engine,
|
|
17308
|
+
const status = this.opentui.symbols.audioReadTap(engine, outBuffer, frameCount, channels, outFramesReadBuffer);
|
|
17042
17309
|
if (status !== 0) {
|
|
17043
17310
|
return { status, framesRead: 0 };
|
|
17044
17311
|
}
|
|
@@ -17047,7 +17314,7 @@ class FFIRenderLib {
|
|
|
17047
17314
|
}
|
|
17048
17315
|
audioGetStats(engine) {
|
|
17049
17316
|
const statsBuffer = new ArrayBuffer(AudioStatsStruct.size);
|
|
17050
|
-
const status = this.opentui.symbols.audioGetStats(engine,
|
|
17317
|
+
const status = this.opentui.symbols.audioGetStats(engine, statsBuffer);
|
|
17051
17318
|
if (status !== 0) {
|
|
17052
17319
|
return null;
|
|
17053
17320
|
}
|
|
@@ -17072,7 +17339,7 @@ class FFIRenderLib {
|
|
|
17072
17339
|
}
|
|
17073
17340
|
createNativeSpanFeed(options) {
|
|
17074
17341
|
const optionsBuffer = options == null ? null : NativeSpanFeedOptionsStruct.pack(options);
|
|
17075
|
-
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer
|
|
17342
|
+
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer);
|
|
17076
17343
|
if (!streamPtr) {
|
|
17077
17344
|
throw new Error("Failed to create stream");
|
|
17078
17345
|
}
|
|
@@ -17087,13 +17354,13 @@ class FFIRenderLib {
|
|
|
17087
17354
|
}
|
|
17088
17355
|
streamWrite(stream, data) {
|
|
17089
17356
|
const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
|
|
17090
|
-
return this.opentui.symbols.streamWrite(stream,
|
|
17357
|
+
return this.opentui.symbols.streamWrite(stream, viewOrNull(bytes), bytes.byteLength);
|
|
17091
17358
|
}
|
|
17092
17359
|
streamCommit(stream) {
|
|
17093
17360
|
return this.opentui.symbols.streamCommit(stream);
|
|
17094
17361
|
}
|
|
17095
17362
|
streamDrainSpans(stream, outBuffer, maxSpans) {
|
|
17096
|
-
const count = this.opentui.symbols.streamDrainSpans(stream,
|
|
17363
|
+
const count = this.opentui.symbols.streamDrainSpans(stream, outBuffer, maxSpans);
|
|
17097
17364
|
return toNumber(count);
|
|
17098
17365
|
}
|
|
17099
17366
|
streamClose(stream) {
|
|
@@ -17101,11 +17368,11 @@ class FFIRenderLib {
|
|
|
17101
17368
|
}
|
|
17102
17369
|
streamSetOptions(stream, options) {
|
|
17103
17370
|
const optionsBuffer = NativeSpanFeedOptionsStruct.pack(options);
|
|
17104
|
-
return this.opentui.symbols.streamSetOptions(stream,
|
|
17371
|
+
return this.opentui.symbols.streamSetOptions(stream, optionsBuffer);
|
|
17105
17372
|
}
|
|
17106
17373
|
streamGetStats(stream) {
|
|
17107
17374
|
const statsBuffer = new ArrayBuffer(NativeSpanFeedStatsStruct.size);
|
|
17108
|
-
const status = this.opentui.symbols.streamGetStats(stream,
|
|
17375
|
+
const status = this.opentui.symbols.streamGetStats(stream, statsBuffer);
|
|
17109
17376
|
if (status !== 0) {
|
|
17110
17377
|
return null;
|
|
17111
17378
|
}
|
|
@@ -17119,7 +17386,7 @@ class FFIRenderLib {
|
|
|
17119
17386
|
}
|
|
17120
17387
|
streamReserve(stream, minLen) {
|
|
17121
17388
|
const reserveBuffer = new ArrayBuffer(ReserveInfoStruct.size);
|
|
17122
|
-
const status = this.opentui.symbols.streamReserve(stream, minLen,
|
|
17389
|
+
const status = this.opentui.symbols.streamReserve(stream, minLen, reserveBuffer);
|
|
17123
17390
|
if (status !== 0) {
|
|
17124
17391
|
return { status, info: null };
|
|
17125
17392
|
}
|
|
@@ -17140,13 +17407,13 @@ class FFIRenderLib {
|
|
|
17140
17407
|
}
|
|
17141
17408
|
syntaxStyleRegister(style, name, fg2, bg2, attributes) {
|
|
17142
17409
|
const nameBytes = this.encoder.encode(name);
|
|
17143
|
-
const
|
|
17144
|
-
const
|
|
17145
|
-
return this.opentui.symbols.syntaxStyleRegister(style,
|
|
17410
|
+
const fgBuffer = optionalRgbaBuffer(fg2);
|
|
17411
|
+
const bgBuffer = optionalRgbaBuffer(bg2);
|
|
17412
|
+
return this.opentui.symbols.syntaxStyleRegister(style, viewOrNull(nameBytes), nameBytes.byteLength, fgBuffer, bgBuffer, attributes);
|
|
17146
17413
|
}
|
|
17147
17414
|
syntaxStyleResolveByName(style, name) {
|
|
17148
17415
|
const nameBytes = this.encoder.encode(name);
|
|
17149
|
-
const id = this.opentui.symbols.syntaxStyleResolveByName(style,
|
|
17416
|
+
const id = this.opentui.symbols.syntaxStyleResolveByName(style, viewOrNull(nameBytes), nameBytes.byteLength);
|
|
17150
17417
|
return id === 0 ? null : id;
|
|
17151
17418
|
}
|
|
17152
17419
|
syntaxStyleGetStyleCount(style) {
|
|
@@ -17244,7 +17511,7 @@ class FFIRenderLib {
|
|
|
17244
17511
|
this.opentui.symbols.editorViewSetTabIndicator(view, indicator);
|
|
17245
17512
|
}
|
|
17246
17513
|
editorViewSetTabIndicatorColor(view, color) {
|
|
17247
|
-
this.opentui.symbols.editorViewSetTabIndicatorColor(view,
|
|
17514
|
+
this.opentui.symbols.editorViewSetTabIndicatorColor(view, rgbaBuffer(color));
|
|
17248
17515
|
}
|
|
17249
17516
|
onNativeEvent(name, handler) {
|
|
17250
17517
|
this._nativeEvents.on(name, handler);
|
|
@@ -18247,5 +18514,5 @@ var yoga_default = Yoga;
|
|
|
18247
18514
|
|
|
18248
18515
|
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 };
|
|
18249
18516
|
|
|
18250
|
-
//# debugId=
|
|
18251
|
-
//# sourceMappingURL=chunk-node-
|
|
18517
|
+
//# debugId=7E023795B6A90E4364756E2164756E21
|
|
18518
|
+
//# sourceMappingURL=chunk-node-2h23nsbj.js.map
|