tiny.windowing.InputCapacity
Defined in input.
API (6)
Actions
Public operations.
Fields and members
Public fields and members.
pressed_key_bytesretained_history_bytesretained_pressed_key_countretained_text_codepoint_counttext_codepoint_bytes
Source
Source: lib/windowing/src/input.zig:28
zig
pub const Capacity = struct { retained_pressed_key_count: usize, retained_text_codepoint_count: usize, pressed_key_bytes: usize, text_codepoint_bytes: usize, retained_history_bytes: usize, pub fn derive(limits: Limits) CapacityError!Capacity { if (limits.retained_pressed_key_count == 0) return error.PressedKeyHistoryEmpty; if (limits.retained_text_codepoint_count == 0) return error.TextCodepointHistoryEmpty; const pressed_key_bytes = std.math.mul( usize, limits.retained_pressed_key_count, @sizeOf(Key), ) catch return error.CapacityOverflow; const text_codepoint_bytes = std.math.mul( usize, limits.retained_text_codepoint_count, @sizeOf(u21), ) catch return error.CapacityOverflow; const retained_history_bytes = std.math.add( usize, pressed_key_bytes, text_codepoint_bytes, ) catch return error.CapacityOverflow; std.debug.assert(pressed_key_bytes / @sizeOf(Key) == limits.retained_pressed_key_count); std.debug.assert( text_codepoint_bytes / @sizeOf(u21) == limits.retained_text_codepoint_count, ); return .{ .retained_pressed_key_count = limits.retained_pressed_key_count, .retained_text_codepoint_count = limits.retained_text_codepoint_count, .pressed_key_bytes = pressed_key_bytes, .text_codepoint_bytes = text_codepoint_bytes, .retained_history_bytes = retained_history_bytes, }; }};Source: lib/windowing/src/root.zig:112
zig
pub const InputCapacity = input_module.Capacity;Audit
| Definitions | 2 |
|---|---|
| Public names | 4 |
| Members | 5 |
| Version | 26.7.0 |
| Revision | daab053ee433 |