#include <curses.h>
#include <string>
#include <sstream>

#ifndef CONSOLE_H
#define CONSOLE_H

enum {BLACK=0, RED, GREEN, BROWN, BLUE, PURPLE, CYAN, GREY,
      BRIGHTRED,
      BRIGHTGREEN,
      YELLOW,
      BRIGHTBLUE,
      BRIGHTPURPLE,
      BRIGHTCYAN,
      WHITE};

class console {
  private:
    WINDOW *w;
    static int created;
    static int deleted;
  public:
    console();
    console(WINDOW*);
    
    console operator<<(std::string&);
    console operator<<(char*);
    console operator<<(int);
    console operator<<(char);

    static int cattr(int);
    void setcol(int);
    
    void ch(char);
    void ch(char, int);
    void mvch(int, int, char);
    void mvch(int, int, char, int);
	void ch(chtype c, int col);
    void str(std::string);
    void str(std::string, int);
    void mvstr(int, int, std::string);
    void mvstr(int, int, std::string, int);
    void mv(int, int);
    void clr();

    int getwidth();
    int getheight();
    
	std::string input();
    char get();

    static int print();

    ~console();
};

#endif
