diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-30 12:31:23 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-30 12:31:23 +0200 |
commit | 03862852b128748358dcb39ce50600eef0ba1a71 (patch) | |
tree | d5052d02d7bb31a866d5829eb05cfaf9b35bfa59 /client/ui.h | |
parent | 555e5d2c0ce77dd1e031690c98ec9a1366182347 (diff) |
use ncurses instead of poopy ui library
Diffstat (limited to 'client/ui.h')
-rw-r--r-- | client/ui.h | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/client/ui.h b/client/ui.h index 610e3fc..06a8cea 100644 --- a/client/ui.h +++ b/client/ui.h @@ -1,35 +1,11 @@ #pragma once #include <stdint.h> +#include <ncurses.h> -#include "../shared/bool.h" - -typedef struct { - unsigned int width; - unsigned int height; - unsigned int cursor_pos; -} w2_s_ui_tty_canvas; - -typedef enum { - W2_UI_COL_BLK, - W2_UI_COL_RED, - W2_UI_COL_GRN, - W2_UI_COL_YEL, - W2_UI_COL_BLU, - W2_UI_COL_MAG, - W2_UI_COL_CYN, - W2_UI_COL_WHT, - W2_UI_COL_RST, -} w2_e_colors; - -typedef enum { - W2_UI_ALIGN_LEFT, - W2_UI_ALIGN_CENTER, - W2_UI_ALIGN_RIGHT, -} w2_e_alignment; - -extern bool g_w2_ui_enable_color; -extern w2_s_ui_tty_canvas g_w2_ui_canvas; +extern WINDOW *g_w2_ui_win; +extern unsigned int g_w2_ui_width; +extern unsigned int g_w2_ui_height; /** update terminal props */ void w2_ui_update(); @@ -37,21 +13,11 @@ void w2_ui_update(); void w2_ui_clear(); /** draw complete ui */ void w2_ui_paint(); -/** draw status bar */ -void w2_ui_paint_statusbar(); /** update and paint */ void w2_ui_main(); -/** get ansi color code for foreground color */ -char *w2_ui_set_fg(w2_e_colors color); -/** get ansi color code for background color */ -char *w2_ui_set_bg(w2_e_colors color); - -/** align `text` `align` with `text` buffer length `length` */ -void w2_ui_align(char *text, w2_e_alignment align, unsigned int length); +/** draw status bar */ +void w2_ui_paint_statusbar(); +/** draw tab bar */ +void w2_ui_paint_tabbar(); -/** - * trim spaces from `top` and overlay on top of `bottom` - * both strings should be at least `length` long - */ -void w2_ui_overlay(char *bottom, char *top, unsigned int length); |