diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-16 15:49:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-18 23:44:42 -0300 |
| commit | 1551e409c31992437cb2fa864f576d45c8433801 (patch) | |
| tree | e2fae8451f87b735a1360c7c2e383fdc40165789 /src/web.zig | |
| parent | be2a9957708cbf0c478ca861c4a1f0f227bbfe10 (diff) | |
| download | pardes-1551e409c31992437cb2fa864f576d45c8433801.tar.gz pardes-1551e409c31992437cb2fa864f576d45c8433801.zip | |
big slow change: prebuilt shaders (SPIR-V/Metal), core gui reflow, docs, web + snapshot refresh
Diffstat (limited to 'src/web.zig')
| -rw-r--r-- | src/web.zig | 11 |
1 files changed, 11 insertions, 0 deletions
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; } |
