From 2674e91561efab3333fe5b5dd98d19716cab7080 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 5 Aug 2019 17:43:11 -0400 Subject: Add termDisplay --- stream.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'stream.h') diff --git a/stream.h b/stream.h index 56889c2..0bb7507 100644 --- a/stream.h +++ b/stream.h @@ -14,10 +14,30 @@ * along with this program. If not, see . */ +#include #include +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + typedef unsigned uint; +struct Style { + bool bold, italic, underline, reverse; + int bg, fg; +}; + +struct Cell { + struct Style style; + wchar_t ch; +}; + +struct Display { + uint rows, cols; + uint y, x; + const struct Cell *cells; +}; + void termInit(uint rows, uint cols); void termUpdate(wchar_t ch); int termSnapshot(int fd); +struct Display termDisplay(void); -- cgit 1.4.1