@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
|
@@ -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
|
}
|
|
@@ -11416,7 +11416,7 @@ class OptimizedBuffer {
|
|
|
11416
11416
|
if (matrix.length !== 16)
|
|
11417
11417
|
throw new RangeError(`colorMatrix matrix must have length 16, got ${matrix.length}`);
|
|
11418
11418
|
const cellMaskCount = Math.floor(cellMask.length / 3);
|
|
11419
|
-
this.lib.bufferColorMatrix(this.bufferPtr,
|
|
11419
|
+
this.lib.bufferColorMatrix(this.bufferPtr, matrix, cellMask, cellMaskCount, strength, target);
|
|
11420
11420
|
}
|
|
11421
11421
|
colorMatrixUniform(matrix, strength = 1, target = 3 /* Both */) {
|
|
11422
11422
|
this.guard();
|
|
@@ -11424,7 +11424,7 @@ class OptimizedBuffer {
|
|
|
11424
11424
|
throw new RangeError(`colorMatrixUniform matrix must have length 16, got ${matrix.length}`);
|
|
11425
11425
|
if (strength === 0)
|
|
11426
11426
|
return;
|
|
11427
|
-
this.lib.bufferColorMatrixUniform(this.bufferPtr,
|
|
11427
|
+
this.lib.bufferColorMatrixUniform(this.bufferPtr, matrix, strength, target);
|
|
11428
11428
|
}
|
|
11429
11429
|
drawFrameBuffer(destX, destY, frameBuffer, sourceX, sourceY, sourceWidth, sourceHeight) {
|
|
11430
11430
|
this.guard();
|
|
@@ -11445,9 +11445,9 @@ class OptimizedBuffer {
|
|
|
11445
11445
|
this.guard();
|
|
11446
11446
|
this.lib.bufferDrawEditorView(this.bufferPtr, editorView.ptr, x, y);
|
|
11447
11447
|
}
|
|
11448
|
-
drawSuperSampleBuffer(x, y,
|
|
11448
|
+
drawSuperSampleBuffer(x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
|
|
11449
11449
|
this.guard();
|
|
11450
|
-
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);
|
|
11451
11451
|
}
|
|
11452
11452
|
drawImage(image, x, y, width, height, pixelWidth = 0, pixelHeight = 0, sourceX = 0, sourceY = 0, sourceWidth = image.width, sourceHeight = image.height, protocol = "auto") {
|
|
11453
11453
|
this.guard();
|
|
@@ -11466,17 +11466,17 @@ class OptimizedBuffer {
|
|
|
11466
11466
|
}
|
|
11467
11467
|
return this.lib.bufferDrawImage(this.bufferPtr, image.ptr, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol);
|
|
11468
11468
|
}
|
|
11469
|
-
drawPackedBuffer(
|
|
11469
|
+
drawPackedBuffer(data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
|
|
11470
11470
|
this.guard();
|
|
11471
|
-
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);
|
|
11472
11472
|
}
|
|
11473
11473
|
drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
|
|
11474
11474
|
this.guard();
|
|
11475
|
-
this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY,
|
|
11475
|
+
this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
|
|
11476
11476
|
}
|
|
11477
11477
|
drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
|
|
11478
11478
|
this.guard();
|
|
11479
|
-
this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY,
|
|
11479
|
+
this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
|
|
11480
11480
|
}
|
|
11481
11481
|
resize(width, height) {
|
|
11482
11482
|
this.guard();
|
|
@@ -13180,6 +13180,28 @@ var CursorStateStruct = defineStruct([
|
|
|
13180
13180
|
["b", "f32"],
|
|
13181
13181
|
["a", "f32"]
|
|
13182
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
|
+
]);
|
|
13183
13205
|
var CursorStyleOptionsStruct = defineStruct([
|
|
13184
13206
|
["style", "u8", { default: 255 }],
|
|
13185
13207
|
["blinking", "u8", { default: 255 }],
|
|
@@ -13496,14 +13518,50 @@ function toSafeFFIU32Length(value, label) {
|
|
|
13496
13518
|
function isFFIU32(value) {
|
|
13497
13519
|
return Number.isInteger(value) && value >= 0 && value <= MAX_FFI_U32;
|
|
13498
13520
|
}
|
|
13499
|
-
function
|
|
13500
|
-
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;
|
|
13501
13547
|
}
|
|
13502
|
-
function
|
|
13503
|
-
|
|
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;
|
|
13504
13553
|
}
|
|
13505
|
-
function
|
|
13506
|
-
|
|
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;
|
|
13507
13565
|
}
|
|
13508
13566
|
function getOpenTUILib(libPath) {
|
|
13509
13567
|
const resolvedLibPath = libPath || targetLibPath;
|
|
@@ -13539,6 +13597,70 @@ function getOpenTUILib(libPath) {
|
|
|
13539
13597
|
args: ["u32", "u32", "u32"],
|
|
13540
13598
|
returns: "bool"
|
|
13541
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
|
+
},
|
|
13542
13664
|
createRenderer: {
|
|
13543
13665
|
args: ["u32", "u32", "u8", "u8", "ptr"],
|
|
13544
13666
|
returns: "u32"
|
|
@@ -13560,7 +13682,7 @@ function getOpenTUILib(libPath) {
|
|
|
13560
13682
|
returns: "void"
|
|
13561
13683
|
},
|
|
13562
13684
|
setBackgroundColor: {
|
|
13563
|
-
args: ["u32", "
|
|
13685
|
+
args: ["u32", "buffer"],
|
|
13564
13686
|
returns: "void"
|
|
13565
13687
|
},
|
|
13566
13688
|
setRenderOffset: {
|
|
@@ -13620,7 +13742,7 @@ function getOpenTUILib(libPath) {
|
|
|
13620
13742
|
returns: "u32"
|
|
13621
13743
|
},
|
|
13622
13744
|
rendererSetPaletteState: {
|
|
13623
|
-
args: ["u32", "
|
|
13745
|
+
args: ["u32", "buffer", "u32", "buffer", "buffer", "u32"],
|
|
13624
13746
|
returns: "void"
|
|
13625
13747
|
},
|
|
13626
13748
|
queryPixelResolution: {
|
|
@@ -13632,7 +13754,7 @@ function getOpenTUILib(libPath) {
|
|
|
13632
13754
|
returns: "void"
|
|
13633
13755
|
},
|
|
13634
13756
|
createOptimizedBuffer: {
|
|
13635
|
-
args: ["u32", "u32", "bool", "u8", "
|
|
13757
|
+
args: ["u32", "u32", "bool", "u8", "buffer", "u32"],
|
|
13636
13758
|
returns: "u32"
|
|
13637
13759
|
},
|
|
13638
13760
|
destroyOptimizedBuffer: {
|
|
@@ -13652,7 +13774,7 @@ function getOpenTUILib(libPath) {
|
|
|
13652
13774
|
returns: "u32"
|
|
13653
13775
|
},
|
|
13654
13776
|
bufferClear: {
|
|
13655
|
-
args: ["u32", "
|
|
13777
|
+
args: ["u32", "buffer"],
|
|
13656
13778
|
returns: "void"
|
|
13657
13779
|
},
|
|
13658
13780
|
bufferGetCharPtr: {
|
|
@@ -13680,7 +13802,7 @@ function getOpenTUILib(libPath) {
|
|
|
13680
13802
|
returns: "void"
|
|
13681
13803
|
},
|
|
13682
13804
|
bufferGetId: {
|
|
13683
|
-
args: ["u32", "
|
|
13805
|
+
args: ["u32", "buffer", "u32"],
|
|
13684
13806
|
returns: "u32"
|
|
13685
13807
|
},
|
|
13686
13808
|
bufferGetRealCharSize: {
|
|
@@ -13692,19 +13814,19 @@ function getOpenTUILib(libPath) {
|
|
|
13692
13814
|
returns: "u32"
|
|
13693
13815
|
},
|
|
13694
13816
|
bufferDrawText: {
|
|
13695
|
-
args: ["u32", "ptr", "u32", "u32", "u32", "
|
|
13817
|
+
args: ["u32", "ptr", "u32", "u32", "u32", "buffer", "ptr", "u32"],
|
|
13696
13818
|
returns: "void"
|
|
13697
13819
|
},
|
|
13698
13820
|
bufferSetCellWithAlphaBlending: {
|
|
13699
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
13821
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
13700
13822
|
returns: "void"
|
|
13701
13823
|
},
|
|
13702
13824
|
bufferSetCell: {
|
|
13703
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
13825
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
13704
13826
|
returns: "void"
|
|
13705
13827
|
},
|
|
13706
13828
|
bufferFillRect: {
|
|
13707
|
-
args: ["u32", "u32", "u32", "u32", "u32", "
|
|
13829
|
+
args: ["u32", "u32", "u32", "u32", "u32", "buffer"],
|
|
13708
13830
|
returns: "void"
|
|
13709
13831
|
},
|
|
13710
13832
|
bufferColorMatrix: {
|
|
@@ -13744,7 +13866,7 @@ function getOpenTUILib(libPath) {
|
|
|
13744
13866
|
returns: "void"
|
|
13745
13867
|
},
|
|
13746
13868
|
setCursorColor: {
|
|
13747
|
-
args: ["u32", "
|
|
13869
|
+
args: ["u32", "buffer"],
|
|
13748
13870
|
returns: "void"
|
|
13749
13871
|
},
|
|
13750
13872
|
getCursorState: {
|
|
@@ -13872,11 +13994,26 @@ function getOpenTUILib(libPath) {
|
|
|
13872
13994
|
returns: "void"
|
|
13873
13995
|
},
|
|
13874
13996
|
bufferDrawGrid: {
|
|
13875
|
-
args: ["u32", "
|
|
13997
|
+
args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "ptr"],
|
|
13876
13998
|
returns: "void"
|
|
13877
13999
|
},
|
|
13878
14000
|
bufferDrawBox: {
|
|
13879
|
-
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
|
+
],
|
|
13880
14017
|
returns: "void"
|
|
13881
14018
|
},
|
|
13882
14019
|
bufferPushScissorRect: {
|
|
@@ -14208,7 +14345,7 @@ function getOpenTUILib(libPath) {
|
|
|
14208
14345
|
returns: "void"
|
|
14209
14346
|
},
|
|
14210
14347
|
textBufferViewSetTabIndicatorColor: {
|
|
14211
|
-
args: ["u32", "
|
|
14348
|
+
args: ["u32", "buffer"],
|
|
14212
14349
|
returns: "void"
|
|
14213
14350
|
},
|
|
14214
14351
|
textBufferViewSetTruncate: {
|
|
@@ -14244,7 +14381,7 @@ function getOpenTUILib(libPath) {
|
|
|
14244
14381
|
returns: "void"
|
|
14245
14382
|
},
|
|
14246
14383
|
editorViewGetViewport: {
|
|
14247
|
-
args: ["u32", "
|
|
14384
|
+
args: ["u32", "buffer", "buffer", "buffer", "buffer"],
|
|
14248
14385
|
returns: "void"
|
|
14249
14386
|
},
|
|
14250
14387
|
editorViewSetScrollMargin: {
|
|
@@ -14468,7 +14605,7 @@ function getOpenTUILib(libPath) {
|
|
|
14468
14605
|
returns: "u32"
|
|
14469
14606
|
},
|
|
14470
14607
|
editorViewGetCursor: {
|
|
14471
|
-
args: ["u32", "
|
|
14608
|
+
args: ["u32", "buffer", "buffer"],
|
|
14472
14609
|
returns: "void"
|
|
14473
14610
|
},
|
|
14474
14611
|
editorViewGetText: {
|
|
@@ -14524,7 +14661,7 @@ function getOpenTUILib(libPath) {
|
|
|
14524
14661
|
returns: "void"
|
|
14525
14662
|
},
|
|
14526
14663
|
editorViewSetTabIndicatorColor: {
|
|
14527
|
-
args: ["u32", "
|
|
14664
|
+
args: ["u32", "buffer"],
|
|
14528
14665
|
returns: "void"
|
|
14529
14666
|
},
|
|
14530
14667
|
getArenaAllocatedBytes: {
|
|
@@ -14563,21 +14700,21 @@ function getOpenTUILib(libPath) {
|
|
|
14563
14700
|
imageRetainIccCache: { args: [], returns: "void" },
|
|
14564
14701
|
imageReleaseIccCache: { args: [], returns: "void" },
|
|
14565
14702
|
imageTestFailIccProfileCopyAllocationOnce: { args: [], returns: "void" },
|
|
14566
|
-
imageDecode: { args: ["ptr", "u32", "
|
|
14567
|
-
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" },
|
|
14568
14705
|
imageDestroy: { args: ["u32"], returns: "void" },
|
|
14569
|
-
imageRetain: { args: ["u32", "
|
|
14706
|
+
imageRetain: { args: ["u32", "buffer"], returns: "u32" },
|
|
14570
14707
|
imageGetInfo: { args: ["u32", "ptr"], returns: "u32" },
|
|
14571
14708
|
imageMaterialize: { args: ["u32"], returns: "u32" },
|
|
14572
14709
|
imageEnsureEncodedPng: { args: ["u32"], returns: "u32" },
|
|
14573
14710
|
imageGetPixelsPtr: { args: ["u32"], returns: "ptr" },
|
|
14574
|
-
imageClone: { args: ["u32", "
|
|
14711
|
+
imageClone: { args: ["u32", "buffer"], returns: "u32" },
|
|
14575
14712
|
imageCopyPixels: { args: ["u32", "ptr", "u64", "u32", "u8"], returns: "u32" },
|
|
14576
|
-
imageResize: { args: ["u32", "u32", "u32", "u32", "
|
|
14577
|
-
imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "
|
|
14578
|
-
imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "
|
|
14579
|
-
imageTransform: { args: ["u32", "u32", "
|
|
14580
|
-
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" },
|
|
14581
14718
|
getTerminalCapabilities: {
|
|
14582
14719
|
args: ["u32", "ptr"],
|
|
14583
14720
|
returns: "void"
|
|
@@ -14595,7 +14732,7 @@ function getOpenTUILib(libPath) {
|
|
|
14595
14732
|
returns: "void"
|
|
14596
14733
|
},
|
|
14597
14734
|
bufferDrawChar: {
|
|
14598
|
-
args: ["u32", "u32", "u32", "u32", "
|
|
14735
|
+
args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
|
|
14599
14736
|
returns: "void"
|
|
14600
14737
|
},
|
|
14601
14738
|
yogaConfigCreate: {
|
|
@@ -14815,7 +14952,7 @@ function getOpenTUILib(libPath) {
|
|
|
14815
14952
|
returns: "u32"
|
|
14816
14953
|
},
|
|
14817
14954
|
audioGetPlaybackDeviceName: {
|
|
14818
|
-
args: ["u32", "u32", "
|
|
14955
|
+
args: ["u32", "u32", "buffer", "u32"],
|
|
14819
14956
|
returns: "u32"
|
|
14820
14957
|
},
|
|
14821
14958
|
audioIsPlaybackDeviceDefault: {
|
|
@@ -14839,7 +14976,7 @@ function getOpenTUILib(libPath) {
|
|
|
14839
14976
|
returns: "u32"
|
|
14840
14977
|
},
|
|
14841
14978
|
audioGetCaptureDeviceName: {
|
|
14842
|
-
args: ["u32", "u32", "
|
|
14979
|
+
args: ["u32", "u32", "buffer", "u32"],
|
|
14843
14980
|
returns: "u32"
|
|
14844
14981
|
},
|
|
14845
14982
|
audioIsCaptureDeviceDefault: {
|
|
@@ -14867,7 +15004,7 @@ function getOpenTUILib(libPath) {
|
|
|
14867
15004
|
returns: "bool"
|
|
14868
15005
|
},
|
|
14869
15006
|
audioReadCapture: {
|
|
14870
|
-
args: ["u32", "
|
|
15007
|
+
args: ["u32", "buffer", "u32", "u32", "ptr"],
|
|
14871
15008
|
returns: "i32"
|
|
14872
15009
|
},
|
|
14873
15010
|
audioGetCaptureStats: {
|
|
@@ -14923,7 +15060,7 @@ function getOpenTUILib(libPath) {
|
|
|
14923
15060
|
returns: "i32"
|
|
14924
15061
|
},
|
|
14925
15062
|
audioLoad: {
|
|
14926
|
-
args: ["u32", "
|
|
15063
|
+
args: ["u32", "buffer", "u32", "ptr"],
|
|
14927
15064
|
returns: "i32"
|
|
14928
15065
|
},
|
|
14929
15066
|
audioUnload: {
|
|
@@ -14943,7 +15080,7 @@ function getOpenTUILib(libPath) {
|
|
|
14943
15080
|
returns: "i32"
|
|
14944
15081
|
},
|
|
14945
15082
|
audioCreateGroup: {
|
|
14946
|
-
args: ["u32", "
|
|
15083
|
+
args: ["u32", "buffer", "u32", "ptr"],
|
|
14947
15084
|
returns: "i32"
|
|
14948
15085
|
},
|
|
14949
15086
|
audioSetGroupVolume: {
|
|
@@ -14955,7 +15092,7 @@ function getOpenTUILib(libPath) {
|
|
|
14955
15092
|
returns: "i32"
|
|
14956
15093
|
},
|
|
14957
15094
|
audioMixToBuffer: {
|
|
14958
|
-
args: ["u32", "
|
|
15095
|
+
args: ["u32", "buffer", "u32", "u8"],
|
|
14959
15096
|
returns: "i32"
|
|
14960
15097
|
},
|
|
14961
15098
|
audioEnableTap: {
|
|
@@ -14963,7 +15100,7 @@ function getOpenTUILib(libPath) {
|
|
|
14963
15100
|
returns: "i32"
|
|
14964
15101
|
},
|
|
14965
15102
|
audioReadTap: {
|
|
14966
|
-
args: ["u32", "
|
|
15103
|
+
args: ["u32", "buffer", "u32", "u8", "ptr"],
|
|
14967
15104
|
returns: "i32"
|
|
14968
15105
|
},
|
|
14969
15106
|
audioGetStats: {
|
|
@@ -14991,7 +15128,7 @@ function getOpenTUILib(libPath) {
|
|
|
14991
15128
|
returns: "i32"
|
|
14992
15129
|
},
|
|
14993
15130
|
streamDrainSpans: {
|
|
14994
|
-
args: ["ptr", "
|
|
15131
|
+
args: ["ptr", "buffer", "u32"],
|
|
14995
15132
|
returns: "u32"
|
|
14996
15133
|
},
|
|
14997
15134
|
streamClose: {
|
|
@@ -15178,7 +15315,6 @@ class FFIRenderLib {
|
|
|
15178
15315
|
opentui;
|
|
15179
15316
|
iccCacheClient = false;
|
|
15180
15317
|
yogaLayout = new Float32Array(6);
|
|
15181
|
-
yogaLayoutPtr = ptr(this.yogaLayout);
|
|
15182
15318
|
ffiStructStorage = {
|
|
15183
15319
|
logicalCursor: {
|
|
15184
15320
|
...allocStruct(LogicalCursorStruct),
|
|
@@ -15198,6 +15334,8 @@ class FFIRenderLib {
|
|
|
15198
15334
|
...allocStruct(MeasureResultStruct),
|
|
15199
15335
|
result: { lineCount: 0, widthColsMax: 0 }
|
|
15200
15336
|
},
|
|
15337
|
+
embeddedTerminalCursor: allocStruct(EmbeddedTerminalCursorStruct),
|
|
15338
|
+
embeddedTerminalKeyOptions: allocStruct(EmbeddedTerminalKeyOptionsStruct),
|
|
15201
15339
|
audioStreamStats: {
|
|
15202
15340
|
...allocStruct(AudioStreamStatsStruct),
|
|
15203
15341
|
result: {
|
|
@@ -15243,6 +15381,134 @@ class FFIRenderLib {
|
|
|
15243
15381
|
nativeRenderableSetMeasureTarget(handle, kind, target) {
|
|
15244
15382
|
return Boolean(this.opentui.symbols.nativeRenderableSetMeasureTarget(handle, kind, target));
|
|
15245
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
|
+
}
|
|
15246
15512
|
constructor(libPath) {
|
|
15247
15513
|
this.opentui = getOpenTUILib(libPath);
|
|
15248
15514
|
this.imageRetainIccCache();
|
|
@@ -15396,7 +15662,7 @@ class FFIRenderLib {
|
|
|
15396
15662
|
setTerminalEnvVar(renderer, key, value) {
|
|
15397
15663
|
const keyBytes = this.encoder.encode(key);
|
|
15398
15664
|
const valueBytes = this.encoder.encode(value);
|
|
15399
|
-
return this.opentui.symbols.setTerminalEnvVar(renderer,
|
|
15665
|
+
return this.opentui.symbols.setTerminalEnvVar(renderer, viewOrNull(keyBytes), keyBytes.byteLength, viewOrNull(valueBytes), valueBytes.byteLength);
|
|
15400
15666
|
}
|
|
15401
15667
|
destroyRenderer(renderer, flushInput = false) {
|
|
15402
15668
|
this.opentui.symbols.destroyRenderer(renderer, ffiBool(flushInput));
|
|
@@ -15408,7 +15674,7 @@ class FFIRenderLib {
|
|
|
15408
15674
|
this.opentui.symbols.setClearOnShutdown(renderer, ffiBool(clear));
|
|
15409
15675
|
}
|
|
15410
15676
|
setBackgroundColor(renderer, color) {
|
|
15411
|
-
this.opentui.symbols.setBackgroundColor(renderer,
|
|
15677
|
+
this.opentui.symbols.setBackgroundColor(renderer, rgbaBuffer(color));
|
|
15412
15678
|
}
|
|
15413
15679
|
setRenderOffset(renderer, offset) {
|
|
15414
15680
|
this.opentui.symbols.setRenderOffset(renderer, offset);
|
|
@@ -15436,7 +15702,7 @@ class FFIRenderLib {
|
|
|
15436
15702
|
}
|
|
15437
15703
|
getRenderStats(renderer) {
|
|
15438
15704
|
const statsBuffer = new ArrayBuffer(NativeRenderStatsStruct.size);
|
|
15439
|
-
this.opentui.symbols.getRenderStats(renderer,
|
|
15705
|
+
this.opentui.symbols.getRenderStats(renderer, statsBuffer);
|
|
15440
15706
|
const stats = NativeRenderStatsStruct.unpack(statsBuffer);
|
|
15441
15707
|
return {
|
|
15442
15708
|
nativeLastFrameTime: stats.lastFrameTime,
|
|
@@ -15471,7 +15737,7 @@ class FFIRenderLib {
|
|
|
15471
15737
|
for (let index = 0;index < palette.length; index++) {
|
|
15472
15738
|
paletteBuffer.set(palette[index].buffer, index * 4);
|
|
15473
15739
|
}
|
|
15474
|
-
this.opentui.symbols.rendererSetPaletteState(renderer,
|
|
15740
|
+
this.opentui.symbols.rendererSetPaletteState(renderer, paletteBuffer, palette.length, rgbaBuffer(defaultForeground), rgbaBuffer(defaultBackground), paletteEpoch >>> 0);
|
|
15475
15741
|
}
|
|
15476
15742
|
bufferGetCharPtr(buffer) {
|
|
15477
15743
|
const ptr3 = this.opentui.symbols.bufferGetCharPtr(buffer);
|
|
@@ -15510,14 +15776,14 @@ class FFIRenderLib {
|
|
|
15510
15776
|
bufferGetId(buffer) {
|
|
15511
15777
|
const maxLen = 256;
|
|
15512
15778
|
const outBuffer = new Uint8Array(maxLen);
|
|
15513
|
-
const actualLen = this.opentui.symbols.bufferGetId(buffer,
|
|
15779
|
+
const actualLen = this.opentui.symbols.bufferGetId(buffer, outBuffer, maxLen);
|
|
15514
15780
|
return this.decoder.decode(outBuffer.slice(0, actualLen));
|
|
15515
15781
|
}
|
|
15516
15782
|
bufferGetRealCharSize(buffer) {
|
|
15517
15783
|
return this.opentui.symbols.bufferGetRealCharSize(buffer);
|
|
15518
15784
|
}
|
|
15519
15785
|
bufferWriteResolvedChars(buffer, outputBuffer, addLineBreaks) {
|
|
15520
|
-
return this.opentui.symbols.bufferWriteResolvedChars(buffer,
|
|
15786
|
+
return this.opentui.symbols.bufferWriteResolvedChars(buffer, viewOrNull(outputBuffer), outputBuffer.byteLength, ffiBool(addLineBreaks));
|
|
15521
15787
|
}
|
|
15522
15788
|
getBufferWidth(buffer) {
|
|
15523
15789
|
return this.opentui.symbols.getBufferWidth(buffer);
|
|
@@ -15526,39 +15792,39 @@ class FFIRenderLib {
|
|
|
15526
15792
|
return this.opentui.symbols.getBufferHeight(buffer);
|
|
15527
15793
|
}
|
|
15528
15794
|
bufferClear(buffer, color) {
|
|
15529
|
-
this.opentui.symbols.bufferClear(buffer,
|
|
15795
|
+
this.opentui.symbols.bufferClear(buffer, rgbaBuffer(color));
|
|
15530
15796
|
}
|
|
15531
15797
|
bufferDrawText(buffer, text, x, y, color, bgColor, attributes) {
|
|
15532
15798
|
const textBytes = this.encoder.encode(text);
|
|
15533
|
-
const bg2 =
|
|
15534
|
-
const fg2 =
|
|
15535
|
-
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);
|
|
15536
15802
|
}
|
|
15537
15803
|
bufferSetCellWithAlphaBlending(buffer, x, y, char, color, bgColor, attributes) {
|
|
15538
15804
|
const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
|
|
15539
|
-
const bg2 =
|
|
15540
|
-
const fg2 =
|
|
15805
|
+
const bg2 = rgbaBuffer(bgColor);
|
|
15806
|
+
const fg2 = rgbaBuffer(color);
|
|
15541
15807
|
this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
|
|
15542
15808
|
}
|
|
15543
15809
|
bufferSetCell(buffer, x, y, char, color, bgColor, attributes) {
|
|
15544
15810
|
const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
|
|
15545
|
-
const bg2 =
|
|
15546
|
-
const fg2 =
|
|
15811
|
+
const bg2 = rgbaBuffer(bgColor);
|
|
15812
|
+
const fg2 = rgbaBuffer(color);
|
|
15547
15813
|
this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
|
|
15548
15814
|
}
|
|
15549
15815
|
bufferFillRect(buffer, x, y, width, height, color) {
|
|
15550
|
-
const bg2 =
|
|
15816
|
+
const bg2 = rgbaBuffer(color);
|
|
15551
15817
|
this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg2);
|
|
15552
15818
|
}
|
|
15553
|
-
bufferColorMatrix(buffer,
|
|
15554
|
-
this.opentui.symbols.bufferColorMatrix(buffer,
|
|
15819
|
+
bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target) {
|
|
15820
|
+
this.opentui.symbols.bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target);
|
|
15555
15821
|
}
|
|
15556
|
-
bufferColorMatrixUniform(buffer,
|
|
15557
|
-
this.opentui.symbols.bufferColorMatrixUniform(buffer,
|
|
15822
|
+
bufferColorMatrixUniform(buffer, matrix, strength, target) {
|
|
15823
|
+
this.opentui.symbols.bufferColorMatrixUniform(buffer, matrix, strength, target);
|
|
15558
15824
|
}
|
|
15559
|
-
bufferDrawSuperSampleBuffer(buffer, x, y,
|
|
15825
|
+
bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
|
|
15560
15826
|
const formatId = format === "bgra8unorm" ? 0 : 1;
|
|
15561
|
-
this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y,
|
|
15827
|
+
this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, formatId, alignedBytesPerRow);
|
|
15562
15828
|
}
|
|
15563
15829
|
bufferDrawImage(buffer, image, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol) {
|
|
15564
15830
|
const protocolId = { auto: 0, kitty: 1, sixel: 2, blocks: 3 }[protocol];
|
|
@@ -15578,38 +15844,38 @@ class FFIRenderLib {
|
|
|
15578
15844
|
}, storage.view, 0);
|
|
15579
15845
|
return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.buffer));
|
|
15580
15846
|
}
|
|
15581
|
-
bufferDrawPackedBuffer(buffer,
|
|
15582
|
-
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);
|
|
15583
15849
|
}
|
|
15584
|
-
bufferDrawGrayscaleBuffer(buffer, posX, posY,
|
|
15585
|
-
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));
|
|
15586
15852
|
}
|
|
15587
|
-
bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY,
|
|
15588
|
-
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));
|
|
15589
15855
|
}
|
|
15590
15856
|
bufferDrawGrid(buffer, borderChars, borderFg, borderBg, columnOffsets, columnCount, rowOffsets, rowCount, options) {
|
|
15591
15857
|
GridDrawOptionsStruct.packInto({ drawInner: options.drawInner, drawOuter: options.drawOuter }, this.ffiStructStorage.gridDrawOptions.view, 0);
|
|
15592
|
-
this.opentui.symbols.bufferDrawGrid(buffer,
|
|
15858
|
+
this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
|
|
15593
15859
|
}
|
|
15594
15860
|
bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
|
|
15595
15861
|
const titleBytes = title ? this.encoder.encode(title) : null;
|
|
15596
15862
|
const titleLen = titleBytes?.byteLength ?? 0;
|
|
15597
|
-
const
|
|
15863
|
+
const titleBuffer = titleBytes ? titleBytes : null;
|
|
15598
15864
|
const bottomTitleBytes = bottomTitle ? this.encoder.encode(bottomTitle) : null;
|
|
15599
15865
|
const bottomTitleLen = bottomTitleBytes?.byteLength ?? 0;
|
|
15600
|
-
const
|
|
15601
|
-
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);
|
|
15602
15868
|
}
|
|
15603
15869
|
bufferResize(buffer, width, height) {
|
|
15604
15870
|
this.opentui.symbols.bufferResize(buffer, width, height);
|
|
15605
15871
|
}
|
|
15606
15872
|
linkAlloc(url) {
|
|
15607
15873
|
const urlBytes = this.encoder.encode(url);
|
|
15608
|
-
return this.opentui.symbols.linkAlloc(
|
|
15874
|
+
return this.opentui.symbols.linkAlloc(viewOrNull(urlBytes), urlBytes.byteLength);
|
|
15609
15875
|
}
|
|
15610
15876
|
linkGetUrl(linkId, maxLen = 512) {
|
|
15611
15877
|
const outBuffer = new Uint8Array(maxLen);
|
|
15612
|
-
const actualLen = this.opentui.symbols.linkGetUrl(linkId,
|
|
15878
|
+
const actualLen = this.opentui.symbols.linkGetUrl(linkId, viewOrNull(outBuffer), maxLen);
|
|
15613
15879
|
return this.decoder.decode(outBuffer.slice(0, actualLen));
|
|
15614
15880
|
}
|
|
15615
15881
|
attributesWithLink(baseAttributes, linkId) {
|
|
@@ -15625,11 +15891,11 @@ class FFIRenderLib {
|
|
|
15625
15891
|
this.opentui.symbols.setCursorPosition(renderer, x, y, ffiBool(visible));
|
|
15626
15892
|
}
|
|
15627
15893
|
setCursorColor(renderer, color) {
|
|
15628
|
-
this.opentui.symbols.setCursorColor(renderer,
|
|
15894
|
+
this.opentui.symbols.setCursorColor(renderer, rgbaBuffer(color));
|
|
15629
15895
|
}
|
|
15630
15896
|
getCursorState(renderer) {
|
|
15631
15897
|
const cursorBuffer = new ArrayBuffer(CursorStateStruct.size);
|
|
15632
|
-
this.opentui.symbols.getCursorState(renderer,
|
|
15898
|
+
this.opentui.symbols.getCursorState(renderer, cursorBuffer);
|
|
15633
15899
|
const struct = CursorStateStruct.unpack(cursorBuffer);
|
|
15634
15900
|
return {
|
|
15635
15901
|
x: struct.x,
|
|
@@ -15670,7 +15936,7 @@ class FFIRenderLib {
|
|
|
15670
15936
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
15671
15937
|
const idToUse = id || "unnamed buffer";
|
|
15672
15938
|
const idBytes = this.encoder.encode(idToUse);
|
|
15673
|
-
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);
|
|
15674
15940
|
if (!bufferPtr) {
|
|
15675
15941
|
throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
|
|
15676
15942
|
}
|
|
@@ -15694,12 +15960,12 @@ class FFIRenderLib {
|
|
|
15694
15960
|
}
|
|
15695
15961
|
setTerminalTitle(renderer, title) {
|
|
15696
15962
|
const titleBytes = this.encoder.encode(title);
|
|
15697
|
-
this.opentui.symbols.setTerminalTitle(renderer,
|
|
15963
|
+
this.opentui.symbols.setTerminalTitle(renderer, viewOrNull(titleBytes), titleBytes.byteLength);
|
|
15698
15964
|
}
|
|
15699
15965
|
copyToClipboardOSC52(renderer, target, textUtf8) {
|
|
15700
15966
|
if (textUtf8.byteLength > 4294967295)
|
|
15701
15967
|
return false;
|
|
15702
|
-
return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target,
|
|
15968
|
+
return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target, viewOrNull(textUtf8), textUtf8.byteLength));
|
|
15703
15969
|
}
|
|
15704
15970
|
clearClipboardOSC52(renderer, target) {
|
|
15705
15971
|
return Boolean(this.opentui.symbols.clearClipboardOSC52(renderer, target));
|
|
@@ -15874,7 +16140,7 @@ class FFIRenderLib {
|
|
|
15874
16140
|
const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data;
|
|
15875
16141
|
if (bytes.length === 0)
|
|
15876
16142
|
return;
|
|
15877
|
-
this.opentui.symbols.writeOut(renderer,
|
|
16143
|
+
this.opentui.symbols.writeOut(renderer, viewOrNull(bytes), bytes.byteLength);
|
|
15878
16144
|
}
|
|
15879
16145
|
yogaConfigCreate() {
|
|
15880
16146
|
const config = this.opentui.symbols.yogaConfigCreate();
|
|
@@ -15986,7 +16252,7 @@ class FFIRenderLib {
|
|
|
15986
16252
|
}
|
|
15987
16253
|
yogaNodeGetComputedLayout(node) {
|
|
15988
16254
|
const layout = this.yogaLayout;
|
|
15989
|
-
this.opentui.symbols.yogaNodeGetComputedLayout(node, this.
|
|
16255
|
+
this.opentui.symbols.yogaNodeGetComputedLayout(node, this.yogaLayout);
|
|
15990
16256
|
return {
|
|
15991
16257
|
left: layout[0],
|
|
15992
16258
|
top: layout[1],
|
|
@@ -16083,16 +16349,16 @@ class FFIRenderLib {
|
|
|
16083
16349
|
this.opentui.symbols.textBufferClear(buffer);
|
|
16084
16350
|
}
|
|
16085
16351
|
textBufferSetDefaultFg(buffer, fg2) {
|
|
16086
|
-
const
|
|
16087
|
-
this.opentui.symbols.textBufferSetDefaultFg(buffer,
|
|
16352
|
+
const fgBuffer = optionalRgbaBuffer(fg2);
|
|
16353
|
+
this.opentui.symbols.textBufferSetDefaultFg(buffer, fgBuffer);
|
|
16088
16354
|
}
|
|
16089
16355
|
textBufferSetDefaultBg(buffer, bg2) {
|
|
16090
|
-
const
|
|
16091
|
-
this.opentui.symbols.textBufferSetDefaultBg(buffer,
|
|
16356
|
+
const bgBuffer = optionalRgbaBuffer(bg2);
|
|
16357
|
+
this.opentui.symbols.textBufferSetDefaultBg(buffer, bgBuffer);
|
|
16092
16358
|
}
|
|
16093
16359
|
textBufferSetDefaultAttributes(buffer, attributes) {
|
|
16094
16360
|
const attrValue = attributes === null ? null : new Uint32Array([attributes]);
|
|
16095
|
-
this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue
|
|
16361
|
+
this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue);
|
|
16096
16362
|
}
|
|
16097
16363
|
textBufferResetDefaults(buffer) {
|
|
16098
16364
|
this.opentui.symbols.textBufferResetDefaults(buffer);
|
|
@@ -16104,14 +16370,14 @@ class FFIRenderLib {
|
|
|
16104
16370
|
this.opentui.symbols.textBufferSetTabWidth(buffer, width);
|
|
16105
16371
|
}
|
|
16106
16372
|
textBufferRegisterMemBuffer(buffer, bytes, owned = false) {
|
|
16107
|
-
const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer,
|
|
16373
|
+
const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
|
|
16108
16374
|
if (result === 65535) {
|
|
16109
16375
|
throw new Error("Failed to register memory buffer");
|
|
16110
16376
|
}
|
|
16111
16377
|
return result;
|
|
16112
16378
|
}
|
|
16113
16379
|
textBufferReplaceMemBuffer(buffer, memId, bytes, owned = false) {
|
|
16114
|
-
return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId,
|
|
16380
|
+
return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
|
|
16115
16381
|
}
|
|
16116
16382
|
textBufferClearMemRegistry(buffer) {
|
|
16117
16383
|
this.opentui.symbols.textBufferClearMemRegistry(buffer);
|
|
@@ -16120,14 +16386,14 @@ class FFIRenderLib {
|
|
|
16120
16386
|
this.opentui.symbols.textBufferSetTextFromMem(buffer, memId);
|
|
16121
16387
|
}
|
|
16122
16388
|
textBufferAppend(buffer, bytes) {
|
|
16123
|
-
this.opentui.symbols.textBufferAppend(buffer,
|
|
16389
|
+
this.opentui.symbols.textBufferAppend(buffer, retainedPtrOrNull(bytes), bytes.byteLength);
|
|
16124
16390
|
}
|
|
16125
16391
|
textBufferAppendFromMemId(buffer, memId) {
|
|
16126
16392
|
this.opentui.symbols.textBufferAppendFromMemId(buffer, memId);
|
|
16127
16393
|
}
|
|
16128
16394
|
textBufferLoadFile(buffer, path3) {
|
|
16129
16395
|
const pathBytes = this.encoder.encode(path3);
|
|
16130
|
-
return this.opentui.symbols.textBufferLoadFile(buffer,
|
|
16396
|
+
return this.opentui.symbols.textBufferLoadFile(buffer, viewOrNull(pathBytes), pathBytes.byteLength);
|
|
16131
16397
|
}
|
|
16132
16398
|
textBufferSetStyledText(buffer, chunks) {
|
|
16133
16399
|
if (chunks.length === 0) {
|
|
@@ -16140,12 +16406,12 @@ class FFIRenderLib {
|
|
|
16140
16406
|
textBufferGetLineCount(buffer) {
|
|
16141
16407
|
return this.opentui.symbols.textBufferGetLineCount(buffer);
|
|
16142
16408
|
}
|
|
16143
|
-
textBufferGetPlainText(buffer,
|
|
16144
|
-
return this.opentui.symbols.textBufferGetPlainText(buffer,
|
|
16409
|
+
textBufferGetPlainText(buffer, outBuffer, maxLen) {
|
|
16410
|
+
return this.opentui.symbols.textBufferGetPlainText(buffer, outBuffer, maxLen);
|
|
16145
16411
|
}
|
|
16146
16412
|
getPlainTextBytes(buffer, maxLength) {
|
|
16147
16413
|
const outBuffer = new Uint8Array(maxLength);
|
|
16148
|
-
const actualLen = this.textBufferGetPlainText(buffer,
|
|
16414
|
+
const actualLen = this.textBufferGetPlainText(buffer, viewOrNull(outBuffer), maxLength);
|
|
16149
16415
|
if (actualLen === 0) {
|
|
16150
16416
|
return null;
|
|
16151
16417
|
}
|
|
@@ -16153,7 +16419,7 @@ class FFIRenderLib {
|
|
|
16153
16419
|
}
|
|
16154
16420
|
textBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
|
|
16155
16421
|
const outBuffer = new Uint8Array(maxLength);
|
|
16156
|
-
const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset,
|
|
16422
|
+
const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
|
|
16157
16423
|
const len = actualLen;
|
|
16158
16424
|
if (len === 0) {
|
|
16159
16425
|
return null;
|
|
@@ -16162,7 +16428,7 @@ class FFIRenderLib {
|
|
|
16162
16428
|
}
|
|
16163
16429
|
textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
|
|
16164
16430
|
const outBuffer = new Uint8Array(maxLength);
|
|
16165
|
-
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);
|
|
16166
16432
|
const len = actualLen;
|
|
16167
16433
|
if (len === 0) {
|
|
16168
16434
|
return null;
|
|
@@ -16180,8 +16446,8 @@ class FFIRenderLib {
|
|
|
16180
16446
|
this.opentui.symbols.destroyTextBufferView(view);
|
|
16181
16447
|
}
|
|
16182
16448
|
textBufferViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
16183
|
-
const bg2 =
|
|
16184
|
-
const fg2 =
|
|
16449
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16450
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16185
16451
|
this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg2, fg2);
|
|
16186
16452
|
}
|
|
16187
16453
|
textBufferViewResetSelection(view) {
|
|
@@ -16200,18 +16466,18 @@ class FFIRenderLib {
|
|
|
16200
16466
|
return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
|
|
16201
16467
|
}
|
|
16202
16468
|
textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16203
|
-
const bg2 =
|
|
16204
|
-
const fg2 =
|
|
16469
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16470
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16205
16471
|
return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16206
16472
|
}
|
|
16207
16473
|
textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16208
|
-
const bg2 =
|
|
16209
|
-
const fg2 =
|
|
16474
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16475
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16210
16476
|
this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
|
|
16211
16477
|
}
|
|
16212
16478
|
textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16213
|
-
const bg2 =
|
|
16214
|
-
const fg2 =
|
|
16479
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16480
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16215
16481
|
return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16216
16482
|
}
|
|
16217
16483
|
textBufferViewResetLocalSelection(view) {
|
|
@@ -16235,7 +16501,7 @@ class FFIRenderLib {
|
|
|
16235
16501
|
}
|
|
16236
16502
|
textBufferViewGetLineInfo(view) {
|
|
16237
16503
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16238
|
-
this.textBufferViewGetLineInfoDirect(view,
|
|
16504
|
+
this.textBufferViewGetLineInfoDirect(view, outBuffer);
|
|
16239
16505
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16240
16506
|
const lineStartCols = struct.startCols;
|
|
16241
16507
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16250,7 +16516,7 @@ class FFIRenderLib {
|
|
|
16250
16516
|
}
|
|
16251
16517
|
textBufferViewGetLogicalLineInfo(view) {
|
|
16252
16518
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16253
|
-
this.textBufferViewGetLogicalLineInfoDirect(view,
|
|
16519
|
+
this.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16254
16520
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16255
16521
|
const lineStartCols = struct.startCols;
|
|
16256
16522
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16266,21 +16532,21 @@ class FFIRenderLib {
|
|
|
16266
16532
|
textBufferViewGetVirtualLineCount(view) {
|
|
16267
16533
|
return this.opentui.symbols.textBufferViewGetVirtualLineCount(view);
|
|
16268
16534
|
}
|
|
16269
|
-
textBufferViewGetLineInfoDirect(view,
|
|
16270
|
-
this.opentui.symbols.textBufferViewGetLineInfoDirect(view,
|
|
16535
|
+
textBufferViewGetLineInfoDirect(view, outBuffer) {
|
|
16536
|
+
this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outBuffer);
|
|
16271
16537
|
}
|
|
16272
|
-
textBufferViewGetLogicalLineInfoDirect(view,
|
|
16273
|
-
this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view,
|
|
16538
|
+
textBufferViewGetLogicalLineInfoDirect(view, outBuffer) {
|
|
16539
|
+
this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16274
16540
|
}
|
|
16275
|
-
textBufferViewGetSelectedText(view,
|
|
16276
|
-
return this.opentui.symbols.textBufferViewGetSelectedText(view,
|
|
16541
|
+
textBufferViewGetSelectedText(view, outBuffer, maxLen) {
|
|
16542
|
+
return this.opentui.symbols.textBufferViewGetSelectedText(view, outBuffer, maxLen);
|
|
16277
16543
|
}
|
|
16278
|
-
textBufferViewGetPlainText(view,
|
|
16279
|
-
return this.opentui.symbols.textBufferViewGetPlainText(view,
|
|
16544
|
+
textBufferViewGetPlainText(view, outBuffer, maxLen) {
|
|
16545
|
+
return this.opentui.symbols.textBufferViewGetPlainText(view, outBuffer, maxLen);
|
|
16280
16546
|
}
|
|
16281
16547
|
textBufferViewGetSelectedTextBytes(view, maxLength) {
|
|
16282
16548
|
const outBuffer = new Uint8Array(maxLength);
|
|
16283
|
-
const actualLen = this.textBufferViewGetSelectedText(view,
|
|
16549
|
+
const actualLen = this.textBufferViewGetSelectedText(view, viewOrNull(outBuffer), maxLength);
|
|
16284
16550
|
if (actualLen === 0) {
|
|
16285
16551
|
return null;
|
|
16286
16552
|
}
|
|
@@ -16288,7 +16554,7 @@ class FFIRenderLib {
|
|
|
16288
16554
|
}
|
|
16289
16555
|
textBufferViewGetPlainTextBytes(view, maxLength) {
|
|
16290
16556
|
const outBuffer = new Uint8Array(maxLength);
|
|
16291
|
-
const actualLen = this.textBufferViewGetPlainText(view,
|
|
16557
|
+
const actualLen = this.textBufferViewGetPlainText(view, viewOrNull(outBuffer), maxLength);
|
|
16292
16558
|
if (actualLen === 0) {
|
|
16293
16559
|
return null;
|
|
16294
16560
|
}
|
|
@@ -16298,7 +16564,7 @@ class FFIRenderLib {
|
|
|
16298
16564
|
this.opentui.symbols.textBufferViewSetTabIndicator(view, indicator);
|
|
16299
16565
|
}
|
|
16300
16566
|
textBufferViewSetTabIndicatorColor(view, color) {
|
|
16301
|
-
this.opentui.symbols.textBufferViewSetTabIndicatorColor(view,
|
|
16567
|
+
this.opentui.symbols.textBufferViewSetTabIndicatorColor(view, rgbaBuffer(color));
|
|
16302
16568
|
}
|
|
16303
16569
|
textBufferViewSetTruncate(view, truncate) {
|
|
16304
16570
|
this.opentui.symbols.textBufferViewSetTruncate(view, ffiBool(truncate));
|
|
@@ -16313,11 +16579,11 @@ class FFIRenderLib {
|
|
|
16313
16579
|
}
|
|
16314
16580
|
textBufferAddHighlightByCharRange(buffer, highlight) {
|
|
16315
16581
|
const packedHighlight = HighlightStruct.pack(highlight);
|
|
16316
|
-
this.opentui.symbols.textBufferAddHighlightByCharRange(buffer,
|
|
16582
|
+
this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, packedHighlight);
|
|
16317
16583
|
}
|
|
16318
16584
|
textBufferAddHighlight(buffer, lineIdx, highlight) {
|
|
16319
16585
|
const packedHighlight = HighlightStruct.pack(highlight);
|
|
16320
|
-
this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx,
|
|
16586
|
+
this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, packedHighlight);
|
|
16321
16587
|
}
|
|
16322
16588
|
textBufferRemoveHighlightsByRef(buffer, hlRef) {
|
|
16323
16589
|
this.opentui.symbols.textBufferRemoveHighlightsByRef(buffer, hlRef);
|
|
@@ -16333,7 +16599,7 @@ class FFIRenderLib {
|
|
|
16333
16599
|
}
|
|
16334
16600
|
textBufferGetLineHighlights(buffer, lineIdx) {
|
|
16335
16601
|
const outCountBuf = new Uint32Array(1);
|
|
16336
|
-
const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx,
|
|
16602
|
+
const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, outCountBuf);
|
|
16337
16603
|
if (!nativePtr)
|
|
16338
16604
|
return [];
|
|
16339
16605
|
const count = outCountBuf[0];
|
|
@@ -16352,7 +16618,7 @@ class FFIRenderLib {
|
|
|
16352
16618
|
}
|
|
16353
16619
|
getBuildOptions() {
|
|
16354
16620
|
const optionsBuffer = new ArrayBuffer(BuildOptionsStruct.size);
|
|
16355
|
-
this.opentui.symbols.getBuildOptions(
|
|
16621
|
+
this.opentui.symbols.getBuildOptions(optionsBuffer);
|
|
16356
16622
|
const options = BuildOptionsStruct.unpack(optionsBuffer);
|
|
16357
16623
|
return {
|
|
16358
16624
|
gpaSafeStats: !!options.gpaSafeStats,
|
|
@@ -16361,7 +16627,7 @@ class FFIRenderLib {
|
|
|
16361
16627
|
}
|
|
16362
16628
|
getAllocatorStats() {
|
|
16363
16629
|
const statsBuffer = new ArrayBuffer(AllocatorStatsStruct.size);
|
|
16364
|
-
this.opentui.symbols.getAllocatorStats(
|
|
16630
|
+
this.opentui.symbols.getAllocatorStats(statsBuffer);
|
|
16365
16631
|
const stats = AllocatorStatsStruct.unpack(statsBuffer);
|
|
16366
16632
|
return {
|
|
16367
16633
|
totalRequestedBytes: toNumber(stats.totalRequestedBytes),
|
|
@@ -16398,7 +16664,7 @@ class FFIRenderLib {
|
|
|
16398
16664
|
const y = new Uint32Array(1);
|
|
16399
16665
|
const width = new Uint32Array(1);
|
|
16400
16666
|
const height = new Uint32Array(1);
|
|
16401
|
-
this.opentui.symbols.editorViewGetViewport(view,
|
|
16667
|
+
this.opentui.symbols.editorViewGetViewport(view, x, y, width, height);
|
|
16402
16668
|
return {
|
|
16403
16669
|
offsetX: x[0],
|
|
16404
16670
|
offsetY: y[0],
|
|
@@ -16428,7 +16694,7 @@ class FFIRenderLib {
|
|
|
16428
16694
|
}
|
|
16429
16695
|
editorViewGetLineInfo(view) {
|
|
16430
16696
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16431
|
-
this.opentui.symbols.editorViewGetLineInfoDirect(view,
|
|
16697
|
+
this.opentui.symbols.editorViewGetLineInfoDirect(view, outBuffer);
|
|
16432
16698
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16433
16699
|
const lineStartCols = struct.startCols;
|
|
16434
16700
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16443,7 +16709,7 @@ class FFIRenderLib {
|
|
|
16443
16709
|
}
|
|
16444
16710
|
editorViewGetLogicalLineInfo(view) {
|
|
16445
16711
|
const outBuffer = new ArrayBuffer(LineInfoStruct.size);
|
|
16446
|
-
this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view,
|
|
16712
|
+
this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, outBuffer);
|
|
16447
16713
|
const struct = LineInfoStruct.unpack(outBuffer);
|
|
16448
16714
|
const lineStartCols = struct.startCols;
|
|
16449
16715
|
const lineWidthCols = struct.widthCols;
|
|
@@ -16468,20 +16734,20 @@ class FFIRenderLib {
|
|
|
16468
16734
|
this.opentui.symbols.destroyEditBuffer(buffer);
|
|
16469
16735
|
}
|
|
16470
16736
|
editBufferSetText(buffer, textBytes) {
|
|
16471
|
-
this.opentui.symbols.editBufferSetText(buffer,
|
|
16737
|
+
this.opentui.symbols.editBufferSetText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16472
16738
|
}
|
|
16473
16739
|
editBufferSetTextFromMem(buffer, memId) {
|
|
16474
16740
|
this.opentui.symbols.editBufferSetTextFromMem(buffer, memId);
|
|
16475
16741
|
}
|
|
16476
16742
|
editBufferReplaceText(buffer, textBytes) {
|
|
16477
|
-
this.opentui.symbols.editBufferReplaceText(buffer,
|
|
16743
|
+
this.opentui.symbols.editBufferReplaceText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16478
16744
|
}
|
|
16479
16745
|
editBufferReplaceTextFromMem(buffer, memId) {
|
|
16480
16746
|
this.opentui.symbols.editBufferReplaceTextFromMem(buffer, memId);
|
|
16481
16747
|
}
|
|
16482
16748
|
editBufferGetText(buffer, maxLength) {
|
|
16483
16749
|
const outBuffer = new Uint8Array(maxLength);
|
|
16484
|
-
const actualLen = this.opentui.symbols.editBufferGetText(buffer,
|
|
16750
|
+
const actualLen = this.opentui.symbols.editBufferGetText(buffer, viewOrNull(outBuffer), maxLength);
|
|
16485
16751
|
const len = actualLen;
|
|
16486
16752
|
if (len === 0)
|
|
16487
16753
|
return null;
|
|
@@ -16489,11 +16755,11 @@ class FFIRenderLib {
|
|
|
16489
16755
|
}
|
|
16490
16756
|
editBufferInsertChar(buffer, char) {
|
|
16491
16757
|
const charBytes = this.encoder.encode(char);
|
|
16492
|
-
this.opentui.symbols.editBufferInsertChar(buffer,
|
|
16758
|
+
this.opentui.symbols.editBufferInsertChar(buffer, viewOrNull(charBytes), charBytes.byteLength);
|
|
16493
16759
|
}
|
|
16494
16760
|
editBufferInsertText(buffer, text) {
|
|
16495
16761
|
const textBytes = this.encoder.encode(text);
|
|
16496
|
-
this.opentui.symbols.editBufferInsertText(buffer,
|
|
16762
|
+
this.opentui.symbols.editBufferInsertText(buffer, viewOrNull(textBytes), textBytes.byteLength);
|
|
16497
16763
|
}
|
|
16498
16764
|
editBufferDeleteChar(buffer) {
|
|
16499
16765
|
this.opentui.symbols.editBufferDeleteChar(buffer);
|
|
@@ -16555,7 +16821,7 @@ class FFIRenderLib {
|
|
|
16555
16821
|
}
|
|
16556
16822
|
editBufferUndo(buffer, maxLength) {
|
|
16557
16823
|
const outBuffer = new Uint8Array(maxLength);
|
|
16558
|
-
const actualLen = this.opentui.symbols.editBufferUndo(buffer,
|
|
16824
|
+
const actualLen = this.opentui.symbols.editBufferUndo(buffer, viewOrNull(outBuffer), maxLength);
|
|
16559
16825
|
const len = actualLen;
|
|
16560
16826
|
if (len === 0)
|
|
16561
16827
|
return null;
|
|
@@ -16563,7 +16829,7 @@ class FFIRenderLib {
|
|
|
16563
16829
|
}
|
|
16564
16830
|
editBufferRedo(buffer, maxLength) {
|
|
16565
16831
|
const outBuffer = new Uint8Array(maxLength);
|
|
16566
|
-
const actualLen = this.opentui.symbols.editBufferRedo(buffer,
|
|
16832
|
+
const actualLen = this.opentui.symbols.editBufferRedo(buffer, viewOrNull(outBuffer), maxLength);
|
|
16567
16833
|
const len = actualLen;
|
|
16568
16834
|
if (len === 0)
|
|
16569
16835
|
return null;
|
|
@@ -16615,7 +16881,7 @@ class FFIRenderLib {
|
|
|
16615
16881
|
}
|
|
16616
16882
|
editBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
|
|
16617
16883
|
const outBuffer = new Uint8Array(maxLength);
|
|
16618
|
-
const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset,
|
|
16884
|
+
const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
|
|
16619
16885
|
const len = actualLen;
|
|
16620
16886
|
if (len === 0)
|
|
16621
16887
|
return null;
|
|
@@ -16623,15 +16889,15 @@ class FFIRenderLib {
|
|
|
16623
16889
|
}
|
|
16624
16890
|
editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
|
|
16625
16891
|
const outBuffer = new Uint8Array(maxLength);
|
|
16626
|
-
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);
|
|
16627
16893
|
const len = actualLen;
|
|
16628
16894
|
if (len === 0)
|
|
16629
16895
|
return null;
|
|
16630
16896
|
return usesBunFFI ? outBuffer.slice(0, len) : trimNodeFFIOutputBytes(outBuffer, len);
|
|
16631
16897
|
}
|
|
16632
16898
|
editorViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
16633
|
-
const bg2 =
|
|
16634
|
-
const fg2 =
|
|
16899
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16900
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16635
16901
|
this.opentui.symbols.editorViewSetSelection(view, start, end, bg2, fg2);
|
|
16636
16902
|
}
|
|
16637
16903
|
editorViewResetSelection(view) {
|
|
@@ -16647,18 +16913,18 @@ class FFIRenderLib {
|
|
|
16647
16913
|
return { start, end };
|
|
16648
16914
|
}
|
|
16649
16915
|
editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16650
|
-
const bg2 =
|
|
16651
|
-
const fg2 =
|
|
16916
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16917
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16652
16918
|
return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
|
|
16653
16919
|
}
|
|
16654
16920
|
editorViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16655
|
-
const bg2 =
|
|
16656
|
-
const fg2 =
|
|
16921
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16922
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16657
16923
|
this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
|
|
16658
16924
|
}
|
|
16659
16925
|
editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16660
|
-
const bg2 =
|
|
16661
|
-
const fg2 =
|
|
16926
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16927
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16662
16928
|
return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
|
|
16663
16929
|
}
|
|
16664
16930
|
editorViewResetLocalSelection(view) {
|
|
@@ -16666,7 +16932,7 @@ class FFIRenderLib {
|
|
|
16666
16932
|
}
|
|
16667
16933
|
editorViewGetSelectedTextBytes(view, maxLength) {
|
|
16668
16934
|
const outBuffer = new Uint8Array(maxLength);
|
|
16669
|
-
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view,
|
|
16935
|
+
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, viewOrNull(outBuffer), maxLength);
|
|
16670
16936
|
const len = actualLen;
|
|
16671
16937
|
if (len === 0)
|
|
16672
16938
|
return null;
|
|
@@ -16675,12 +16941,12 @@ class FFIRenderLib {
|
|
|
16675
16941
|
editorViewGetCursor(view) {
|
|
16676
16942
|
const row = new Uint32Array(1);
|
|
16677
16943
|
const col = new Uint32Array(1);
|
|
16678
|
-
this.opentui.symbols.editorViewGetCursor(view,
|
|
16944
|
+
this.opentui.symbols.editorViewGetCursor(view, row, col);
|
|
16679
16945
|
return { row: row[0], col: col[0] };
|
|
16680
16946
|
}
|
|
16681
16947
|
editorViewGetText(view, maxLength) {
|
|
16682
16948
|
const outBuffer = new Uint8Array(maxLength);
|
|
16683
|
-
const actualLen = this.opentui.symbols.editorViewGetText(view,
|
|
16949
|
+
const actualLen = this.opentui.symbols.editorViewGetText(view, viewOrNull(outBuffer), maxLength);
|
|
16684
16950
|
const len = actualLen;
|
|
16685
16951
|
if (len === 0)
|
|
16686
16952
|
return null;
|
|
@@ -16757,7 +17023,7 @@ class FFIRenderLib {
|
|
|
16757
17023
|
}
|
|
16758
17024
|
getTerminalCapabilities(renderer) {
|
|
16759
17025
|
const capsBuffer = new ArrayBuffer(TerminalCapabilitiesStruct.size);
|
|
16760
|
-
this.opentui.symbols.getTerminalCapabilities(renderer,
|
|
17026
|
+
this.opentui.symbols.getTerminalCapabilities(renderer, capsBuffer);
|
|
16761
17027
|
const caps = TerminalCapabilitiesStruct.unpack(capsBuffer);
|
|
16762
17028
|
return {
|
|
16763
17029
|
kitty_keyboard: caps.kitty_keyboard,
|
|
@@ -16790,14 +17056,14 @@ class FFIRenderLib {
|
|
|
16790
17056
|
}
|
|
16791
17057
|
processCapabilityResponse(renderer, response) {
|
|
16792
17058
|
const responseBytes = this.encoder.encode(response);
|
|
16793
|
-
this.opentui.symbols.processCapabilityResponse(renderer,
|
|
17059
|
+
this.opentui.symbols.processCapabilityResponse(renderer, viewOrNull(responseBytes), responseBytes.byteLength);
|
|
16794
17060
|
}
|
|
16795
17061
|
encodeUnicode(text, widthMethod) {
|
|
16796
17062
|
const textBytes = this.encoder.encode(text);
|
|
16797
17063
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
16798
17064
|
const outPtrBuffer = new ArrayBuffer(8);
|
|
16799
17065
|
const outLenBuffer = new ArrayBuffer(8);
|
|
16800
|
-
const success = this.opentui.symbols.encodeUnicode(
|
|
17066
|
+
const success = this.opentui.symbols.encodeUnicode(viewOrNull(textBytes), textBytes.byteLength, outPtrBuffer, outLenBuffer, widthMethodCode);
|
|
16801
17067
|
if (!success) {
|
|
16802
17068
|
return null;
|
|
16803
17069
|
}
|
|
@@ -16817,11 +17083,11 @@ class FFIRenderLib {
|
|
|
16817
17083
|
this.opentui.symbols.freeUnicode(encoded.ptr, encoded.data.length);
|
|
16818
17084
|
}
|
|
16819
17085
|
bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
|
|
16820
|
-
this.opentui.symbols.bufferDrawChar(buffer, char, x, y,
|
|
17086
|
+
this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg2), rgbaBuffer(bg2), attributes);
|
|
16821
17087
|
}
|
|
16822
17088
|
createAudioEngine(options) {
|
|
16823
17089
|
const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
|
|
16824
|
-
const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer
|
|
17090
|
+
const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer);
|
|
16825
17091
|
return engineHandle ? engineHandle : null;
|
|
16826
17092
|
}
|
|
16827
17093
|
destroyAudioEngine(engine) {
|
|
@@ -16835,7 +17101,7 @@ class FFIRenderLib {
|
|
|
16835
17101
|
}
|
|
16836
17102
|
audioGetPlaybackDeviceName(engine, index) {
|
|
16837
17103
|
const outBuffer = new Uint8Array(512);
|
|
16838
|
-
const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index,
|
|
17104
|
+
const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index, outBuffer, outBuffer.length));
|
|
16839
17105
|
const safeBytesWritten = Math.max(0, Math.min(outBuffer.length, bytesWritten));
|
|
16840
17106
|
return this.decoder.decode(outBuffer.subarray(0, safeBytesWritten));
|
|
16841
17107
|
}
|
|
@@ -16925,7 +17191,7 @@ class FFIRenderLib {
|
|
|
16925
17191
|
} catch {
|
|
16926
17192
|
return -1;
|
|
16927
17193
|
}
|
|
16928
|
-
return this.opentui.symbols.audioStart(engine, optionsBuffer
|
|
17194
|
+
return this.opentui.symbols.audioStart(engine, optionsBuffer);
|
|
16929
17195
|
}
|
|
16930
17196
|
audioStartMixer(engine) {
|
|
16931
17197
|
return this.opentui.symbols.audioStartMixer(engine);
|
|
@@ -16984,7 +17250,7 @@ class FFIRenderLib {
|
|
|
16984
17250
|
audioLoad(engine, data) {
|
|
16985
17251
|
const outBuffer = new ArrayBuffer(4);
|
|
16986
17252
|
const dataLength = toSafeFFIU32Length(data.byteLength, "Audio data length");
|
|
16987
|
-
const status = this.opentui.symbols.audioLoad(engine,
|
|
17253
|
+
const status = this.opentui.symbols.audioLoad(engine, data, dataLength, outBuffer);
|
|
16988
17254
|
if (status !== 0) {
|
|
16989
17255
|
return { status, soundId: null };
|
|
16990
17256
|
}
|
|
@@ -16999,7 +17265,7 @@ class FFIRenderLib {
|
|
|
16999
17265
|
return { status: -1, voiceId: null };
|
|
17000
17266
|
const outBuffer = new ArrayBuffer(4);
|
|
17001
17267
|
const optionsBuffer = options ? AudioVoiceOptionsStruct.pack(options) : null;
|
|
17002
|
-
const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer
|
|
17268
|
+
const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer, outBuffer);
|
|
17003
17269
|
if (status !== 0) {
|
|
17004
17270
|
return { status, voiceId: null };
|
|
17005
17271
|
}
|
|
@@ -17018,7 +17284,7 @@ class FFIRenderLib {
|
|
|
17018
17284
|
const outBuffer = new ArrayBuffer(4);
|
|
17019
17285
|
const nameBytes = this.encoder.encode(name);
|
|
17020
17286
|
const nameLength = toSafeFFIU32Length(nameBytes.byteLength, "Audio group name length");
|
|
17021
|
-
const status = this.opentui.symbols.audioCreateGroup(engine,
|
|
17287
|
+
const status = this.opentui.symbols.audioCreateGroup(engine, nameBytes, nameLength, outBuffer);
|
|
17022
17288
|
if (status !== 0) {
|
|
17023
17289
|
return { status, groupId: null };
|
|
17024
17290
|
}
|
|
@@ -17032,14 +17298,14 @@ class FFIRenderLib {
|
|
|
17032
17298
|
return this.opentui.symbols.audioSetMasterVolume(engine, volume);
|
|
17033
17299
|
}
|
|
17034
17300
|
audioMixToBuffer(engine, outBuffer, frameCount, channels) {
|
|
17035
|
-
return this.opentui.symbols.audioMixToBuffer(engine,
|
|
17301
|
+
return this.opentui.symbols.audioMixToBuffer(engine, outBuffer, frameCount, channels);
|
|
17036
17302
|
}
|
|
17037
17303
|
audioEnableTap(engine, enabled, capacityFrames) {
|
|
17038
17304
|
return this.opentui.symbols.audioEnableTap(engine, ffiBool(enabled), capacityFrames);
|
|
17039
17305
|
}
|
|
17040
17306
|
audioReadTap(engine, outBuffer, frameCount, channels) {
|
|
17041
17307
|
const outFramesReadBuffer = new ArrayBuffer(4);
|
|
17042
|
-
const status = this.opentui.symbols.audioReadTap(engine,
|
|
17308
|
+
const status = this.opentui.symbols.audioReadTap(engine, outBuffer, frameCount, channels, outFramesReadBuffer);
|
|
17043
17309
|
if (status !== 0) {
|
|
17044
17310
|
return { status, framesRead: 0 };
|
|
17045
17311
|
}
|
|
@@ -17048,7 +17314,7 @@ class FFIRenderLib {
|
|
|
17048
17314
|
}
|
|
17049
17315
|
audioGetStats(engine) {
|
|
17050
17316
|
const statsBuffer = new ArrayBuffer(AudioStatsStruct.size);
|
|
17051
|
-
const status = this.opentui.symbols.audioGetStats(engine,
|
|
17317
|
+
const status = this.opentui.symbols.audioGetStats(engine, statsBuffer);
|
|
17052
17318
|
if (status !== 0) {
|
|
17053
17319
|
return null;
|
|
17054
17320
|
}
|
|
@@ -17073,7 +17339,7 @@ class FFIRenderLib {
|
|
|
17073
17339
|
}
|
|
17074
17340
|
createNativeSpanFeed(options) {
|
|
17075
17341
|
const optionsBuffer = options == null ? null : NativeSpanFeedOptionsStruct.pack(options);
|
|
17076
|
-
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer
|
|
17342
|
+
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer);
|
|
17077
17343
|
if (!streamPtr) {
|
|
17078
17344
|
throw new Error("Failed to create stream");
|
|
17079
17345
|
}
|
|
@@ -17088,13 +17354,13 @@ class FFIRenderLib {
|
|
|
17088
17354
|
}
|
|
17089
17355
|
streamWrite(stream, data) {
|
|
17090
17356
|
const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
|
|
17091
|
-
return this.opentui.symbols.streamWrite(stream,
|
|
17357
|
+
return this.opentui.symbols.streamWrite(stream, viewOrNull(bytes), bytes.byteLength);
|
|
17092
17358
|
}
|
|
17093
17359
|
streamCommit(stream) {
|
|
17094
17360
|
return this.opentui.symbols.streamCommit(stream);
|
|
17095
17361
|
}
|
|
17096
17362
|
streamDrainSpans(stream, outBuffer, maxSpans) {
|
|
17097
|
-
const count = this.opentui.symbols.streamDrainSpans(stream,
|
|
17363
|
+
const count = this.opentui.symbols.streamDrainSpans(stream, outBuffer, maxSpans);
|
|
17098
17364
|
return toNumber(count);
|
|
17099
17365
|
}
|
|
17100
17366
|
streamClose(stream) {
|
|
@@ -17102,11 +17368,11 @@ class FFIRenderLib {
|
|
|
17102
17368
|
}
|
|
17103
17369
|
streamSetOptions(stream, options) {
|
|
17104
17370
|
const optionsBuffer = NativeSpanFeedOptionsStruct.pack(options);
|
|
17105
|
-
return this.opentui.symbols.streamSetOptions(stream,
|
|
17371
|
+
return this.opentui.symbols.streamSetOptions(stream, optionsBuffer);
|
|
17106
17372
|
}
|
|
17107
17373
|
streamGetStats(stream) {
|
|
17108
17374
|
const statsBuffer = new ArrayBuffer(NativeSpanFeedStatsStruct.size);
|
|
17109
|
-
const status = this.opentui.symbols.streamGetStats(stream,
|
|
17375
|
+
const status = this.opentui.symbols.streamGetStats(stream, statsBuffer);
|
|
17110
17376
|
if (status !== 0) {
|
|
17111
17377
|
return null;
|
|
17112
17378
|
}
|
|
@@ -17120,7 +17386,7 @@ class FFIRenderLib {
|
|
|
17120
17386
|
}
|
|
17121
17387
|
streamReserve(stream, minLen) {
|
|
17122
17388
|
const reserveBuffer = new ArrayBuffer(ReserveInfoStruct.size);
|
|
17123
|
-
const status = this.opentui.symbols.streamReserve(stream, minLen,
|
|
17389
|
+
const status = this.opentui.symbols.streamReserve(stream, minLen, reserveBuffer);
|
|
17124
17390
|
if (status !== 0) {
|
|
17125
17391
|
return { status, info: null };
|
|
17126
17392
|
}
|
|
@@ -17141,13 +17407,13 @@ class FFIRenderLib {
|
|
|
17141
17407
|
}
|
|
17142
17408
|
syntaxStyleRegister(style, name, fg2, bg2, attributes) {
|
|
17143
17409
|
const nameBytes = this.encoder.encode(name);
|
|
17144
|
-
const
|
|
17145
|
-
const
|
|
17146
|
-
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);
|
|
17147
17413
|
}
|
|
17148
17414
|
syntaxStyleResolveByName(style, name) {
|
|
17149
17415
|
const nameBytes = this.encoder.encode(name);
|
|
17150
|
-
const id = this.opentui.symbols.syntaxStyleResolveByName(style,
|
|
17416
|
+
const id = this.opentui.symbols.syntaxStyleResolveByName(style, viewOrNull(nameBytes), nameBytes.byteLength);
|
|
17151
17417
|
return id === 0 ? null : id;
|
|
17152
17418
|
}
|
|
17153
17419
|
syntaxStyleGetStyleCount(style) {
|
|
@@ -17245,7 +17511,7 @@ class FFIRenderLib {
|
|
|
17245
17511
|
this.opentui.symbols.editorViewSetTabIndicator(view, indicator);
|
|
17246
17512
|
}
|
|
17247
17513
|
editorViewSetTabIndicatorColor(view, color) {
|
|
17248
|
-
this.opentui.symbols.editorViewSetTabIndicatorColor(view,
|
|
17514
|
+
this.opentui.symbols.editorViewSetTabIndicatorColor(view, rgbaBuffer(color));
|
|
17249
17515
|
}
|
|
17250
17516
|
onNativeEvent(name, handler) {
|
|
17251
17517
|
this._nativeEvents.on(name, handler);
|
|
@@ -18248,5 +18514,5 @@ var yoga_default = Yoga;
|
|
|
18248
18514
|
|
|
18249
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 };
|
|
18250
18516
|
|
|
18251
|
-
//# debugId=
|
|
18252
|
-
//# sourceMappingURL=chunk-node-
|
|
18517
|
+
//# debugId=7E023795B6A90E4364756E2164756E21
|
|
18518
|
+
//# sourceMappingURL=chunk-node-2h23nsbj.js.map
|