terminal: consolidate mouse types into mouse.zig

Move MouseEvent and MouseFormat out of Terminal.zig and MouseShape out
of mouse_shape.zig into a new mouse.zig file. The types are named
without the Mouse prefix inside the module (Event, Format, Shape) and
re-exported with the prefix from terminal/main.zig for external use.

Update all call sites (mouse_encode.zig, surface_mouse.zig, stream.zig)
to import through terminal/main.zig or directly from mouse.zig. Remove
the now-unused mouse_shape.zig.
This commit is contained in:
Mitchell Hashimoto
2026-03-15 15:48:09 -07:00
parent f1fd21fd76
commit f9f92f2e0f
6 changed files with 46 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
const std = @import("std");
const testing = std.testing;
const Terminal = @import("../terminal/Terminal.zig");
const terminal = @import("../terminal/main.zig");
const Terminal = terminal.Terminal;
const renderer_size = @import("../renderer/size.zig");
const point = @import("../terminal/point.zig");
const key = @import("key.zig");
@@ -11,10 +12,10 @@ const log = std.log.scoped(.mouse_encode);
/// Options that affect mouse encoding behavior and provide runtime context.
pub const Options = struct {
/// Terminal mouse reporting mode (X10, normal, button, any).
event: Terminal.MouseEvent = .none,
event: terminal.MouseEvent = .none,
/// Terminal mouse reporting format.
format: Terminal.MouseFormat = .x10,
format: terminal.MouseFormat = .x10,
/// Full renderer size used to convert surface-space pixel positions
/// into grid cell coordinates (for most formats) and terminal-space