Skipping the print of characters without changes

This commit is contained in:
Markus Gans 2016-12-18 23:34:11 +01:00
parent fedb5f64f3
commit b9f3be782f
42 changed files with 670 additions and 623 deletions

View File

@ -1,3 +1,9 @@
2016-12-18 Markus Gans <guru.mail@muenster.de>
* Only perform VTerm updates on terminal updates
* Skipping the print of characters without changes
* Combined scrollAreaForward and scrollAreaReverse
with terminal scroll sequences
2016-12-15 Markus Gans <guru.mail@muenster.de>
* Reduce the character output by using character erase
and character repeat

View File

@ -526,7 +526,6 @@ void FButton::draw()
is_Flat = isFlat();
is_NonFlatShadow = ((flags & (fc::shadow+fc::flat)) == fc::shadow);
is_NoUnderline = ((flags & fc::no_underline) != 0);
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -725,7 +724,6 @@ void FButton::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
delete[] ButtonText;
if ( is_Focus && getStatusBar() )

View File

@ -447,8 +447,6 @@ void FButtonGroup::setHotkeyAccelerator()
//----------------------------------------------------------------------
void FButtonGroup::draw()
{
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -461,8 +459,6 @@ void FButtonGroup::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -40,10 +40,8 @@ void FCheckBox::init()
//----------------------------------------------------------------------
void FCheckBox::draw()
{
updateVTerm(false);
drawCheckButton();
drawLabel();
updateVTerm(true);
FToggleButton::draw();
}

View File

@ -1007,7 +1007,6 @@ void FDialog::draw()
tooltip = 0;
}
updateVTerm(false);
// fill the background
setColor();
@ -1024,8 +1023,6 @@ void FDialog::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -452,8 +452,6 @@ void FLabel::draw()
if ( text.isNull() || text.isEmpty() )
return;
updateVTerm(false);
if ( isMonochron() )
{
setReverse(true);
@ -529,6 +527,4 @@ void FLabel::draw()
if ( hasEmphasis() )
setBold(false);
}
updateVTerm(true);
}

View File

@ -748,8 +748,6 @@ void FLineEdit::drawInputField()
int active_focus = fc::active + fc::focus;
isActiveFocus = ((flags & active_focus) == active_focus);
isShadow = ((flags & fc::shadow) != 0 );
updateVTerm(false);
setPrintPos (1, 1);
if ( isMonochron() )
@ -807,8 +805,6 @@ void FLineEdit::drawInputField()
// set the cursor to the first pos.
setCursorPos (2+cursor_pos-text_offset, 1);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -1453,7 +1453,6 @@ void FListBox::draw()
if ( current < 1 )
current = 1;
updateVTerm(false);
setColor();
if ( isMonochron() )
@ -1480,8 +1479,6 @@ void FListBox::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
if ( vbar->isVisible() )
vbar->redraw();
@ -1561,8 +1558,6 @@ void FListBox::drawList()
end = std::max(last_pos, current_pos)+1;
}
updateVTerm(false);
for (uInt y=start; y < end; y++)
{
setPrintPos (2, 2 + int(y));
@ -1784,7 +1779,6 @@ void FListBox::drawList()
setReverse(false);
unsetBold();
updateVTerm(true);
last_yoffset = yoffset;
last_current = current;
}

View File

