53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#ifndef __Terminal_h__
|
|
#define __Terminal_h__
|
|
|
|
#include "includes"
|
|
#include "Session.h"
|
|
|
|
namespace core {
|
|
|
|
static const int FG_BLACK = 30;
|
|
static const int FG_RED = 31;
|
|
static const int FG_GREEN = 32;
|
|
static const int FG_YELLOW = 33;
|
|
static const int FG_BLUE = 34;
|
|
static const int FG_MAGENTA = 35;
|
|
static const int FG_CYAN = 36;
|
|
static const int FG_WHITE = 37;
|
|
|
|
static const int BG_BLACK = 40;
|
|
static const int BG_RED = 41;
|
|
static const int BG_GREEN = 42;
|
|
static const int BG_YELLOW = 43;
|
|
static const int BG_BLUE = 44;
|
|
static const int BG_MAGENTA = 45;
|
|
static const int BG_CYAN = 46;
|
|
static const int BG_WHITE = 47;
|
|
|
|
static const char esc = 0x1b;
|
|
|
|
class TerminalSession : public Session {
|
|
|
|
public:
|
|
TerminalSession(EPoll &ePoll, TCPServerSocket &server);
|
|
~TerminalSession();
|
|
|
|
int getLines();
|
|
|
|
void clear();
|
|
void clearEOL();
|
|
void setCursorLocation(int x, int y);
|
|
void setColor(int color);
|
|
void setBackColor(int color);
|
|
void saveCursor();
|
|
void restoreCursor();
|
|
void NextLine(int lines);
|
|
void PreviousLine(int lines);
|
|
void scrollArea(int start, int end);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|