summaryrefslogtreecommitdiff
path: root/src/Screen.cpp
blob: 9d0a72cd146783b44881c19717e148ff16ce1114 (plain)
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
#include "Screen.hpp"

Screen::Screen()
{
    initscr();
    clear();
    noecho();
    cbreak();
    keypad(stdscr,TRUE);
    curs_set(0);
    getmaxyx(stdscr,height,width);
    timeout(100);

    start_color();
    init_pair(1, COLOR_GREEN, COLOR_BLACK);
    init_pair(2, COLOR_YELLOW,COLOR_BLACK);
    init_pair(3, COLOR_WHITE, COLOR_WHITE);
    init_pair(4, COLOR_WHITE, COLOR_BLUE);
}

Screen::~Screen()
{
    endwin();
}

void Screen::ping(string msg)
{
    const char * cmsg = msg.c_str();
    printw(cmsg);
}

int Screen::getHeight()
{
    return height;
}

int Screen::getWidth()
{
    return width;
}