| 1 | const std = @import("std"); |
| 2 | |
| 3 | pub const Static = struct { |
| 4 | text: []const u8, |
| 5 | color: c_ulong, |
| 6 | |
| 7 | pub fn init(text: []const u8, color: c_ulong) Static { |
| 8 | return .{ .text = text, .color = color }; |
| 9 | } |
| 10 | |
| 11 | pub fn content(self: *Static, buffer: []u8) []const u8 { |
| 12 | const len = @min(self.text.len, buffer.len); |
| 13 | @memcpy(buffer[0..len], self.text[0..len]); |
| 14 | return buffer[0..len]; |
| 15 | } |
| 16 | |
| 17 | pub fn interval(_: *Static) u64 { |
| 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | pub fn get_color(self: *Static) c_ulong { |
| 22 | return self.color; |
| 23 | } |
| 24 | }; |