-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtui.h
More file actions
55 lines (42 loc) · 1.16 KB
/
tui.h
File metadata and controls
55 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef TUI_H
#define TUI_H
#include <stdio.h>
#include <wchar.h>
#define VLINE L'│'
#define HLINE L'─'
#define TLCORNER L'┌'
#define BLCORNER L'└'
#define TRCORNER L'┐'
#define BRCORNER L'┘'
#define LTEE L'├'
#define RTEE L'┤'
#define BTEE L'┴'
#define TTEE L'┬'
#define PLUS L'─'
#define RGB(t, r, g, b) L"\033[38;2;" #r L";" #g L";" #b L"m" t "\033[0m"
#define SET_COLOR(r, g, b) wprintf(L"\033[38;2;%d;%d;%dm", r, g, b)
#define RESET_COLOR() wprintf(L"\033[0m")
typedef struct {
unsigned width;
unsigned height;
unsigned x;
unsigned y;
unsigned has_borders;
} Window;
unsigned get_term_width();
unsigned get_term_height();
unsigned get_cursor_x_position();
unsigned get_cursor_y_position();
void inittui();
void endtui();
wchar_t getch();
void printfxy(unsigned x, unsigned y, const wchar_t * fmt, ...);
void printfxy_to_window(Window * win, int x, int y, const wchar_t * fmt, ...);
void draw_window(Window * win);
int is_echo();
void showecho(int echo);
void showcursor(int show);
void set_cursor_position(int x, int y);
void set_cursor_position_in_window(Window * win, int x, int y);
#include "config.h"
#endif