Added smarter display routine

This commit is contained in:
Keith Winstein
2011-02-05 02:55:30 -05:00
parent 225ddbe2bf
commit a54cc9d0c4
6 changed files with 179 additions and 6 deletions
+18
View File
@@ -12,6 +12,21 @@
#include "terminaluserinput.hpp"
namespace Terminal {
class Display {
private:
bool initialized;
Framebuffer last_frame;
std::vector<int> current_renditions;
public:
Display( int width, int height )
: initialized( false ), last_frame( width, height ),
current_renditions()
{}
std::string new_frame( Framebuffer &f );
};
class Emulator {
friend void Parser::Print::act_on_terminal( Emulator * );
friend void Parser::Execute::act_on_terminal( Emulator * );
@@ -30,6 +45,7 @@ namespace Terminal {
Framebuffer fb;
Dispatcher dispatch;
UserInput user;
Display display;
/* action methods */
void print( Parser::Print *act );
@@ -48,6 +64,8 @@ namespace Terminal {
std::string open( void ); /* put user cursor keys in application mode */
std::string close( void ); /* restore user cursor keys */
std::string new_frame( void ) { return display.new_frame( fb ); }
};
}