-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathSysTool.cpp
76 lines (61 loc) · 1018 Bytes
/
SysTool.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "SysTool.h"
#include <ncurses.h>
const int SysTool::COLOR_HEAD{255};
const int SysTool::COLOR_TAIL{2};
const int SysTool::COLOR_EMPTY{COLOR_BLACK};
const int SysTool::TIME_LOW{0};
const int SysTool::TIME_HIGH{300};
const int SysTool::TIME_DELTA{30};
int SysTool::colorBody{46};
int SysTool::getCols()
{
return COLS;
}
int SysTool::getLines()
{
return LINES;
}
int SysTool::setPosition(int x, int y)
{
return move(x, y);
}
int SysTool::print(const char * format, char ch)
{
return printw(format, ch);
}
int SysTool::refreshScreen()
{
return refresh();
}
int SysTool::getchNonBlocking()
{
return getch();
}
void SysTool::init()
{
initscr();
curs_set(0);
timeout(0);
noecho();
start_color();
for (int i = 0; i <= 256; ++i)
{
init_pair(i, i, COLOR_EMPTY);
}
}
void SysTool::setColor(int color)
{
attron(COLOR_PAIR(color));
}
void SysTool::setColorBody(int cb)
{
colorBody = cb % 257;
}
int SysTool::getColorBody()
{
return colorBody;
}
void SysTool::finalize()
{
endwin();
}