Merge branch 'master' of git.a-lec.org:gem-graph/gem-graph-server

This commit is contained in:
Jean Sirmai 2021-07-21 20:31:18 +02:00
commit 97114192d5
Signed by untrusted user who does not match committer: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 6 additions and 5 deletions

View File

@ -58,6 +58,7 @@
#define C_COLOR_YELLOW "\e[00;33m" #define C_COLOR_YELLOW "\e[00;33m"
#define C_COLOR_GREEN "\e[00;32m" #define C_COLOR_GREEN "\e[00;32m"
#define C_COLOR_BLUE "\e[01;34m" #define C_COLOR_BLUE "\e[01;34m"
#define C_COLOR_REVERSE "\e[7m"
#define C_COLOR_NORMAL "\e[0m" #define C_COLOR_NORMAL "\e[0m"
#define NON_BLOCKING 1 #define NON_BLOCKING 1
@ -126,7 +127,7 @@ static inline int getch(bool nonBlocking)
} }
// //
// Decorations // Print monitor screen
// //
void decorateMonitor(struct winsize *terminalSize) void decorateMonitor(struct winsize *terminalSize)
{ {
@ -134,7 +135,7 @@ static inline int getch(bool nonBlocking)
// print decorations // print decorations
for (int i = 0; i < terminalSize->ws_col; i++) { for (int i = 0; i < terminalSize->ws_col; i++) {
printf("*"); printf(C_COLOR_REVERSE " " C_COLOR_NORMAL);
} }
for (int i = 0; for (int i = 0;
@ -142,13 +143,13 @@ static inline int getch(bool nonBlocking)
i++) { i++) {
if ((i % terminalSize->ws_col == 0) || if ((i % terminalSize->ws_col == 0) ||
(i % terminalSize->ws_col == terminalSize->ws_col - 1)) (i % terminalSize->ws_col == terminalSize->ws_col - 1))
printf("|"); printf(C_COLOR_REVERSE " " C_COLOR_NORMAL);
else else
printf(" "); printf(C_COLOR_NORMAL " " C_COLOR_NORMAL);
} }
for (int i = 0; i < terminalSize->ws_col; i++) { for (int i = 0; i < terminalSize->ws_col; i++) {
printf("*"); printf(C_COLOR_REVERSE " " C_COLOR_NORMAL);
} }
fflush(stdout); fflush(stdout);