From 2e31cbeb70d93bb0f5512064f181990db189d1f6 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 4 Oct 2026 20:02:15 +0200 Subject: Initial commit --- termbox2/attrw.ha | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 termbox2/attrw.ha (limited to 'termbox2/attrw.ha') diff --git a/termbox2/attrw.ha b/termbox2/attrw.ha new file mode 100644 index 0000000..d337b8f --- /dev/null +++ b/termbox2/attrw.ha @@ -0,0 +1,39 @@ +// Integer width of fg and bg attributes. Valid values (assuming system +// support) are 16, 32, and 64; see [[termbox2::uattr]]. 32 or 64 enables +// OUTPUT.TRUECOLOR, see [[termbox2::OUTPUT]] and +// [[termbox2::set_output_mode]]. 64 enables additional style attributes. +// Larger values consume more memory in exchange for more features. +// Defaults to 64. +export def OPT_ATTR_W: size = 64; + +// Unsigned integer type for cell attributes, see [[termbox2::ATTRIBUTE]]. +export type uattr = u64; + +// Colors (bitwise), see [[termbox2::cell]]. +export def COLOR = struct { + DEFAULT: uattr = 0x0000, + BLACK: uattr = 0x0001, + RED: uattr = 0x0002, + GREEN: uattr = 0x0003, + YELLOW: uattr = 0x0004, + BLUE: uattr = 0x0005, + MAGENTA: uattr = 0x0006, + CYAN: uattr = 0x0007, + WHITE: uattr = 0x0008, +}; + +// Style attributes (bitwise), see [[termbox2::cell]]. +export def ATTRIBUTE = struct { + BOLD: uattr = 0x01000000, + UNDERLINE: uattr = 0x02000000, + REVERSE: uattr = 0x04000000, + ITALIC: uattr = 0x08000000, + BLINK: uattr = 0x10000000, + HI_BLACK: uattr = 0x20000000, + BRIGHT: uattr = 0x40000000, + DIM: uattr = 0x80000000, + STRIKEOUT: uattr = 0x0000000100000000, + UNDERLINE_2: uattr = 0x0000000200000000, + OVERLINE: uattr = 0x0000000400000000, + INVISIBLE: uattr = 0x0000000800000000, +}; -- cgit v1.3