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-06 05:52:30 +00:00
|
|
|
struct Char4 {
|
2024-03-25 05:34:59 +00:00
|
|
|
char ch;
|
|
|
|
u8 bg : 4;
|
|
|
|
u8 fg : 4;
|
|
|
|
};
|
|
|
|
|
2024-04-03 23:31:47 +00:00
|
|
|
struct Terminal {
|
2024-03-25 05:34:59 +00:00
|
|
|
size_t wid;
|
|
|
|
size_t hgt;
|
|
|
|
size_t area;
|
2024-04-09 07:00:48 +00:00
|
|
|
|
2024-05-06 05:52:30 +00:00
|
|
|
struct Char4 *chs;
|
2024-03-25 05:34:59 +00:00
|
|
|
};
|
|
|
|
|
2024-05-06 05:52:30 +00:00
|
|
|
bool CreateTerminal(struct Terminal *term, size_t wid, size_t 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-06 05:52:30 +00:00
|
|
|
size_t TerminalPrint(char *dest, size_t n, struct Terminal *term);
|