@ -1218,7 +1218,6 @@ void FMenu::draw()
{
// fill the background
setColor (wc.menu_active_fg, wc.menu_active_bg);
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -1230,8 +1229,6 @@ void FMenu::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -744,7 +744,6 @@ void FMenuBar::drawItems()
if ( item_list.empty() )
return;
updateVTerm(false);
setPrintPos (1,1);
if ( isMonochron() )
@ -826,7 +825,8 @@ void FMenuBar::drawItems()
if ( ! std::iswprint(wint_t(item_text[z])) )
{
if ( ! isNewFont() && ( int(item_text[z]) < fc::NF_rev_left_arrow2
if ( ! isNewFont()
&& ( int(item_text[z]) < fc::NF_rev_left_arrow2
|| int(item_text[z]) > fc::NF_check_mark ) )
{
item_text[z] = L' ';
@ -885,8 +885,6 @@ void FMenuBar::drawItems()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -421,7 +421,6 @@ void FMessageBox::draw()
int head_offset = 0;
int center_x = 0;
int msg_x = int((getWidth() - int(max_line_width)) / 2); // center the whole block
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -454,8 +453,6 @@ void FMessageBox::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -55,6 +55,9 @@ class FOptiAttr
uChar transparent : 1; // transparent
uChar trans_shadow : 1; // transparent shadow
uChar inherit_bg : 1; // inherit background
uChar no_changes : 1; // no changes required
uChar restored : 1; // restored VTerm character
uChar : 6; // padding bits
} char_data;
// Constructor

View File

@ -37,15 +37,12 @@ void FProgressbar::setPercentage (int percentage_value)
else
percentage = percentage_value;
updateVTerm(false);
if ( isVisible() )
{
drawPercentage();
drawBar();
}
updateVTerm(true);
updateTerminal();
}
@ -128,7 +125,6 @@ void FProgressbar::hide()
//----------------------------------------------------------------------
void FProgressbar::reset()
{
updateVTerm(false);
percentage = -1;
if ( isVisible() )
@ -137,7 +133,6 @@ void FProgressbar::reset()
drawBar();
}
updateVTerm(true);
updateTerminal();
}
@ -146,14 +141,12 @@ void FProgressbar::reset()
//----------------------------------------------------------------------
void FProgressbar::draw()
{
updateVTerm(false);
drawPercentage();
drawBar();
if ( (flags & fc::shadow) != 0 )
drawShadow ();
updateVTerm(true);
flush_out();
}

View File

@ -41,10 +41,8 @@ void FRadioButton::init()
//----------------------------------------------------------------------
void FRadioButton::draw()
{
updateVTerm(false);
drawRadioButton();
drawLabel();
updateVTerm(true);
FToggleButton::draw();
}

View File

@ -289,7 +289,6 @@ void FScrollbar::drawBar()
if ( slider_pos != current_slider_pos )
{
int z;
updateVTerm(false);
if ( bar_orientation == fc::vertical )
{
@ -392,8 +391,6 @@ void FScrollbar::drawBar()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
}
@ -604,11 +601,9 @@ void FScrollbar::init()
//----------------------------------------------------------------------
void FScrollbar::draw()
{
updateVTerm(false);
drawButtons();
current_slider_pos = -1;
drawBar();
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -259,7 +259,6 @@ void FStatusBar::drawMessage()
if ( isLastActiveFocus )
space_offset = 0;
updateVTerm(false);
setColor (wc.statusbar_fg, wc.statusbar_bg);
setPrintPos (x, 1);
@ -301,8 +300,6 @@ void FStatusBar::drawMessage()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------
@ -604,7 +601,6 @@ void FStatusBar::drawKeys()
return;
}
updateVTerm(false);
setPrintPos (1, 1);
if ( isMonochron() )
@ -721,6 +717,5 @@ void FStatusBar::drawKeys()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
x_msg = x;
}

View File

@ -97,10 +97,8 @@ void FSwitch::onMouseUp (FMouseEvent* ev)
//----------------------------------------------------------------------
void FSwitch::draw()
{
updateVTerm(false);
drawLabel();
drawCheckButton();
updateVTerm(true);
FToggleButton::draw();
updateTerminal();
flush_out();

View File

@ -430,7 +430,7 @@ int FTerm::parseKeyString ( char buffer[]
{
if ( len == 2 && ( buffer[1] == 'O'
|| buffer[1] == '['
|| buffer[1] == ']') )
|| buffer[1] == ']' ) )
{
if ( ! isKeyTimeout(time_keypressed, key_timeout) )
return NEED_MORE_DATA;
@ -932,7 +932,8 @@ const FString FTerm::getXTermColorName (int color)
void FTerm::setXTermCursorStyle (fc::xtermCursorStyle style)
{
// Set the xterm cursor style
if ( (xterm_terminal || mintty_terminal) && ! (gnome_terminal || kde_konsole) )
if ( (xterm_terminal || mintty_terminal)
&& ! (gnome_terminal || kde_konsole) )
{
putstringf (CSI "%d q", style);
std::fflush(stdout);
@ -2712,6 +2713,8 @@ void FTerm::init_termcaps()
const_cast<char*>(CSI "48;5;%p1%dm");
tcap[fc::t_exit_attribute_mode].string = \
const_cast<char*>(CSI "0m" SI);
tcap[fc::t_orig_pair].string = \
const_cast<char*>(CSI "39;49m");
}
else if ( putty_terminal )
{
@ -2858,7 +2861,7 @@ void FTerm::init_termcaps()
if ( (key_up_string && (std::strcmp(key_up_string, CSI "A") == 0))
|| ( tcap[fc::t_cursor_up].string
&& (std::strcmp(tcap[fc::t_cursor_up].string, CSI "A") == 0)) )
&& (std::strcmp(tcap[fc::t_cursor_up].string, CSI "A") == 0) ) )
{
for (int i=0; Fkey[i].tname[0] != 0; i++)
{
@ -2975,7 +2978,8 @@ void FTerm::init_encoding()
{
// detect encoding and set the Fputchar function pointer
if ( isatty(stdout_no) && ! std::strcmp(nl_langinfo(CODESET), "UTF-8") )
if ( isatty(stdout_no)
&& ! std::strcmp(nl_langinfo(CODESET), "UTF-8") )
{
utf8_console = true;
Encoding = fc::UTF8;

View File

@ -631,7 +631,6 @@ void FTextView::draw()
{
FWidget* parent = getParentWidget();
bool is_text_dialog;
updateVTerm(false);
setColor();
if ( isMonochron() )
@ -662,7 +661,6 @@ void FTextView::draw()
if ( hbar->isVisible() )
hbar->redraw();
updateVTerm(true);
drawText();
if ( hasFocus() && getStatusBar() )
@ -672,10 +670,8 @@ void FTextView::draw()
if ( curMsg != msg )
{
updateVTerm(false);
getStatusBar()->setMessage(msg);
getStatusBar()->drawMessage();
updateVTerm(true);
}
}
@ -698,7 +694,6 @@ void FTextView::drawText()
if ( end > getRows() )
end = getRows();
updateVTerm(false);
setColor();
if ( isMonochron() )
@ -737,8 +732,6 @@ void FTextView::drawText()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -79,7 +79,6 @@ void FToolTip::setText (const char* txt)
//----------------------------------------------------------------------
void FToolTip::draw()
{
updateVTerm(false);
setColor();
if ( getMaxColor() < 16 )
@ -95,7 +94,6 @@ void FToolTip::draw()
}
unsetBold();
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -15,13 +15,11 @@ bool FVTerm::terminal_update_complete;
bool FVTerm::terminal_update_pending;
bool FVTerm::force_terminal_update;
bool FVTerm::stop_terminal_updates;
bool FVTerm::vterm_updates;
int FVTerm::skipped_terminal_update = 0;
std::queue<int>* FVTerm::output_buffer = 0;
FPoint* FVTerm::term_pos = 0;
FVTerm::term_area* FVTerm::vterm = 0;
FVTerm::term_area* FVTerm::vdesktop = 0;
FVTerm::term_area* FVTerm::last_area = 0;
FVTerm::term_area* FVTerm::active_area = 0;
FVTerm::termcap_map* FVTerm::tcap = 0;
FTermcap::tcap_map* FTermcap::tcap = 0;
@ -41,7 +39,6 @@ FVTerm::FVTerm (FVTerm* parent)
, vwin(0)
{
terminal_update_complete = false;
vterm_updates = true;
if ( ! parent )
{
@ -131,7 +128,7 @@ void FVTerm::clearTerm (int fillchar)
vdesktop->changes[i].trans_count = 0;
}
updateVTerm (vdesktop);
vdesktop->has_changes = true;
setTermXY (0,0);
}
else if ( cl )
@ -279,6 +276,9 @@ void FVTerm::updateTerminal()
}
}
// Update data on VTerm
updateVTerm();
for (register uInt y=0; y < uInt(vterm->height); y++)
updateTerminalLine (y);
@ -318,7 +318,9 @@ void FVTerm::updateTerminalLine (uInt y)
for (uInt x=xmin+1; x < uInt(vt->width); x++)
{
if ( *min_char == vt->text[y * uInt(vt->width) + x] )
char_data* ch = &vt->text[y * uInt(vt->width) + x];
if ( *min_char == *ch )
beginning_whitespace++;
else
break;
@ -340,7 +342,9 @@ void FVTerm::updateTerminalLine (uInt y)
for (uInt x=1; x < uInt(vt->width); x++)
{
if ( *first_char == vt->text[y * uInt(vt->width) + x] )
char_data* ch = &vt->text[y * uInt(vt->width) + x];
if ( *first_char == *ch )
leading_whitespace++;
else
break;
@ -363,7 +367,9 @@ void FVTerm::updateTerminalLine (uInt y)
for (uInt x=uInt(vt->width)-1; x > 0 ; x--)
{
if ( *last_char == vt->text[y * uInt(vt->width) + x] )
char_data* ch = &vt->text[y * uInt(vt->width) + x];
if ( *last_char == *ch )
tailing_whitespace++;
else
break;
@ -399,6 +405,31 @@ void FVTerm::updateTerminalLine (uInt y)
char_data* print_char;
print_char = &vt->text[y * uInt(vt->width) + x];
// skip character with no changes
if ( ! terminal_update_pending
&& print_char->no_changes
&& ! print_char->restored )
{
uInt count = 1;
for (uInt i=x+1; i <= xmax; i++)
{
char_data* ch = &vt->text[y * uInt(vt->width) + i];
if ( ch->no_changes && ! ch->restored )
count++;
else
break;
}
if ( count > uInt(cursor_addres_lengths) )
{
setTermXY (int(x + count), int(y));
x = x + count - 1;
continue;
}
}
// Erase a number of characters to draw simple whitespaces
if ( ec && print_char->code == ' ' )
{
@ -407,7 +438,9 @@ void FVTerm::updateTerminalLine (uInt y)
for (uInt i=x+1; i <= xmax; i++)
{
if ( *print_char == vt->text[y * uInt(vt->width) + i] )
char_data* ch = &vt->text[y * uInt(vt->width) + i];
if ( *print_char == *ch )
whitespace++;
else
break;
@ -440,7 +473,9 @@ void FVTerm::updateTerminalLine (uInt y)
for (uInt i=x+1; i <= xmax; i++)
{
if ( *print_char == vt->text[y * uInt(vt->width) + i] )
char_data* ch = &vt->text[y * uInt(vt->width) + i];
if ( *print_char == *ch )
repetitions++;
else
break;
@ -704,6 +739,9 @@ int FVTerm::print (term_area* area, FString& s)
if ( p )
{
if ( *p )
area->has_changes = true;
while ( *p )
{
int width, height, rsh, bsh;
@ -762,6 +800,8 @@ int FVTerm::print (term_area* area, FString& s)
nc.transparent = next_attribute.transparent;
nc.trans_shadow = next_attribute.trans_shadow;
nc.inherit_bg = next_attribute.inherit_bg;
nc.no_changes = false;
nc.restored = false;
if ( area
&& area->cursor_x > 0
@ -820,8 +860,6 @@ int FVTerm::print (term_area* area, FString& s)
p++;
len++;
} // end of while
updateVTerm (area);
}
return len;
@ -878,6 +916,8 @@ int FVTerm::print (term_area* area, register int c)
nc.transparent = next_attribute.transparent;
nc.trans_shadow = next_attribute.trans_shadow;
nc.inherit_bg = next_attribute.inherit_bg;
nc.no_changes = false;
nc.restored = false;
if ( area->cursor_x > 0
&& area->cursor_y > 0
@ -918,6 +958,7 @@ int FVTerm::print (term_area* area, register int c)
}
area->cursor_x++;
area->has_changes = true;
if ( area->cursor_x > width + rsh )
{
@ -928,11 +969,9 @@ int FVTerm::print (term_area* area, register int c)
if ( area->cursor_y > height + bsh )
{
area->cursor_y--;
updateVTerm (area);
return -1;
}
updateVTerm (area);
return 1;
}
@ -1180,6 +1219,7 @@ void FVTerm::createArea ( int x_offset, int y_offset
area->input_cursor_x = -1;
area->input_cursor_y = -1;
area->input_cursor_visible = false;
area->has_changes = false;
area->changes = 0;
area->text = 0;
area->visible = false;
@ -1244,6 +1284,7 @@ void FVTerm::resizeArea ( int x_offset, int y_offset
area->height = height;
area->right_shadow = rsw;
area->bottom_shadow = bsh;
area->has_changes = false;
default_char.code = ' ';
default_char.fg_color = fc::Default;
@ -1264,6 +1305,7 @@ void FVTerm::resizeArea ( int x_offset, int y_offset
default_char.transparent = 0;
default_char.trans_shadow = 0;
default_char.inherit_bg = 0;
default_char.no_changes = 0;
std::fill_n (area->text, area_size, default_char);
@ -1413,6 +1455,7 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
}
}
sc->restored = true;
std::memcpy (tc, sc, sizeof(char_data));
if ( short(vterm->changes[y+ty].xmin) > x )
@ -1496,27 +1539,52 @@ FVTerm::covered_state FVTerm::isCovered ( int x, int y
}
//----------------------------------------------------------------------
void FVTerm::updateVTerm (bool on)
void FVTerm::updateVTerm()
{
vterm_updates = on;
// Update data on VTerm
if ( on )
updateVTerm (last_area);
if ( vdesktop && vdesktop->has_changes )
{
updateVTerm(vdesktop);
vdesktop->has_changes = false;
}
FWidget* widget = static_cast<FWidget*>(vterm->widget);
if ( ! widget->window_list || widget->window_list->empty() )
return;
FWidget::widgetList::const_iterator iter, end;
iter = widget->window_list->begin();
end = widget->window_list->end();
for (; iter != end; ++iter)
{
term_area* win = (*iter)->getVWin();
if ( ! win )
continue;
if ( ! win->visible )
continue;
if ( win->has_changes )
{
updateVTerm(win);
win->has_changes = false;
}
}
}
//----------------------------------------------------------------------
void FVTerm::updateVTerm (term_area* area)
{
// Update area data on VTerm
int ax, ay, aw, ah, rsh, bsh, y_end, ol;
char_data* tc; // terminal character
char_data* ac; // area character
if ( ! vterm_updates )
{
last_area = area;
return;
}
if ( ! area )
return;
@ -1542,7 +1610,7 @@ void FVTerm::updateVTerm (term_area* area)
else
y_end = ah + bsh;
for (register int y=0; y < y_end; y++) // line loop
for (int y=0; y < y_end; y++) // line loop
{
int line_xmin = int(area->changes[y].xmin);
int line_xmax = int(area->changes[y].xmax);
@ -1561,7 +1629,7 @@ void FVTerm::updateVTerm (term_area* area)
if ( ax + line_xmin >= vterm->width )
continue;
for (register int x=line_xmin; x <= line_xmax; x++) // column loop
for (int x=line_xmin; x <= line_xmax; x++) // column loop
{
int gx, gy, line_len;
covered_state is_covered;
@ -1599,6 +1667,7 @@ void FVTerm::updateVTerm (term_area* area)
|| ch.code == fc::FullBlock )
ch.code = ' ';
ch.no_changes = bool(! tc->restored && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data));
}
else if ( ac->transparent ) // transparent
@ -1606,6 +1675,7 @@ void FVTerm::updateVTerm (term_area* area)
// restore one character on vterm
char_data ch;
ch = getCoveredCharacter (gx+1 - ol, gy+1, area->widget);
ch.no_changes = bool(! tc->restored && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data));
}
else // not transparent
@ -1628,6 +1698,7 @@ void FVTerm::updateVTerm (term_area* area)
|| ch.code == fc::FullBlock )
ch.code = ' ';
ch.no_changes = bool(! tc->restored && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data));
}
else if ( ac->inherit_bg )
@ -1637,16 +1708,30 @@ void FVTerm::updateVTerm (term_area* area)
std::memcpy (&ch, ac, sizeof(char_data));
cc = getCoveredCharacter (gx+1 - ol, gy+1, area->widget);
ch.bg_color = cc.bg_color;
ch.no_changes = bool(*tc == ch);
std::memcpy (tc, &ch, sizeof(char_data));
}
else // default
{
if ( ! tc->restored && *tc == *ac )
{
std::memcpy (tc, ac, sizeof(char_data));
tc->no_changes = true;
}
else
{
std::memcpy (tc, ac, sizeof(char_data));
tc->no_changes = false;
}
}
}
modified = true;
}
else if ( ! modified )
line_xmin++; // don't update covered character
tc->restored = false;
}
_xmin = ax + line_xmin - ol;
@ -1745,7 +1830,6 @@ void FVTerm::setAreaCursor ( int x, int y
area->input_cursor_x = x - 1;
area->input_cursor_y = y - 1;
area->input_cursor_visible = visible;
updateVTerm (area);
}
//----------------------------------------------------------------------
@ -2014,6 +2098,24 @@ void FVTerm::scrollAreaForward (term_area* area)
std::fill_n (dc, area->width, nc);
area->changes[y_max].xmin = 0;
area->changes[y_max].xmax = uInt(area->width - 1);
area->has_changes = true;
if ( area == vdesktop )
{
if ( tcap[fc::t_scroll_forward].string )
{
setTermXY (0, vdesktop->height);
scrollTermForward();
putArea (1, 1, vdesktop);
// avoid update lines from 0 to (y_max-1)
for (int y=0; y < y_max; y++)
{
area->changes[y].xmin = uInt(area->width - 1);
area->changes[y].xmax = 0;
}
}
}
}
//----------------------------------------------------------------------
@ -2022,6 +2124,7 @@ void FVTerm::scrollAreaReverse (term_area* area)
// Scrolls the entire area one line down
int total_width;
int length;
int y_max;
char_data nc; // next character
char_data* lc; // last character
char_data* sc; // source character
@ -2035,8 +2138,9 @@ void FVTerm::scrollAreaReverse (term_area* area)
length = area->width;
total_width = area->width + area->right_shadow;
y_max = area->height - 1;
for (int y=area->height-1; y > 0; y--)
for (int y=y_max; y > 0; y--)
{
int pos1 = (y-1) * total_width;
int pos2 = y * total_width;
@ -2055,6 +2159,24 @@ void FVTerm::scrollAreaReverse (term_area* area)
std::fill_n (dc, area->width, nc);
area->changes[0].xmin = 0;
area->changes[0].xmax = uInt(area->width - 1);
area->has_changes = true;
if ( area == vdesktop )
{
if ( tcap[fc::t_scroll_reverse].string )
{
setTermXY (0, 0);
scrollTermReverse();
putArea (1, 1, vdesktop);
// avoid update lines from 1 to y_max
for (int y=1; y <= y_max; y++)
{
area->changes[y].xmin = uInt(area->width - 1);
area->changes[y].xmax = 0;
}
}
}
}
//----------------------------------------------------------------------
@ -2130,7 +2252,7 @@ void FVTerm::clearArea (term_area* area, int fillchar)
area->changes[y].trans_count = w;
}
updateVTerm (area);
area->has_changes = true;
}
//----------------------------------------------------------------------
@ -2334,7 +2456,6 @@ void FVTerm::init()
init_object = this;
vterm = 0;
vdesktop = 0;
last_area = 0;
term_pos = new FPoint(-1,-1);
output_buffer = new std::queue<int>;
@ -2363,7 +2484,9 @@ void FVTerm::init()
term_attribute.pc_charset = \
term_attribute.transparent = \
term_attribute.trans_shadow = \
term_attribute.inherit_bg = false;
term_attribute.inherit_bg = \
term_attribute.no_changes = \
term_attribute.restored = false;
// next_attribute contains the state of the next printed character
std::memcpy (&next_attribute, &term_attribute, sizeof(char_data));

View File

@ -68,6 +68,7 @@ class FVTerm : public FObject, public FTerm
FWidget* widget;
line_changes* changes;
char_data* text;
bool has_changes;
bool visible;
} term_area;
@ -263,7 +264,7 @@ class FVTerm : public FObject, public FTerm
static covered_state isCovered ( int, int
, term_area* );
static void updateVTerm (bool);
static void updateVTerm();
static void updateVTerm (term_area*);
static bool updateVTermCursor (term_area*);
static bool isInsideArea (int, int, term_area*);
@ -302,7 +303,6 @@ class FVTerm : public FObject, public FTerm
// Data Members
static term_area* vterm; // virtual terminal
static term_area* vdesktop; // virtual desktop
static term_area* last_area; // last used area
static term_area* active_area; // active area
term_area* print_area; // print area for this object
term_area* vwin; // virtual window
@ -342,7 +342,6 @@ class FVTerm : public FObject, public FTerm
static bool terminal_update_pending;
static bool force_terminal_update;
static bool stop_terminal_updates;
static bool vterm_updates;
static int skipped_terminal_update;
};
@ -404,7 +403,8 @@ inline void FVTerm::setNormal()
next_attribute.pc_charset = \
next_attribute.transparent = \
next_attribute.trans_shadow = \
next_attribute.inherit_bg = false;
next_attribute.inherit_bg = \
next_attribute.no_changes = false;
next_attribute.fg_color = fc::Default;
next_attribute.bg_color = fc::Default;

