From 1551e409c31992437cb2fa864f576d45c8433801 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 16 Aug 2026 15:49:12 -0300 Subject: big slow change: prebuilt shaders (SPIR-V/Metal), core gui reflow, docs, web + snapshot refresh --- src/web.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/web.zig') diff --git a/src/web.zig b/src/web.zig index 637fa56f..ebcc9546 100644 --- a/src/web.zig +++ b/src/web.zig @@ -12,6 +12,7 @@ const gpa = std.heap.wasm_allocator; const embedded_dump = @embedFile("embedded.dump.zon"); const input_capacity = 64 * 1024; const c_alloc_header_size = 16; +const attr_tagline: u16 = 1 << 7; comptime { if (c_alloc_header_size < @sizeOf(usize)) @compileError("C allocation header is too small"); @@ -176,6 +177,10 @@ export fn pardes_input_capacity() u32 { return input_capacity; } +export fn pardes_gui_tagline_font_percent() u32 { + return pardes.config.gui_tagline_font_percent; +} + export fn pardes_resize(cols_arg: u32, rows_arg: u32) void { const s = &(state orelse return); const cols: u16 = @intCast(std.math.clamp(cols_arg, 1, std.math.maxInt(u16))); @@ -304,6 +309,11 @@ export fn pardes_touch_scroll(delta: f32) void { s.core.update(.{ .touch_scroll = delta }); } +export fn pardes_pointer_leave() void { + const s = &(state orelse return); + s.core.update(.pointer_leave); +} + export fn pardes_tick() void { const s = &(state orelse return); s.core.update(.tick); @@ -506,6 +516,7 @@ fn encodeAttrs(style: pardes.CellStyle) u16 { attrs |= @as(u16, @intFromBool(style.reverse)) << 4; attrs |= @as(u16, @intFromBool(style.invisible)) << 5; attrs |= @as(u16, @intFromBool(style.strikethrough)) << 6; + attrs |= @as(u16, @intFromBool(style.font_role == .tagline)) * attr_tagline; attrs |= @as(u16, @intFromEnum(style.ul)) << 8; return attrs; } -- cgit v1.3