mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-19 03:21:18 +00:00
More IO events
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
const std = @import("std");
|
||||
const renderer = @import("../renderer.zig");
|
||||
const terminal = @import("../terminal/main.zig");
|
||||
|
||||
/// The messages that can be sent to an IO thread.
|
||||
pub const IO = union(enum) {
|
||||
pub const SmallWriteArray = [22]u8;
|
||||
|
||||
/// Resize the window.
|
||||
resize: struct {
|
||||
grid_size: renderer.GridSize,
|
||||
@@ -11,7 +14,19 @@ pub const IO = union(enum) {
|
||||
|
||||
/// Clear the selection
|
||||
clear_selection: void,
|
||||
//
|
||||
// /// Scroll the viewport
|
||||
// scroll_viewport: terminal.Terminal.ScrollViewport,
|
||||
|
||||
/// Scroll the viewport
|
||||
scroll_viewport: terminal.Terminal.ScrollViewport,
|
||||
|
||||
/// Write where the data fits in the union.
|
||||
small_write: struct {
|
||||
data: [22]u8,
|
||||
len: u8,
|
||||
},
|
||||
};
|
||||
|
||||
test {
|
||||
// Ensure we don't grow our IO message size without explicitly wanting to.
|
||||
const testing = std.testing;
|
||||
try testing.expectEqual(@as(usize, 24), @sizeOf(IO));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user