2024-03-25 05:34:59 +00:00
|
|
|
#pragma once
|
|
|
|
#include <iso646.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2024-04-30 21:41:31 +00:00
|
|
|
#include "fumocommon.h"
|
|
|
|
|
2024-03-25 05:34:59 +00:00
|
|
|
|
2024-05-07 03:29:10 +00:00
|
|
|
struct Color4 {
|
2024-03-25 05:34:59 +00:00
|
|
|
u8 bg : 4;
|
|
|
|
u8 fg : 4;
|
|
|
|
};
|
|
|
|
|
2024-05-07 03:29:10 +00:00
|
|
|
struct Char4 {
|
|
|
|
struct Color4 color;
|
|
|
|
char ch;
|
|
|
|
};
|
|
|
|
|
2024-04-03 23:31:47 +00:00
|
|
|
struct Terminal {
|
2024-05-07 03:29:10 +00:00
|
|
|
usize wid;
|
|
|
|
usize hgt;
|
2024-04-09 07:00:48 +00:00
|
|
|
|
2024-05-07 22:10:15 +00:00
|
|
|
struct Char4 *buf;
|
2024-03-25 05:34:59 +00:00
|
|
|
};
|
|
|
|
|
2024-05-07 22:10:15 +00:00
|
|
|
usize TerminalMaxOut(struct Terminal *term);
|
|
|
|
|
2024-05-07 03:29:10 +00:00
|
|
|
bool CreateTerminal(struct Terminal *term, usize wid, usize hgt);
|
2024-04-04 19:43:45 +00:00
|
|
|
|
2024-05-06 05:52:30 +00:00
|
|
|
void FreeTerminal(struct Terminal *term);
|
2024-03-25 05:34:59 +00:00
|
|
|
|
2024-05-07 22:10:15 +00:00
|
|
|
usize TerminalPrint(struct Terminal *term, char *out, usize n);
|