summaryrefslogtreecommitdiff
path: root/src/web.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/web.zig')
-rw-r--r--src/web.zig11
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;
}