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

@@ -9,14 +9,14 @@ const std = @import("std");
const builtin = @import("builtin");
const input = @import("input.zig");
const terminal = @import("terminal/main.zig");
const MouseShape = @import("terminal/mouse_shape.zig").MouseShape;
const MouseShape = terminal.MouseShape;
/// For processing key events; the key that was physically pressed on the
/// keyboard.
physical_key: input.Key,
/// The mouse event tracking mode, if any.
mouse_event: terminal.Terminal.MouseEvent,
mouse_event: terminal.MouseEvent,
/// The current terminal's mouse shape.
mouse_shape: MouseShape,