this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 990fe29b38e57de69733025ab580b8917c2d092f 96 lines 3.0 kB view raw
1const std = @import("std"); 2const builtin = @import("builtin"); 3 4pub const tty = @import("tty.zig"); 5 6pub const Vaxis = @import("Vaxis.zig"); 7 8pub const loop = @import("Loop.zig"); 9pub const Loop = loop.Loop; 10 11pub const zigimg = @import("zigimg"); 12 13pub const Queue = @import("queue.zig").Queue; 14pub const Key = @import("Key.zig"); 15pub const Cell = @import("Cell.zig"); 16pub const Segment = Cell.Segment; 17pub const PrintOptions = Window.PrintOptions; 18pub const Style = Cell.Style; 19pub const Color = Cell.Color; 20pub const Image = @import("Image.zig"); 21pub const Mouse = @import("Mouse.zig"); 22pub const Screen = @import("Screen.zig"); 23pub const AllocatingScreen = @import("InternalScreen.zig"); 24pub const Parser = @import("Parser.zig"); 25pub const Window = @import("Window.zig"); 26pub const widgets = @import("widgets.zig"); 27pub const gwidth = @import("gwidth.zig"); 28pub const ctlseqs = @import("ctlseqs.zig"); 29pub const DisplayWidth = @import("DisplayWidth"); 30pub const GraphemeCache = @import("GraphemeCache.zig"); 31pub const Graphemes = @import("Graphemes"); 32pub const Event = @import("event.zig").Event; 33pub const Unicode = @import("Unicode.zig"); 34 35pub const vxfw = @import("vxfw/vxfw.zig"); 36 37pub const Tty = tty.Tty; 38 39/// The size of the terminal screen 40pub const Winsize = struct { 41 rows: u16, 42 cols: u16, 43 x_pixel: u16, 44 y_pixel: u16, 45}; 46 47/// Initialize a Vaxis application. 48pub fn init(alloc: std.mem.Allocator, opts: Vaxis.Options) !Vaxis { 49 return Vaxis.init(alloc, opts); 50} 51 52pub const Panic = struct { 53 pub const call = panic_handler; 54 pub const sentinelMismatch = std.debug.FormattedPanic.sentinelMismatch; 55 pub const unwrapError = std.debug.FormattedPanic.unwrapError; 56 pub const outOfBounds = std.debug.FormattedPanic.outOfBounds; 57 pub const startGreaterThanEnd = std.debug.FormattedPanic.startGreaterThanEnd; 58 pub const inactiveUnionField = std.debug.FormattedPanic.inactiveUnionField; 59 pub const messages = std.debug.FormattedPanic.messages; 60}; 61 62/// Resets terminal state on a panic, then calls the default zig panic handler 63pub fn panic_handler(msg: []const u8, _: ?*std.builtin.StackTrace, ret_addr: ?usize) noreturn { 64 recover(); 65 std.debug.defaultPanic(msg, ret_addr); 66} 67 68/// Resets the terminal state using the global tty instance. Use this only to recover during a panic 69pub fn recover() void { 70 if (tty.global_tty) |gty| { 71 const reset: []const u8 = ctlseqs.csi_u_pop ++ 72 ctlseqs.mouse_reset ++ 73 ctlseqs.bp_reset ++ 74 ctlseqs.rmcup; 75 76 gty.anyWriter().writeAll(reset) catch {}; 77 78 gty.deinit(); 79 } 80} 81 82pub const log_scopes = enum { 83 vaxis, 84}; 85 86/// the vaxis logo. In PixelCode 87pub const logo = 88 \\▄ ▄ ▄▄▄ ▄ ▄ ▄▄▄ ▄▄▄ 89 \\█ █ █▄▄▄█ ▀▄ ▄▀ █ █ ▀ 90 \\▀▄ ▄▀ █ █ ▄▀▄ █ ▀▀▀▄ 91 \\ ▀▄▀ █ █ █ █ ▄█▄ ▀▄▄▄▀ 92; 93 94test "refAllDecls" { 95 std.testing.refAllDecls(@This()); 96}