Modularize display code and add representation of wrapped line flag

This commit is contained in:
Keith Winstein
2011-02-09 15:30:50 -05:00
parent 1ee54cd70a
commit 71dfd5a763
7 changed files with 141 additions and 104 deletions
+11 -1
View File
@@ -60,13 +60,16 @@ namespace Terminal {
class Row {
public:
std::vector<Cell> cells;
bool wrap;
Row( size_t s_width )
: cells( s_width )
: cells( s_width ), wrap( false )
{}
void insert_cell( int col );
void delete_cell( int col );
void reset( void );
};
class SavedCursor {
@@ -161,6 +164,13 @@ namespace Terminal {
void move_rows_autoscroll( int rows );
Row *get_row( int row )
{
if ( row == -1 ) row = ds.get_cursor_row();
return &rows[ row ];
}
inline Cell *get_cell( void )
{
return &rows[ ds.get_cursor_row() ].cells[ ds.get_cursor_col() ];