diff options
Diffstat (limited to 'core/Term.zig')
| -rw-r--r-- | core/Term.zig | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/core/Term.zig b/core/Term.zig index 5025ba2b..82d5dad7 100644 --- a/core/Term.zig +++ b/core/Term.zig @@ -30,6 +30,8 @@ pub const Moves = iface.Moves; pub const MouseMods = iface.MouseMods; pub const MouseButton = iface.MouseButton; pub const MouseAction = iface.MouseAction; +/// A grid cell (the one a program last heard the mouse at: Pane.term_mouse). +pub const Coordinate = iface.Parts.Coordinate; pub const Page = iface.Page; pub const Span = iface.Span; pub const Ink = iface.Ink; @@ -212,13 +214,13 @@ pub fn key(s: *State, k: plain.Key, out: *std.Io.Writer) !void { /// One mouse event for its program, as the mode and format it set ask for /// it; empty when the program does not hear of it. -pub fn mouse(s: *State, buf: *[64]u8, action: MouseAction, button: ?MouseButton, mods: MouseMods, col: i32, row: i32, any_pressed: bool) []const u8 { - return the().mouse(s.impl, buf, action, button, mods, col, row, any_pressed); +pub fn mouse(s: *State, last: *?Coordinate, buf: *[64]u8, action: MouseAction, button: ?MouseButton, mods: MouseMods, col: i32, row: i32, any_pressed: bool) []const u8 { + return the().mouse(s.impl, last, buf, action, button, mods, col, row, any_pressed); } /// A wheel turn for its program; null when the wheel is not the program's. -pub fn wheel(s: *State, buf: *[64]u8, turn: MouseButton, col: u16, row: u16, mods: MouseMods) ?[]const u8 { - return the().wheel(s.impl, buf, turn, col, row, mods); +pub fn wheel(s: *State, last: *?Coordinate, buf: *[64]u8, turn: MouseButton, col: u16, row: u16, mods: MouseMods) ?[]const u8 { + return the().wheel(s.impl, last, buf, turn, col, row, mods); } /// A paste as xterm makes one: three parts, the text between the brackets @@ -362,17 +364,6 @@ pub fn images(s: *State, gpa: std.mem.Allocator, at: ImagesAt, out: *std.ArrayLi the().images(s.impl, gpa, at, out, frame, frame_cols); } -/// The Petscii builtin on it: its kitty graphics as glyph art, or back to -/// pixels; null for none. -pub fn petscii(s: ?*const State) ?bool { - const o = ops orelse return null; - return o.petscii(if (s) |state| state.impl else null); -} - -pub fn togglePetscii(s: *State) void { - the().togglePetscii(s.impl); -} - /// Whether the screen showing holds any kitty graphics image. pub fn hasImages(s: ?*const State) bool { const o = ops orelse return false; |
