Support reverse video.
This commit is contained in:
@@ -138,6 +138,11 @@ void Emulator::debug_printout( int fd )
|
||||
}
|
||||
screen.append( "\033\\" );
|
||||
|
||||
/* set reverse video */
|
||||
char rev[ 8 ];
|
||||
snprintf( rev, 8, "\033[?5%c", (fb.ds.reverse_video ? 'h' : 'l') );
|
||||
screen.append( rev );
|
||||
|
||||
for ( int y = 0; y < fb.ds.get_height(); y++ ) {
|
||||
for ( int x = 0; x < fb.ds.get_width(); /* let charwidth handle advance */ ) {
|
||||
char curmove[ 32 ];
|
||||
|
||||
@@ -47,7 +47,8 @@ DrawState::DrawState( int s_width, int s_height )
|
||||
scrolling_region_top_row( 0 ), scrolling_region_bottom_row( height - 1 ),
|
||||
renditions(), save(),
|
||||
next_print_will_wrap( false ), origin_mode( false ), auto_wrap_mode( true ),
|
||||
insert_mode( false ), cursor_visible( true ), application_mode_cursor_keys( false )
|
||||
insert_mode( false ), cursor_visible( true ), reverse_video( false ),
|
||||
application_mode_cursor_keys( false )
|
||||
{
|
||||
for ( int i = 0; i < width; i++ ) {
|
||||
tabs[ i ] = ( (i % 8) == 0 );
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace Terminal {
|
||||
bool auto_wrap_mode;
|
||||
bool insert_mode;
|
||||
bool cursor_visible;
|
||||
bool reverse_video;
|
||||
|
||||
bool application_mode_cursor_keys;
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
|
||||
switch ( param ) {
|
||||
case 1: /* cursor key mode */
|
||||
return &(fb->ds.application_mode_cursor_keys);
|
||||
case 3: /* 80/132 */
|
||||
case 3: /* 80/132. Ignore but clear screen. */
|
||||
/* clear screen */
|
||||
fb->ds.move_row( 0 );
|
||||
fb->ds.move_col( 0 );
|
||||
@@ -218,6 +218,8 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
|
||||
clearline( fb, y, 0, fb->ds.get_width() - 1 );
|
||||
}
|
||||
return NULL;
|
||||
case 5: /* reverse video */
|
||||
return &(fb->ds.reverse_video);
|
||||
case 6: /* origin */
|
||||
fb->ds.move_row( 0 );
|
||||
fb->ds.move_col( 0 );
|
||||
|
||||
Reference in New Issue
Block a user