summaryrefslogtreecommitdiff
path: root/src/screen.cpp
blob: 05e8c00bf4995bc1a99b5e6e0a86c56e2e10751d (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/***************************************************************************
                                 screen.cpp
                             -------------------
    begin                : Thu Nov 25 2003
    copyright            : (C) 2003 - 2012 by Roland Riegel
    email                : feedback@roland-riegel.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "screen.h"

#include <curses.h>
#undef clear
#undef erase
#undef refresh

int Screen::width()
{
    int width;
    int height;
    getmaxyx(stdscr, height, width);
    return width;
}

int Screen::height()
{
    int width;
    int height;
    getmaxyx(stdscr, height, width);
    return height;
}

int Screen::x()
{
    int x;
    int y;
    getyx(stdscr, y, x);
    return x;
}

int Screen::y()
{
    int x;
    int y;
    getyx(stdscr, y, x);
    return y;
}