2016-03-08 18:23:35 +00:00
|
|
|
#ifndef DEF_TERM_H
|
2016-03-06 21:51:07 +00:00
|
|
|
|
2016-03-08 18:23:35 +00:00
|
|
|
#define DEF_TERM_H
|
2016-03-06 21:51:07 +00:00
|
|
|
|
|
|
|
/* [1] Libs
|
|
|
|
=========================================================*/
|
|
|
|
/* (1) internes */
|
|
|
|
#include <iostream>
|
2016-03-09 14:30:03 +00:00
|
|
|
#include <ctime>
|
2016-03-06 21:51:07 +00:00
|
|
|
|
|
|
|
/* (2) Namespace */
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
/* [2] Enumerations et structures
|
|
|
|
=========================================================*/
|
|
|
|
enum TERM_COLOR{
|
|
|
|
DEFAULT = 0,
|
|
|
|
|
|
|
|
DARKBLUE = 30,
|
|
|
|
RED = 31,
|
|
|
|
GREEN = 32,
|
|
|
|
YELLOW = 33,
|
|
|
|
BLUE = 34,
|
|
|
|
PURPLE = 35,
|
|
|
|
SKYBLUE = 36
|
|
|
|
};
|
|
|
|
|
2016-03-09 14:30:03 +00:00
|
|
|
int TERM_COLOR_VALUES[] = {0, 30, 31, 32, 33, 34, 35, 36};
|
|
|
|
|
2016-03-06 21:51:07 +00:00
|
|
|
enum TERM_STYLE{
|
|
|
|
NORMAL = 0,
|
|
|
|
BOLD = 1,
|
|
|
|
ITALIC = 3,
|
|
|
|
UNDERLINE = 4,
|
|
|
|
DASHED = 9,
|
|
|
|
|
|
|
|
BACKGROUND = 7
|
|
|
|
};
|
|
|
|
|
2016-03-09 14:30:03 +00:00
|
|
|
int TERM_STYLE_VALUES[] = {0, 1, 3, 4, 9, 7};
|
|
|
|
|
2016-03-06 21:51:07 +00:00
|
|
|
/* [3] Methodes
|
|
|
|
=========================================================*/
|
2016-03-09 14:30:03 +00:00
|
|
|
void clear_screen();
|
2016-03-06 21:51:07 +00:00
|
|
|
void setfont(const TERM_COLOR c=DEFAULT, const TERM_STYLE s=NORMAL);
|
2016-03-09 13:23:00 +00:00
|
|
|
void err(string msg);
|
2016-03-09 14:30:03 +00:00
|
|
|
void init_term();
|
|
|
|
void multicolor(string str, const TERM_STYLE s=NORMAL);
|
2016-03-09 13:23:00 +00:00
|
|
|
|
2016-03-06 21:51:07 +00:00
|
|
|
/* [n] Inclusion du corps
|
|
|
|
=========================================================*/
|
|
|
|
#include "term.cpp"
|
|
|
|
|
|
|
|
#endif
|