Basic CSI functions

This commit is contained in:
Keith Winstein
2011-01-22 02:35:17 -05:00
parent c1d6b3f30e
commit d189b2af36
7 changed files with 184 additions and 14 deletions
+20 -4
View File
@@ -31,24 +31,40 @@ namespace Terminal {
class Emulator {
friend void Parser::Print::act_on_terminal( Emulator * );
friend void Parser::Execute::act_on_terminal( Emulator * );
friend void Parser::Clear::act_on_terminal( Emulator * );
friend void Parser::Param::act_on_terminal( Emulator * );
friend void Parser::CSI_Dispatch::act_on_terminal( Emulator * );
private:
Parser::UTF8Parser parser;
size_t width, height;
size_t cursor_col, cursor_row;
size_t combining_char_col, combining_char_row;
int width, height;
int cursor_col, cursor_row;
int combining_char_col, combining_char_row;
std::deque<Row> rows;
std::string params;
std::string dispatch_chars;
/* action methods */
void print( Parser::Print *act );
void execute( Parser::Execute *act );
void param( Parser::Param *act );
void collect( Parser::Collect *act );
void clear( void );
void CSI_dispatch( Parser::CSI_Dispatch *act );
void scroll( int N );
void autoscroll( void );
void newgrapheme( void );
void parse_params( void );
std::vector<int> parsed_params;
/* CSI methods */
void CSI_EL( void );
void CSI_cursormove( void );
public:
Emulator( size_t s_width, size_t s_height );
~Emulator();