Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
terminal_gui/include/terminal.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
58 lines (45 sloc)
1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TERMINAL_H | |
#define TERMINAL_H | |
#include <iostream> | |
namespace Terminal | |
{ | |
enum Color | |
{ | |
FG_BLACK = 30, | |
FG_RED = 31, | |
FG_GREEN = 32, | |
FG_YELLOW = 33, | |
FG_BLUE = 34, | |
FG_MAGENTA = 35, | |
FG_CYAN = 36, | |
FG_WHITE = 37, | |
FG_DEFAULT = 39, | |
BG_BLACK = 40, | |
BG_RED = 41, | |
BG_GREEN = 42, | |
BG_YELLOW = 43, | |
BG_BLUE = 44, | |
BG_MAGENTA = 45, | |
BG_CYAN = 46, | |
BG_WHITE = 47, | |
BG_DEFAULT = 49 | |
}; | |
std::ostream& operator<<( std::ostream& os, const Color& c ); | |
class Position | |
{ | |
private: | |
int x, y; | |
public: | |
Position( int _x, int _y ); | |
friend std::ostream& operator<<( std::ostream& os, const Position& p ); | |
}; | |
std::ostream& operator<<( std::ostream& os, const Position& p ); | |
const std::string Default = "\033[39m\033[49m"; | |
const std::string Clear = "\033[2J\033[1;1H"; | |
const std::string CursorOff = "\e[?25l"; | |
const std::string CursorOn = "\e[?25h"; | |
void cursor( bool onoff ); | |
void defaults(); | |
void clear(); | |
} | |
#endif |