Current required packages for Debian/Ubuntu
[rofl0r-conpix.git] / ConsoleWindow.h
blob0d0d758376f5a65805291b61ed118907c4f0fbf2
1 /*
2 * ConsoleWindow.h
4 * Created on: 29.11.2010
5 * Author: rofl
6 */
8 #ifndef CONSOLEWINDOW_H_
9 #define CONSOLEWINDOW_H_
11 #include <stdint.h>
13 #include "Rgb.h"
14 #include "Logger.h"
15 #include "NsNcurses.h"
17 const int colorpaircount = 256;
19 class ConsoleWindow {
20 private:
21 int lastattr;
22 int32_t colors[colorpaircount];
23 int32_t* fgcolors[colorpaircount];
24 int32_t* bgcolors[colorpaircount];
26 RGB org_colors[colorpaircount];
27 short int org_fgcolors[colorpaircount];
28 short int org_bgcolors[colorpaircount];
30 int maxcol;
31 int32_t actfgcol;
32 int32_t actbgcol;
33 ILogger* logger;
34 public:
36 bool hasColors;
37 bool canChangeColors;
39 ConsoleWindow(ILogger* _logger);
40 virtual ~ConsoleWindow();
41 void log(std::string s);
42 void inittables();
43 void saveColors();
44 void restoreColors();
45 bool setColor(RGB mycolor, bool fg);
46 void initoutput();
47 bool setCursesColor(int colornumber, RGB color);
48 bool setColorPair(int pair, int fgcol, int bgcol);
49 bool useColorPair(int pair);
50 void getSize(int& x, int& y);
51 void gotoxy(int x, int y);
52 void addchar(int c, unsigned int attributes);
53 void printfxy (int x, int y, char* text);
54 char getKey();
55 void sleep(int ms);
56 void refresh();
57 void clear();
58 int fromThousand(int in);
59 int toThousand(int in);
62 #endif /* CONSOLEWINDOW_H_ */