00001 00002 #ifndef __H_PROMPT_H_ 00003 #define __H_PROMPT_H_ 00004 00005 #include <iostream> 00006 #include <string> 00007 #include <list> 00008 using namespace std; 00009 00010 #include "H_Keys.h" 00011 #include "H_Geometry.h" 00012 00013 class Hgl_streambuf : public streambuf 00014 { 00015 public: 00016 Hgl_streambuf(); 00017 virtual ~Hgl_streambuf(); 00018 string HitKey(SDLKey AKey, char c); 00019 void draw(); 00020 protected: 00021 virtual int overflow(int c = EOF); 00022 virtual int underflow(); 00023 private: 00024 Point2D charCoord(int x, int y); 00025 void drawLine(const char* LineText, int &StartLine, int CharWidth, int CharHeight); 00026 private: 00027 list<string > history; 00028 string CommandLine; 00029 }; 00030 00031 #endif //__H_PROMPT_H_