View File

@ -302,7 +302,6 @@ Calc::~Calc()
void Calc::drawDispay()
{
FString display = input;
updateVTerm(false);
if ( display.isNull() || display.isEmpty() )
display = L'0';
@ -364,8 +363,6 @@ void Calc::drawDispay()
setPrintPos (1,4);
print(separator);
}
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -41,15 +41,9 @@ void keyboard::onKeyPress (FKeyEvent* ev)
printf ("Key %s (id %d)\n", getKeyName(key_id).c_str(), key_id);
if ( is_last_line )
{
scrollAreaForward (vdesktop);
if ( ! scrollTermForward() )
putArea (getTermPos(), vdesktop);
}
setAreaCursor (1, getPrintPos().getY(), true, vdesktop);
}

View File

@ -94,8 +94,6 @@ void Mandelbrot::draw()
print(' ');
}
}
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -261,8 +261,6 @@ void AttribDemo::printAltCharset()
//----------------------------------------------------------------------
void AttribDemo::draw()
{
updateVTerm(false);
// test alternate character set
printAltCharset();
@ -383,7 +381,6 @@ void AttribDemo::draw()
setPrintPos (16, 17);
print ("Change background color ->");
updateVTerm(true);
}

View File

@ -60,13 +60,8 @@ void timer::onTimer (FTimerEvent* ev)
printf ("timer event, id %d\n", timer_id );
if ( is_last_line )
{
scrollAreaForward (vdesktop);
if ( ! scrollTermForward() )
putArea (getTermPos(), vdesktop);
}
setAreaCursor (1, getPrintPos().getY(), true, vdesktop);
}

View File

@ -67,7 +67,6 @@ Transparent::~Transparent()
void Transparent::draw()
{
FDialog::draw();
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -106,8 +105,6 @@ void Transparent::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
}
//----------------------------------------------------------------------
@ -188,19 +185,16 @@ MainWindow::MainWindow (FWidget* parent)
transpwin->setText("transparent");
transpwin->setGeometry (6, 3, 29, 12);
transpwin->unsetTransparentShadow();
transpwin->show();
Transparent* shadowwin = new Transparent(this, Transparent::shadow);
shadowwin->setText("shadow");
shadowwin->setGeometry (46, 11, 29, 12);
shadowwin->unsetTransparentShadow();
shadowwin->show();
Transparent* ibg = new Transparent(this, Transparent::inherit_background);
ibg->setText("inherit background");
ibg->setGeometry (42, 3, 29, 7);
ibg->unsetTransparentShadow();
ibg->show();
// Statusbar at the bottom
FStatusBar* statusbar = new FStatusBar (this);
@ -219,7 +213,6 @@ MainWindow::~MainWindow()
void MainWindow::draw()
{
FDialog::draw();
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -233,7 +226,7 @@ void MainWindow::draw()
if ( isMonochron() )
setReverse(false);
updateVTerm(true);
updateTerminal();
}
//----------------------------------------------------------------------