Replace pointers with references
This commit is contained in:
parent
61eb8b8166
commit
98f9cd5718
|
@ -147,7 +147,7 @@ int main (int argc, char* argv[])
|
|||
dgl.show();
|
||||
|
||||
// Get the checked radio button text
|
||||
for (int n{1}; n <= int(checkButtonGroup.getCount()); n++)
|
||||
for (auto n{1}; n <= int(checkButtonGroup.getCount()); n++)
|
||||
{
|
||||
if ( checkButtonGroup.isChecked(n) )
|
||||
{
|
||||
|
|
|
@ -116,12 +116,12 @@ Listbox::Listbox (FWidget* parent)
|
|||
list1.setGeometry(FPoint{2, 1}, FSize{18, 10});
|
||||
list1.setText ("FListBoxItem");
|
||||
|
||||
for (int i{1}; i < 30; i++)
|
||||
for (auto i{1}; i < 30; i++)
|
||||
list1.insert (L"----- " + (FString{} << i) + L" -----");
|
||||
|
||||
// listbox 2
|
||||
//----------
|
||||
for (int i{1}; i <= 15; i++)
|
||||
for (auto i{1}; i <= 15; i++)
|
||||
double_list.push_back(2 * double(i) + (double(i) / 100));
|
||||
|
||||
list2.setGeometry(FPoint{21, 1}, FSize{10, 10});
|
||||
|
|
|
@ -152,7 +152,7 @@ void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev)
|
|||
if ( ev->getButton() == fc::MiddleButton )
|
||||
return;
|
||||
|
||||
for (int c{0}; c < 16; c++)
|
||||
for (auto c{0}; c < 16; c++)
|
||||
{
|
||||
const int xmin = 2 + (c / 8) * 3;
|
||||
const int xmax = 4 + (c / 8) * 3;
|
||||
|
@ -434,7 +434,7 @@ void MouseDraw::draw()
|
|||
|
||||
if ( finalcut::FTerm::isNewFont() )
|
||||
{
|
||||
for (int y{2}; y < y_max; y++)
|
||||
for (auto y{2}; y < y_max; y++)
|
||||
{
|
||||
print() << FPoint{10, y}
|
||||
<< fc::NF_rev_border_line_right;
|
||||
|
@ -448,7 +448,7 @@ void MouseDraw::draw()
|
|||
print() << FPoint{10, 2}
|
||||
<< fc::BoxDrawingsDownAndHorizontal;
|
||||
|
||||
for (int y{3}; y < y_max; y++)
|
||||
for (auto y{3}; y < y_max; y++)
|
||||
{
|
||||
print() << FPoint{10, y} << fc::BoxDrawingsVertical;
|
||||
}
|
||||
|
@ -503,14 +503,14 @@ void MouseDraw::drawCanvas()
|
|||
const int x_end = canvas->width;
|
||||
const int w_line_len = printarea->width + printarea->right_shadow;
|
||||
|
||||
for (int y{0}; y < y_end; y++) // line loop
|
||||
for (auto y{0}; y < y_end; y++) // line loop
|
||||
{
|
||||
const finalcut::FChar* canvaschar{}; // canvas character
|
||||
finalcut::FChar* winchar{}; // window character
|
||||
canvaschar = &canvas->data[y * x_end];
|
||||
winchar = &printarea->data[(ay + y) * w_line_len + ax];
|
||||
std::memcpy ( winchar
|
||||
, canvaschar
|
||||
// canvas character
|
||||
const auto& canvaschar = canvas->data[y * x_end];
|
||||
// window character
|
||||
auto& winchar = printarea->data[(ay + y) * w_line_len + ax];
|
||||
std::memcpy ( &winchar
|
||||
, &canvaschar
|
||||
, sizeof(finalcut::FChar) * unsigned(x_end) );
|
||||
|
||||
if ( int(printarea->changes[ay + y].xmin) > ax )
|
||||
|
|
|
@ -157,13 +157,13 @@ void RotoZoomer::rotozoomer (double cx, double cy, double r, double a)
|
|||
int dxdy = (Cx - Ax) / 23;
|
||||
int dydy = (Cy - Ay) / 23;
|
||||
|
||||
for (int y = 0; y < Lines; y++)
|
||||
for (auto y = 0; y < Lines; y++)
|
||||
{
|
||||
Cx = Ax;
|
||||
Cy = Ay;
|
||||
print() << FPoint{2, 3 + y};
|
||||
|
||||
for (int x = 0; x < Cols; x++)
|
||||
for (auto x = 0; x < Cols; x++)
|
||||
{
|
||||
auto ch = data[((Cy >> 14) & 0xf) + ((Cx >> 10) & 0xf0)];
|
||||
|
||||
|
|
|
@ -135,11 +135,11 @@ void Scrollview::draw()
|
|||
setColor (wc->label_inactive_fg, wc->dialog_bg);
|
||||
clearArea();
|
||||
|
||||
for (int y{0}; y < int(getScrollHeight()); y++)
|
||||
for (auto y{0}; y < int(getScrollHeight()); y++)
|
||||
{
|
||||
print() << FPoint{1, 1 + y};
|
||||
|
||||
for (int x{0}; x < int(getScrollWidth()); x++)
|
||||
for (auto x{0}; x < int(getScrollWidth()); x++)
|
||||
print (32 + ((x + y) % 0x5f));
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void Transparent::draw()
|
|||
const finalcut::FString line{getClientWidth(), '.'};
|
||||
|
||||
// Fill window area
|
||||
for (int n{1}; n <= int(getClientHeight()); n++)
|
||||
for (auto n{1}; n <= int(getClientHeight()); n++)
|
||||
{
|
||||
print() << FPoint{2, 2 + n}
|
||||
<< line;
|
||||
|
|
|
@ -597,7 +597,7 @@ void MyDialog::initWidgets()
|
|||
myList.setMultiSelection();
|
||||
myList.reserve(100);
|
||||
|
||||
for (int z{1}; z < 100; z++)
|
||||
for (auto z{1}; z < 100; z++)
|
||||
myList.insert (finalcut::FString{} << z << L" placeholder");
|
||||
|
||||
// Text labels
|
||||
|
|
|
@ -776,7 +776,7 @@ inline void FApplication::sendKeyboardAccelerator()
|
|||
auto window = static_cast<const FWidget*>(getActiveWindow());
|
||||
|
||||
if ( window )
|
||||
accpt = processAccelerator (window);
|
||||
accpt = processAccelerator(*window);
|
||||
}
|
||||
|
||||
// Global keyboard accelerator
|
||||
|
@ -785,7 +785,7 @@ inline void FApplication::sendKeyboardAccelerator()
|
|||
auto root_widget = getRootWidget();
|
||||
|
||||
if ( root_widget )
|
||||
processAccelerator (root_widget);
|
||||
processAccelerator(*root_widget);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -836,12 +836,12 @@ bool FApplication::processDialogSwitchAccelerator() const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FApplication::processAccelerator (const FWidget* const& widget) const
|
||||
bool FApplication::processAccelerator (const FWidget& widget) const
|
||||
{
|
||||
if ( ! widget || widget->getAcceleratorList().empty() )
|
||||
if ( widget.getAcceleratorList().empty() )
|
||||
return false;
|
||||
|
||||
for (auto&& item : widget->getAcceleratorList())
|
||||
for (auto&& item : widget.getAcceleratorList())
|
||||
{
|
||||
if ( item.key == keyboard->getKey() )
|
||||
{
|
||||
|
|
|
@ -443,7 +443,7 @@ inline std::size_t FButton::clickAnimationIndent (const FWidget* parent_widget)
|
|||
setColor ( parent_widget->getForegroundColor()
|
||||
, parent_widget->getBackgroundColor() );
|
||||
|
||||
for (int y{1}; y <= int(getHeight()); y++)
|
||||
for (auto y{1}; y <= int(getHeight()); y++)
|
||||
{
|
||||
print() << FPoint{1, y} << ' '; // clear one left █
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ inline void FButton::clearRightMargin (const FWidget* parent_widget)
|
|||
setColor ( parent_widget->getForegroundColor()
|
||||
, parent_widget->getBackgroundColor() );
|
||||
|
||||
for (int y{1}; y <= int(getHeight()); y++)
|
||||
for (auto y{1}; y <= int(getHeight()); y++)
|
||||
{
|
||||
if ( FTerm::isMonochron() )
|
||||
setReverse(true); // Light background
|
||||
|
|
|
@ -210,7 +210,7 @@ void FButtonGroup::hide()
|
|||
// Hide border
|
||||
unsetViewportPrint();
|
||||
|
||||
for (int y{0}; y < int(getHeight()); y++)
|
||||
for (auto y{0}; y < int(getHeight()); y++)
|
||||
print() << FPoint{1, 1 + y} << FString{size, L' '};
|
||||
|
||||
setViewportPrint();
|
||||
|
|
|
@ -436,7 +436,7 @@ void FComboBox::onMouseMove (FMouseEvent* ev)
|
|||
|
||||
if ( isMouseOverListWindow(ev->getTermPos()) )
|
||||
{
|
||||
passEventToListWindow(ev); // Event handover to window list
|
||||
passEventToListWindow(*ev); // Event handover to window list
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -590,13 +590,13 @@ void FComboBox::onePosDown()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FComboBox::passEventToListWindow (FMouseEvent* const& ev)
|
||||
void FComboBox::passEventToListWindow (const FMouseEvent& ev)
|
||||
{
|
||||
// Mouse event handover to list window
|
||||
|
||||
const auto& t = ev->getTermPos();
|
||||
const auto& t = ev.getTermPos();
|
||||
const auto& p = list_window.list.termToWidgetPos(t);
|
||||
const int b = ev->getButton();
|
||||
const int b = ev.getButton();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -960,7 +960,7 @@ void FDialog::drawBorder()
|
|||
{
|
||||
const FRect r{FPoint{1, 1}, getSize()};
|
||||
|
||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
for (auto y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
{
|
||||
print() << FPoint{r.getX1(), y}
|
||||
<< fc::NF_border_line_left // border left ⎸
|
||||
|
|
|
@ -179,7 +179,7 @@ FString FFileDialog::getSelectedFile() const
|
|||
//----------------------------------------------------------------------
|
||||
void FFileDialog::setPath (const FString& dir)
|
||||
{
|
||||
const char* const dirname = dir.c_str();
|
||||
const auto& dirname = dir.c_str();
|
||||
std::array<char, MAXPATHLEN> resolved_path{};
|
||||
FString r_dir{};
|
||||
struct stat sb{};
|
||||
|
@ -491,7 +491,7 @@ void FFileDialog::sortDir()
|
|||
//----------------------------------------------------------------------
|
||||
int FFileDialog::readDir()
|
||||
{
|
||||
const char* const dir = directory.c_str();
|
||||
const auto& dir = directory.c_str();
|
||||
directory_stream = opendir(dir);
|
||||
|
||||
if ( ! directory_stream )
|
||||
|
@ -555,7 +555,7 @@ int FFileDialog::readDir()
|
|||
//----------------------------------------------------------------------
|
||||
void FFileDialog::getEntry (const char* const dir, const struct dirent* d_entry)
|
||||
{
|
||||
const char* const filter = filter_pattern.c_str();
|
||||
const auto& filter = filter_pattern.c_str();
|
||||
FDirEntry entry{};
|
||||
|
||||
entry.name = d_entry->d_name;
|
||||
|
|
|
@ -280,7 +280,7 @@ void FListBox::clear()
|
|||
if ( size == 0 )
|
||||
return;
|
||||
|
||||
for (int y{0}; y < int(getHeight()) - 2; y++)
|
||||
for (auto y{0}; y < int(getHeight()) - 2; y++)
|
||||
{
|
||||
print() << FPoint{2, 2 + y} << FString{size, L' '};
|
||||
}
|
||||
|
@ -724,7 +724,7 @@ void FListBox::draw()
|
|||
{
|
||||
setColor();
|
||||
|
||||
for (int y{2}; y < int(getHeight()); y++)
|
||||
for (auto y{2}; y < int(getHeight()); y++)
|
||||
{
|
||||
print() << FPoint{int(getWidth()) - 1, y}
|
||||
<< ' '; // clear right side of the scrollbar
|
||||
|
|
|
@ -1601,7 +1601,7 @@ void FListView::draw()
|
|||
{
|
||||
setColor();
|
||||
|
||||
for (int y{2}; y < int(getHeight()); y++)
|
||||
for (auto y{2}; y < int(getHeight()); y++)
|
||||
{
|
||||
print() << FPoint{int(getWidth()) - 1, y}
|
||||
<< ' '; // clear right side of the scrollbar
|
||||
|
@ -1838,7 +1838,7 @@ void FListView::clearList()
|
|||
if ( size == 0 )
|
||||
return;
|
||||
|
||||
for (int y{0}; y < int(getHeight()) - 2; y++)
|
||||
for (auto y{0}; y < int(getHeight()) - 2; y++)
|
||||
{
|
||||
print() << FPoint{2, 2 + y} << FString{size, L' '};
|
||||
}
|
||||
|
|
|
@ -279,19 +279,19 @@ void FMenu::onMouseMove (FMouseEvent* ev)
|
|||
|
||||
if ( ms.mouse_over_submenu )
|
||||
{
|
||||
passEventToSubMenu(ev); // Event handover to sub-menu
|
||||
passEventToSubMenu(*ev); // Event handover to sub-menu
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! ms.mouse_over_menu && ms.mouse_over_supermenu )
|
||||
{
|
||||
passEventToSuperMenu(ev); // Event handover to super-menu
|
||||
passEventToSuperMenu(*ev); // Event handover to super-menu
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ms.mouse_over_menubar )
|
||||
{
|
||||
passEventToMenuBar(ev); // Event handover to the menu bar
|
||||
passEventToMenuBar(*ev); // Event handover to the menu bar
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -909,13 +909,13 @@ void FMenu::mouseMoveOverBorder (MouseStates& ms) const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenu::passEventToSubMenu (FMouseEvent* const& ev)
|
||||
void FMenu::passEventToSubMenu (const FMouseEvent& ev)
|
||||
{
|
||||
// Mouse event handover to sub-menu
|
||||
|
||||
const auto& t = ev->getTermPos();
|
||||
const auto& t = ev.getTermPos();
|
||||
const auto& p = opened_sub_menu->termToWidgetPos(t);
|
||||
const int b = ev->getButton();
|
||||
const int b = ev.getButton();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -932,14 +932,14 @@ void FMenu::passEventToSubMenu (FMouseEvent* const& ev)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenu::passEventToSuperMenu (FMouseEvent* const& ev)
|
||||
void FMenu::passEventToSuperMenu (const FMouseEvent& ev)
|
||||
{
|
||||
// Mouse event handover to super-menu
|
||||
|
||||
auto smenu = superMenuAt (ev->getTermPos());
|
||||
const auto& t = ev->getTermPos();
|
||||
auto smenu = superMenuAt (ev.getTermPos());
|
||||
const auto& t = ev.getTermPos();
|
||||
const auto& p = smenu->termToWidgetPos(t);
|
||||
const int b = ev->getButton();
|
||||
const int b = ev.getButton();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -956,14 +956,14 @@ void FMenu::passEventToSuperMenu (FMouseEvent* const& ev)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenu::passEventToMenuBar (FMouseEvent* const& ev) const
|
||||
void FMenu::passEventToMenuBar (const FMouseEvent& ev) const
|
||||
{
|
||||
// Mouse event handover to the menu bar
|
||||
|
||||
auto menu_bar = getMenuBar();
|
||||
const auto& t = ev->getTermPos();
|
||||
const auto& t = ev.getTermPos();
|
||||
const auto& p = menu_bar->termToWidgetPos(t);
|
||||
const int b = ev->getButton();
|
||||
const int b = ev.getButton();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -223,6 +223,8 @@ void FMenuBar::onAccel (FAccelEvent* ev)
|
|||
getStatusBar()->drawMessage();
|
||||
|
||||
redraw();
|
||||
processTerminalUpdate();
|
||||
flush();
|
||||
ev->accept();
|
||||
}
|
||||
|
||||
|
@ -902,7 +904,7 @@ void FMenuBar::mouseMoveOverList (const FMouseEvent* ev)
|
|||
else
|
||||
{
|
||||
// Event handover to the menu
|
||||
passEventToMenu(ev);
|
||||
passEventToMenu(*ev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -916,11 +918,15 @@ void FMenuBar::mouseMoveOverList (const FMouseEvent* ev)
|
|||
}
|
||||
|
||||
if ( focus_changed )
|
||||
{
|
||||
redraw();
|
||||
processTerminalUpdate();
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenuBar::passEventToMenu (const FMouseEvent* const& ev) const
|
||||
void FMenuBar::passEventToMenu (const FMouseEvent& ev) const
|
||||
{
|
||||
if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() )
|
||||
return;
|
||||
|
@ -930,11 +936,11 @@ void FMenuBar::passEventToMenu (const FMouseEvent* const& ev) const
|
|||
const auto& menu_geometry = menu->getTermGeometry();
|
||||
|
||||
if ( menu->getCount() > 0
|
||||
&& menu_geometry.contains(ev->getTermPos()) )
|
||||
&& menu_geometry.contains(ev.getTermPos()) )
|
||||
{
|
||||
const auto& t = ev->getTermPos();
|
||||
const auto& t = ev.getTermPos();
|
||||
const auto& p = menu->termToWidgetPos(t);
|
||||
const int b = ev->getButton();
|
||||
const int b = ev.getButton();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -417,6 +417,7 @@ void FMenuItem::onAccel (FAccelEvent* ev)
|
|||
|
||||
mbar->redraw();
|
||||
mbar->drop_down = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -427,6 +428,8 @@ void FMenuItem::onAccel (FAccelEvent* ev)
|
|||
mbar->drop_down = false;
|
||||
}
|
||||
|
||||
processTerminalUpdate();
|
||||
flush();
|
||||
ev->accept();
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -463,7 +463,7 @@ void FScrollbar::drawVerticalBar()
|
|||
const auto& wc = getColorTheme();
|
||||
setColor (wc->scrollbar_fg, wc->scrollbar_bg);
|
||||
|
||||
for (int z{1}; z <= slider_pos; z++)
|
||||
for (auto z{1}; z <= slider_pos; z++)
|
||||
{
|
||||
print() << FPoint{1, 1 + z};
|
||||
drawVerticalBackgroundLine();
|
||||
|
@ -474,7 +474,7 @@ void FScrollbar::drawVerticalBar()
|
|||
if ( FTerm::isMonochron() )
|
||||
setReverse(false);
|
||||
|
||||
for (int z{1}; z <= int(slider_length); z++) // Draw slider
|
||||
for (auto z{1}; z <= int(slider_length); z++) // Draw slider
|
||||
{
|
||||
print() << FPoint{1, 1 + slider_pos + z};
|
||||
|
||||
|
@ -489,7 +489,7 @@ void FScrollbar::drawVerticalBar()
|
|||
|
||||
setColor (wc->scrollbar_fg, wc->scrollbar_bg);
|
||||
|
||||
for (int z = slider_pos + int(slider_length) + 1; z <= int(bar_length); z++)
|
||||
for (auto z = slider_pos + int(slider_length) + 1; z <= int(bar_length); z++)
|
||||
{
|
||||
print() << FPoint{1, 1 + z};
|
||||
drawVerticalBackgroundLine();
|
||||
|
@ -529,7 +529,7 @@ void FScrollbar::drawHorizontalBar()
|
|||
else
|
||||
print() << FPoint{2, 1};
|
||||
|
||||
for (int z{0}; z < slider_pos; z++)
|
||||
for (auto z{0}; z < slider_pos; z++)
|
||||
drawHorizontalBackgroundColumn();
|
||||
|
||||
setColor (wc->scrollbar_bg, wc->scrollbar_fg);
|
||||
|
@ -537,7 +537,7 @@ void FScrollbar::drawHorizontalBar()
|
|||
if ( FTerm::isMonochron() )
|
||||
setReverse(false);
|
||||
|
||||
for (int z{0}; z < int(slider_length); z++) // Draw slider
|
||||
for (auto z{0}; z < int(slider_length); z++) // Draw slider
|
||||
print (' ');
|
||||
|
||||
if ( FTerm::isMonochron() )
|
||||
|
|
|
@ -647,10 +647,7 @@ void FScrollView::copy2area()
|
|||
if ( ! hasPrintArea() )
|
||||
FWidget::getPrintArea();
|
||||
|
||||
if ( ! (hasPrintArea() && viewport) )
|
||||
return;
|
||||
|
||||
if ( ! viewport->has_changes )
|
||||
if ( ! (hasPrintArea() && viewport && viewport->has_changes) )
|
||||
return;
|
||||
|
||||
auto printarea = getCurrentPrintArea();
|
||||
|
@ -669,15 +666,15 @@ void FScrollView::copy2area()
|
|||
if ( printarea->height <= ay + y_end )
|
||||
y_end = printarea->height - ay;
|
||||
|
||||
for (int y{0}; y < y_end; y++) // line loop
|
||||
for (auto y{0}; y < y_end; y++) // line loop
|
||||
{
|
||||
const FChar* vc{}; // viewport character
|
||||
FChar* ac{}; // area character
|
||||
const int v_line_len = viewport->width;
|
||||
const int a_line_len = printarea->width + printarea->right_shadow;
|
||||
vc = &viewport->data[(dy + y) * v_line_len + dx];
|
||||
ac = &printarea->data[(ay + y) * a_line_len + ax];
|
||||
std::memcpy (ac, vc, sizeof(FChar) * unsigned(x_end));
|
||||
// viewport character
|
||||
const auto& vc = viewport->data[(dy + y) * v_line_len + dx];
|
||||
// area character
|
||||
auto& ac = printarea->data[(ay + y) * a_line_len + ax];
|
||||
std::memcpy (&ac, &vc, sizeof(FChar) * unsigned(x_end));
|
||||
|
||||
if ( int(printarea->changes[ay + y].xmin) > ax )
|
||||
printarea->changes[ay + y].xmin = uInt(ax);
|
||||
|
|
|
@ -255,7 +255,7 @@ void FStatusBar::drawMessage()
|
|||
}
|
||||
}
|
||||
|
||||
for (int i = x; i <= int(termWidth); i++)
|
||||
for (auto i = x; i <= int(termWidth); i++)
|
||||
print (' ');
|
||||
|
||||
if ( FTerm::isMonochron() )
|
||||
|
|
|
@ -444,7 +444,7 @@ FTermDebugData& FTerm::getFTermDebugData()
|
|||
//----------------------------------------------------------------------
|
||||
bool FTerm::isNormal (const FChar& ch)
|
||||
{
|
||||
return FOptiAttr::isNormal(&ch);
|
||||
return FOptiAttr::isNormal(ch);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -1319,7 +1319,7 @@ void FTerm::initScreenSettings()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
const char* FTerm::changeAttribute (FChar*& term_attr, FChar*& next_attr)
|
||||
const char* FTerm::changeAttribute (FChar& term_attr, FChar& next_attr)
|
||||
{
|
||||
return opti_attr->changeAttribute (term_attr, next_attr);
|
||||
}
|
||||
|
|
|
@ -163,8 +163,8 @@ void FTermDetection::deallocation()
|
|||
void FTermDetection::getSystemTermType()
|
||||
{
|
||||
// Import the untrusted environment variable TERM
|
||||
const char* const& term_env = std::getenv("TERM");
|
||||
const char* termfilename = fterm_data->getTermFileName();
|
||||
const auto& term_env = std::getenv("TERM");
|
||||
const auto& termfilename = fterm_data->getTermFileName();
|
||||
|
||||
if ( term_env )
|
||||
{
|
||||
|
|
|
@ -322,7 +322,7 @@ void FTextView::clear()
|
|||
if ( size == 0 )
|
||||
return;
|
||||
|
||||
for (int y{0}; y < int(getTextHeight()); y++)
|
||||
for (auto y{0}; y < int(getTextHeight()); y++)
|
||||
{
|
||||
print() << FPoint{2, 2 - nf_offset + y}
|
||||
<< FString{size, L' '};
|
||||
|
|
212
src/fvterm.cpp
212
src/fvterm.cpp
|
@ -255,7 +255,7 @@ void FVTerm::resizeVTerm (const FSize& size) const
|
|||
//----------------------------------------------------------------------
|
||||
void FVTerm::putVTerm() const
|
||||
{
|
||||
for (int i{0}; i < vterm->height; i++)
|
||||
for (auto i{0}; i < vterm->height; i++)
|
||||
{
|
||||
vterm->changes[i].xmin = 0;
|
||||
vterm->changes[i].xmax = uInt(vterm->width - 1);
|
||||
|
@ -799,11 +799,11 @@ void FVTerm::restoreVTerm (const FRect& box)
|
|||
if ( h < 0 )
|
||||
return;
|
||||
|
||||
for (int ty{0}; ty < h; ty++)
|
||||
for (auto ty{0}; ty < h; ty++)
|
||||
{
|
||||
const int ypos = y + ty;
|
||||
|
||||
for (int tx{0}; tx < w; tx++)
|
||||
for (auto tx{0}; tx < w; tx++)
|
||||
{
|
||||
const int xpos = x + tx;
|
||||
auto& tc = vterm->data[ypos * vterm->width + xpos]; // terminal character
|
||||
|
@ -888,7 +888,7 @@ void FVTerm::getArea (const FPoint& pos, const FTermArea* area)
|
|||
else
|
||||
length = area->width;
|
||||
|
||||
for (int y{0}; y < y_end; y++) // line loop
|
||||
for (auto y{0}; y < y_end; y++) // line loop
|
||||
{
|
||||
const auto& tc = vterm->data[(ay + y) * vterm->width + ax]; // terminal character
|
||||
auto& ac = area->data[y * area->width]; // area character
|
||||
|
@ -935,7 +935,7 @@ void FVTerm::getArea (const FRect& box, const FTermArea* area)
|
|||
if ( length < 1 )
|
||||
return;
|
||||
|
||||
for (int _y = 0; _y < y_end; _y++) // line loop
|
||||
for (auto _y = 0; _y < y_end; _y++) // line loop
|
||||
{
|
||||
const int line_len = area->width + area->right_shadow;
|
||||
const auto& tc = vterm->data[(y + _y - 1) * vterm->width + x - 1]; // terminal character
|
||||
|
@ -979,7 +979,7 @@ void FVTerm::putArea (const FTermArea* area) const
|
|||
else
|
||||
y_end = height;
|
||||
|
||||
for (int y{0}; y < y_end; y++) // Line loop
|
||||
for (auto y{0}; y < y_end; y++) // Line loop
|
||||
{
|
||||
bool modified{false};
|
||||
auto line_xmin = int(area->changes[y].xmin);
|
||||
|
@ -997,7 +997,7 @@ void FVTerm::putArea (const FTermArea* area) const
|
|||
if ( ax + line_xmin >= vterm->width )
|
||||
continue;
|
||||
|
||||
for (int x = line_xmin; x <= line_xmax; x++) // Column loop
|
||||
for (auto x = line_xmin; x <= line_xmax; x++) // Column loop
|
||||
{
|
||||
// Global terminal positions
|
||||
int tx = ax + x;
|
||||
|
@ -1071,7 +1071,7 @@ void FVTerm::putArea (const FPoint& pos, const FTermArea* area)
|
|||
if ( length < 1 )
|
||||
return;
|
||||
|
||||
for (int y{0}; y < y_end; y++) // line loop
|
||||
for (auto y{0}; y < y_end; y++) // line loop
|
||||
{
|
||||
if ( area->changes[y].trans_count == 0 )
|
||||
{
|
||||
|
@ -1083,7 +1083,7 @@ void FVTerm::putArea (const FPoint& pos, const FTermArea* area)
|
|||
else
|
||||
{
|
||||
// Line has one or more transparent characters
|
||||
for (int x{0}; x < length; x++) // column loop
|
||||
for (auto x{0}; x < length; x++) // column loop
|
||||
{
|
||||
const int cx = ax + x;
|
||||
const int cy = ay + y;
|
||||
|
@ -1118,7 +1118,7 @@ void FVTerm::scrollAreaForward (FTermArea* area) const
|
|||
const int total_width = area->width + area->right_shadow;
|
||||
const int y_max = area->height - 1;
|
||||
|
||||
for (int y{0}; y < y_max; y++)
|
||||
for (auto y{0}; y < y_max; y++)
|
||||
{
|
||||
const int pos1 = y * total_width;
|
||||
const int pos2 = (y + 1) * total_width;
|
||||
|
@ -1148,7 +1148,7 @@ void FVTerm::scrollAreaForward (FTermArea* area) const
|
|||
putArea (FPoint{1, 1}, vdesktop);
|
||||
|
||||
// avoid update lines from 0 to (y_max - 1)
|
||||
for (int y{0}; y < y_max; y++)
|
||||
for (auto y{0}; y < y_max; y++)
|
||||
{
|
||||
area->changes[y].xmin = uInt(area->width - 1);
|
||||
area->changes[y].xmax = 0;
|
||||
|
@ -1171,7 +1171,7 @@ void FVTerm::scrollAreaReverse (FTermArea* area) const
|
|||
const int total_width = area->width + area->right_shadow;
|
||||
const int y_max = area->height - 1;
|
||||
|
||||
for (int y = y_max; y > 0; y--)
|
||||
for (auto y = y_max; y > 0; y--)
|
||||
{
|
||||
const int pos1 = (y - 1) * total_width;
|
||||
const int pos2 = y * total_width;
|
||||
|
@ -1200,7 +1200,7 @@ void FVTerm::scrollAreaReverse (FTermArea* area) const
|
|||
putArea (FPoint{1, 1}, vdesktop);
|
||||
|
||||
// avoid update lines from 1 to y_max
|
||||
for (int y{1}; y <= y_max; y++)
|
||||
for (auto y{1}; y <= y_max; y++)
|
||||
{
|
||||
area->changes[y].xmin = uInt(area->width - 1);
|
||||
area->changes[y].xmax = 0;
|
||||
|
@ -1235,7 +1235,7 @@ void FVTerm::clearArea (FTermArea* area, int fillchar) const
|
|||
else
|
||||
clearAreaWithShadow(area, nc);
|
||||
|
||||
for (int i{0}; i < area->height; i++)
|
||||
for (auto i{0}; i < area->height; i++)
|
||||
{
|
||||
area->changes[i].xmin = 0;
|
||||
area->changes[i].xmax = w - 1;
|
||||
|
@ -1250,7 +1250,7 @@ void FVTerm::clearArea (FTermArea* area, int fillchar) const
|
|||
area->changes[i].trans_count = 0;
|
||||
}
|
||||
|
||||
for (int i{0}; i < area->bottom_shadow; i++)
|
||||
for (auto i{0}; i < area->bottom_shadow; i++)
|
||||
{
|
||||
const int y = area->height + i;
|
||||
area->changes[y].xmin = 0;
|
||||
|
@ -2034,8 +2034,7 @@ bool FVTerm::clearTerm (int fillchar) const
|
|||
const auto& cb = TCAP(fc::t_clr_eol);
|
||||
const bool ut = FTermcap::background_color_erase;
|
||||
const bool normal = FTerm::isNormal (next_attribute);
|
||||
auto next = &next_attribute;
|
||||
appendAttributes(next);
|
||||
appendAttributes (next_attribute);
|
||||
|
||||
if ( ! ( (cl || cd || cb) && (normal || ut) )
|
||||
|| fillchar != ' ' )
|
||||
|
@ -2058,7 +2057,7 @@ bool FVTerm::clearTerm (int fillchar) const
|
|||
{
|
||||
term_pos->setPoint(-1, -1);
|
||||
|
||||
for (int i{0}; i < int(FTerm::getLineNumber()); i++)
|
||||
for (auto i{0}; i < int(FTerm::getLineNumber()); i++)
|
||||
{
|
||||
setTermXY (0, i);
|
||||
appendOutputBuffer (cb);
|
||||
|
@ -2089,7 +2088,7 @@ bool FVTerm::clearFullArea (const FTermArea* area, FChar& nc) const
|
|||
}
|
||||
else
|
||||
{
|
||||
for (int i{0}; i < vdesktop->height; i++)
|
||||
for (auto i{0}; i < vdesktop->height; i++)
|
||||
{
|
||||
vdesktop->changes[i].xmin = 0;
|
||||
vdesktop->changes[i].xmax = uInt(vdesktop->width) - 1;
|
||||
|
@ -2109,7 +2108,7 @@ void FVTerm::clearAreaWithShadow (const FTermArea* area, const FChar& nc)
|
|||
const int total_width = area->width + area->right_shadow;
|
||||
t_char.attr.bit.transparent = true;
|
||||
|
||||
for (int y{0}; y < area->height; y++)
|
||||
for (auto y{0}; y < area->height; y++)
|
||||
{
|
||||
const int pos = y * total_width;
|
||||
// Clear area
|
||||
|
@ -2119,7 +2118,7 @@ void FVTerm::clearAreaWithShadow (const FTermArea* area, const FChar& nc)
|
|||
}
|
||||
|
||||
// Make bottom shadow transparent
|
||||
for (int y{0}; y < area->bottom_shadow; y++)
|
||||
for (auto y{0}; y < area->bottom_shadow; y++)
|
||||
{
|
||||
const int pos = total_width * (y + area->height);
|
||||
std::fill_n (&area->data[pos], total_width, t_char);
|
||||
|
@ -2132,7 +2131,7 @@ bool FVTerm::canClearToEOL (uInt xmin, uInt y)
|
|||
// Is the line from xmin to the end of the line blank?
|
||||
// => clear to end of line
|
||||
|
||||
FTermArea*& vt = vterm;
|
||||
auto& vt = vterm;
|
||||
const auto& ce = TCAP(fc::t_clr_eol);
|
||||
const auto& min_char = vt->data[y * uInt(vt->width) + xmin];
|
||||
|
||||
|
@ -2167,7 +2166,7 @@ bool FVTerm::canClearLeadingWS (uInt& xmin, uInt y)
|
|||
// Line has leading whitespace
|
||||
// => clear from xmin to beginning of line
|
||||
|
||||
FTermArea*& vt = vterm;
|
||||
auto& vt = vterm;
|
||||
const auto& cb = TCAP(fc::t_clr_bol);
|
||||
const auto& first_char = vt->data[y * uInt(vt->width)];
|
||||
|
||||
|
@ -2205,7 +2204,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y)
|
|||
// Line has trailing whitespace
|
||||
// => clear from xmax to end of line
|
||||
|
||||
FTermArea*& vt = vterm;
|
||||
auto& vt = vterm;
|
||||
const auto& ce = TCAP(fc::t_clr_eol);
|
||||
const auto& last_char = vt->data[(y + 1) * uInt(vt->width) - 1];
|
||||
|
||||
|
@ -2242,7 +2241,7 @@ bool FVTerm::skipUnchangedCharacters (uInt& x, uInt xmax, uInt y) const
|
|||
{
|
||||
// Skip characters without changes if it is faster than redrawing
|
||||
|
||||
FTermArea*& vt = vterm;
|
||||
auto& vt = vterm;
|
||||
auto print_char = &vt->data[y * uInt(vt->width) + x];
|
||||
print_char->attr.bit.printed = true;
|
||||
|
||||
|
@ -2277,11 +2276,11 @@ void FVTerm::printRange ( uInt xmin, uInt xmax, uInt y
|
|||
{
|
||||
for (uInt x = xmin; x <= xmax; x++)
|
||||
{
|
||||
FTermArea*& vt = vterm;
|
||||
auto& vt = vterm;
|
||||
const auto& ec = TCAP(fc::t_erase_chars);
|
||||
const auto& rp = TCAP(fc::t_repeat_char);
|
||||
auto print_char = &vt->data[y * uInt(vt->width) + x];
|
||||
print_char->attr.bit.printed = true;
|
||||
auto& print_char = vt->data[y * uInt(vt->width) + x];
|
||||
print_char.attr.bit.printed = true;
|
||||
replaceNonPrintableFullwidth (x, print_char);
|
||||
|
||||
// skip character with no changes
|
||||
|
@ -2289,7 +2288,7 @@ void FVTerm::printRange ( uInt xmin, uInt xmax, uInt y
|
|||
continue;
|
||||
|
||||
// Erase character
|
||||
if ( ec && print_char->ch == ' ' )
|
||||
if ( ec && print_char.ch == ' ' )
|
||||
{
|
||||
exit_state erase_state = \
|
||||
eraseCharacters(x, xmax, y, draw_trailing_ws);
|
||||
|
@ -2311,36 +2310,36 @@ void FVTerm::printRange ( uInt xmin, uInt xmax, uInt y
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::replaceNonPrintableFullwidth ( uInt x
|
||||
, FChar*& print_char ) const
|
||||
, FChar& print_char ) const
|
||||
{
|
||||
// Replace non-printable full-width characters that are truncated
|
||||
// from the right or left terminal side
|
||||
|
||||
if ( x == 0 && isFullWidthPaddingChar(*print_char) )
|
||||
if ( x == 0 && isFullWidthPaddingChar(print_char) )
|
||||
{
|
||||
print_char->ch = fc::SingleLeftAngleQuotationMark; // ‹
|
||||
print_char->attr.bit.fullwidth_padding = false;
|
||||
print_char.ch = fc::SingleLeftAngleQuotationMark; // ‹
|
||||
print_char.attr.bit.fullwidth_padding = false;
|
||||
}
|
||||
else if ( x == uInt(vterm->width - 1)
|
||||
&& isFullWidthChar(*print_char) )
|
||||
&& isFullWidthChar(print_char) )
|
||||
{
|
||||
print_char->ch = fc::SingleRightAngleQuotationMark; // ›
|
||||
print_char->attr.bit.char_width = 1;
|
||||
print_char.ch = fc::SingleRightAngleQuotationMark; // ›
|
||||
print_char.attr.bit.char_width = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max
|
||||
, FChar*& print_char) const
|
||||
, FChar& print_char) const
|
||||
{
|
||||
// General character output on terminal
|
||||
|
||||
if ( x < uInt(vterm->width - 1) && isFullWidthChar(*print_char) )
|
||||
if ( x < uInt(vterm->width - 1) && isFullWidthChar(print_char) )
|
||||
{
|
||||
printFullWidthCharacter (x, y, print_char);
|
||||
}
|
||||
else if ( x > 0 && x < uInt(vterm->width - 1)
|
||||
&& isFullWidthPaddingChar(*print_char) )
|
||||
&& isFullWidthPaddingChar(print_char) )
|
||||
{
|
||||
printFullWidthPaddingCharacter (x, y, print_char);
|
||||
}
|
||||
|
@ -2358,17 +2357,17 @@ void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::printFullWidthCharacter ( uInt& x, uInt y
|
||||
, FChar*& print_char ) const
|
||||
, FChar& print_char ) const
|
||||
{
|
||||
const auto vt = vterm;
|
||||
auto next_char = &vt->data[y * uInt(vt->width) + x + 1];
|
||||
auto& next_char = vt->data[y * uInt(vt->width) + x + 1];
|
||||
|
||||
if ( print_char->attr.byte[0] == next_char->attr.byte[0]
|
||||
&& print_char->attr.byte[1] == next_char->attr.byte[1]
|
||||
&& print_char->fg_color == next_char->fg_color
|
||||
&& print_char->bg_color == next_char->bg_color
|
||||
&& isFullWidthChar(*print_char)
|
||||
&& isFullWidthPaddingChar(*next_char) )
|
||||
if ( print_char.attr.byte[0] == next_char.attr.byte[0]
|
||||
&& print_char.attr.byte[1] == next_char.attr.byte[1]
|
||||
&& print_char.fg_color == next_char.fg_color
|
||||
&& print_char.bg_color == next_char.bg_color
|
||||
&& isFullWidthChar(print_char)
|
||||
&& isFullWidthPaddingChar(next_char) )
|
||||
{
|
||||
// Print a full-width character
|
||||
appendCharacter (print_char);
|
||||
|
@ -2383,7 +2382,7 @@ void FVTerm::printFullWidthCharacter ( uInt& x, uInt y
|
|||
term_pos->x_ref()++;
|
||||
markAsPrinted (x, y);
|
||||
|
||||
if ( isFullWidthPaddingChar(*next_char) )
|
||||
if ( isFullWidthPaddingChar(next_char) )
|
||||
{
|
||||
// Print ellipses for the 2nd full-width character column
|
||||
x++;
|
||||
|
@ -2397,17 +2396,17 @@ void FVTerm::printFullWidthCharacter ( uInt& x, uInt y
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y
|
||||
, FChar*& print_char) const
|
||||
, FChar& print_char) const
|
||||
{
|
||||
const auto vt = vterm;
|
||||
auto prev_char = &vt->data[y * uInt(vt->width) + x - 1];
|
||||
auto& prev_char = vt->data[y * uInt(vt->width) + x - 1];
|
||||
|
||||
if ( print_char->attr.byte[0] == prev_char->attr.byte[0]
|
||||
&& print_char->attr.byte[1] == prev_char->attr.byte[1]
|
||||
&& print_char->fg_color == prev_char->fg_color
|
||||
&& print_char->bg_color == prev_char->bg_color
|
||||
&& isFullWidthChar(*prev_char)
|
||||
&& isFullWidthPaddingChar(*print_char) )
|
||||
if ( print_char.attr.byte[0] == prev_char.attr.byte[0]
|
||||
&& print_char.attr.byte[1] == prev_char.attr.byte[1]
|
||||
&& print_char.fg_color == prev_char.fg_color
|
||||
&& print_char.bg_color == prev_char.bg_color
|
||||
&& isFullWidthChar(prev_char)
|
||||
&& isFullWidthPaddingChar(print_char) )
|
||||
{
|
||||
// Move cursor one character to the left
|
||||
const auto& le = TCAP(fc::t_cursor_left);
|
||||
|
@ -2442,12 +2441,12 @@ void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y
|
||||
, FChar*& print_char ) const
|
||||
, FChar& print_char ) const
|
||||
{
|
||||
const auto vt = vterm;
|
||||
auto prev_char = &vt->data[y * uInt(vt->width) + x - 1];
|
||||
auto& prev_char = vt->data[y * uInt(vt->width) + x - 1];
|
||||
|
||||
if ( isFullWidthChar(*prev_char) && ! isFullWidthPaddingChar(*print_char) )
|
||||
if ( isFullWidthChar(prev_char) && ! isFullWidthPaddingChar(print_char) )
|
||||
{
|
||||
// Move cursor one character to the left
|
||||
const auto& le = TCAP(fc::t_cursor_left);
|
||||
|
@ -2478,9 +2477,9 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y
|
||||
, const FChar* const& print_char ) const
|
||||
, const FChar& print_char ) const
|
||||
{
|
||||
if ( isFullWidthChar(*print_char) ) // full-width character
|
||||
if ( isFullWidthChar(print_char) ) // full-width character
|
||||
{
|
||||
x++; // Skip the following padding character
|
||||
term_pos->x_ref()++;
|
||||
|
@ -2497,7 +2496,6 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y
|
|||
const auto& vt = vterm;
|
||||
const auto& ec = TCAP(fc::t_erase_chars);
|
||||
auto& print_char = vt->data[y * uInt(vt->width) + x];
|
||||
auto print_ch = &print_char;
|
||||
|
||||
if ( ! ec || print_char.ch != ' ' )
|
||||
return not_used;
|
||||
|
@ -2517,7 +2515,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y
|
|||
|
||||
if ( whitespace == 1 )
|
||||
{
|
||||
appendCharacter (print_ch);
|
||||
appendCharacter (print_char);
|
||||
markAsPrinted (x, y);
|
||||
}
|
||||
else
|
||||
|
@ -2528,7 +2526,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y
|
|||
if ( whitespace > erase_char_length + cursor_address_length
|
||||
&& (ut || normal) )
|
||||
{
|
||||
appendAttributes (print_ch);
|
||||
appendAttributes (print_char);
|
||||
appendOutputBuffer (FTermcap::encodeParameter(ec, whitespace, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
|
||||
if ( x + whitespace - 1 < xmax || draw_trailing_ws )
|
||||
|
@ -2544,7 +2542,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y
|
|||
|
||||
for (uInt i{0}; i < whitespace; i++)
|
||||
{
|
||||
appendCharacter (print_ch);
|
||||
appendCharacter (print_char);
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
@ -2562,7 +2560,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const
|
|||
|
||||
const auto& vt = vterm;
|
||||
const auto& rp = TCAP(fc::t_repeat_char);
|
||||
auto print_char = &vt->data[y * uInt(vt->width) + x];
|
||||
auto& print_char = vt->data[y * uInt(vt->width) + x];
|
||||
|
||||
if ( ! rp )
|
||||
return not_used;
|
||||
|
@ -2573,7 +2571,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const
|
|||
{
|
||||
const auto& ch = vt->data[y * uInt(vt->width) + i];
|
||||
|
||||
if ( *print_char == ch )
|
||||
if ( print_char == ch )
|
||||
repetitions++;
|
||||
else
|
||||
break;
|
||||
|
@ -2589,12 +2587,12 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const
|
|||
const uInt start_pos = x;
|
||||
|
||||
if ( repetitions > repeat_char_length
|
||||
&& print_char->ch < 128 )
|
||||
&& print_char.ch < 128 )
|
||||
{
|
||||
newFontChanges (print_char);
|
||||
charsetChanges (print_char);
|
||||
appendAttributes (print_char);
|
||||
appendOutputBuffer (FTermcap::encodeParameter(rp, print_char->ch, repetitions, 0, 0, 0, 0, 0, 0, 0));
|
||||
appendOutputBuffer (FTermcap::encodeParameter(rp, print_char.ch, repetitions, 0, 0, 0, 0, 0, 0, 0));
|
||||
term_pos->x_ref() += int(repetitions);
|
||||
x = x + repetitions - 1;
|
||||
}
|
||||
|
@ -2768,9 +2766,9 @@ bool FVTerm::updateTerminalLine (uInt y) const
|
|||
bool draw_leading_ws = false;
|
||||
bool draw_trailing_ws = false;
|
||||
const auto& ce = TCAP(fc::t_clr_eol);
|
||||
auto first_char = &vt->data[y * uInt(vt->width)];
|
||||
auto last_char = &vt->data[(y + 1) * uInt(vt->width) - 1];
|
||||
auto min_char = &vt->data[y * uInt(vt->width) + xmin];
|
||||
auto& first_char = vt->data[y * uInt(vt->width)];
|
||||
auto& last_char = vt->data[(y + 1) * uInt(vt->width) - 1];
|
||||
auto& min_char = vt->data[y * uInt(vt->width) + xmin];
|
||||
|
||||
// Clear rest of line
|
||||
bool is_eol_clean = canClearToEOL (xmin, y);
|
||||
|
@ -2912,26 +2910,26 @@ inline void FVTerm::markAsPrinted (uInt from, uInt to, uInt line)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::newFontChanges (FChar*& next_char)
|
||||
inline void FVTerm::newFontChanges (FChar& next_char)
|
||||
{
|
||||
// NewFont special cases
|
||||
if ( ! FTerm::isNewFont() )
|
||||
return;
|
||||
|
||||
if ( next_char->ch == fc::LowerHalfBlock )
|
||||
if ( next_char.ch == fc::LowerHalfBlock )
|
||||
{
|
||||
next_char->ch = fc::UpperHalfBlock;
|
||||
next_char->attr.bit.reverse = true;
|
||||
next_char.ch = fc::UpperHalfBlock;
|
||||
next_char.attr.bit.reverse = true;
|
||||
}
|
||||
else if ( isReverseNewFontchar(next_char->ch) )
|
||||
next_char->attr.bit.reverse = true; // Show in reverse video
|
||||
else if ( isReverseNewFontchar(next_char.ch) )
|
||||
next_char.attr.bit.reverse = true; // Show in reverse video
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::charsetChanges (FChar*& next_char)
|
||||
inline void FVTerm::charsetChanges (FChar& next_char)
|
||||
{
|
||||
const wchar_t& ch = next_char->ch;
|
||||
next_char->encoded_char = ch;
|
||||
const wchar_t& ch = next_char.ch;
|
||||
next_char.encoded_char = ch;
|
||||
|
||||
if ( FTerm::getEncoding() == fc::UTF8 )
|
||||
return;
|
||||
|
@ -2943,17 +2941,17 @@ inline void FVTerm::charsetChanges (FChar*& next_char)
|
|||
|
||||
if ( ch_enc == 0 )
|
||||
{
|
||||
next_char->encoded_char = wchar_t(FTerm::charEncode(ch, fc::ASCII));
|
||||
next_char.encoded_char = wchar_t(FTerm::charEncode(ch, fc::ASCII));
|
||||
return;
|
||||
}
|
||||
|
||||
next_char->encoded_char = ch_enc;
|
||||
next_char.encoded_char = ch_enc;
|
||||
|
||||
if ( FTerm::getEncoding() == fc::VT100 )
|
||||
next_char->attr.bit.alt_charset = true;
|
||||
next_char.attr.bit.alt_charset = true;
|
||||
else if ( FTerm::getEncoding() == fc::PC )
|
||||
{
|
||||
next_char->attr.bit.pc_charset = true;
|
||||
next_char.attr.bit.pc_charset = true;
|
||||
|
||||
if ( FTerm::isPuttyTerminal() )
|
||||
return;
|
||||
|
@ -2961,18 +2959,18 @@ inline void FVTerm::charsetChanges (FChar*& next_char)
|
|||
if ( FTerm::isXTerminal() && ch_enc < 0x20 ) // Character 0x00..0x1f
|
||||
{
|
||||
if ( FTerm::hasUTF8() )
|
||||
next_char->encoded_char = int(FTerm::charEncode(ch, fc::ASCII));
|
||||
next_char.encoded_char = int(FTerm::charEncode(ch, fc::ASCII));
|
||||
else
|
||||
{
|
||||
next_char->encoded_char += 0x5f;
|
||||
next_char->attr.bit.alt_charset = true;
|
||||
next_char.encoded_char += 0x5f;
|
||||
next_char.attr.bit.alt_charset = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::appendCharacter (FChar*& next_char) const
|
||||
inline void FVTerm::appendCharacter (FChar& next_char) const
|
||||
{
|
||||
const int term_width = vterm->width - 1;
|
||||
const int term_height = vterm->height - 1;
|
||||
|
@ -2987,41 +2985,39 @@ inline void FVTerm::appendCharacter (FChar*& next_char) const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::appendChar (FChar*& next_char) const
|
||||
inline void FVTerm::appendChar (FChar& next_char) const
|
||||
{
|
||||
newFontChanges (next_char);
|
||||
charsetChanges (next_char);
|
||||
appendAttributes (next_char);
|
||||
characterFilter (next_char);
|
||||
appendOutputBuffer (next_char->encoded_char);
|
||||
appendOutputBuffer (next_char.encoded_char);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::appendAttributes (FChar*& next_attr) const
|
||||
inline void FVTerm::appendAttributes (FChar& next_attr) const
|
||||
{
|
||||
auto term_attr = &term_attribute;
|
||||
|
||||
// generate attribute string for the next character
|
||||
const char* attr_str = FTerm::changeAttribute (term_attr, next_attr);
|
||||
const auto attr_str = FTerm::changeAttribute (term_attribute, next_attr);
|
||||
|
||||
if ( attr_str )
|
||||
appendOutputBuffer (attr_str);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int FVTerm::appendLowerRight (FChar*& screen_char) const
|
||||
void FVTerm::appendLowerRight (FChar& last_char) const
|
||||
{
|
||||
const auto& SA = TCAP(fc::t_enter_am_mode);
|
||||
const auto& RA = TCAP(fc::t_exit_am_mode);
|
||||
|
||||
if ( ! FTermcap::automatic_right_margin )
|
||||
{
|
||||
appendChar (screen_char);
|
||||
appendChar (last_char);
|
||||
}
|
||||
else if ( SA && RA )
|
||||
{
|
||||
appendOutputBuffer (RA);
|
||||
appendChar (screen_char);
|
||||
appendChar (last_char);
|
||||
appendOutputBuffer (SA);
|
||||
}
|
||||
else
|
||||
|
@ -3035,21 +3031,21 @@ int FVTerm::appendLowerRight (FChar*& screen_char) const
|
|||
const int x = int(FTerm::getColumnNumber()) - 2;
|
||||
const int y = int(FTerm::getLineNumber()) - 1;
|
||||
setTermXY (x, y);
|
||||
appendChar (screen_char);
|
||||
appendChar (last_char);
|
||||
term_pos->x_ref()++;
|
||||
|
||||
setTermXY (x, y);
|
||||
screen_char--;
|
||||
FChar& second_last = *(&last_char - 1);
|
||||
|
||||
if ( IC )
|
||||
{
|
||||
appendOutputBuffer (FTermcap::encodeParameter(IC, 1, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
appendChar (screen_char);
|
||||
appendChar (second_last);
|
||||
}
|
||||
else if ( im && ei )
|
||||
{
|
||||
appendOutputBuffer (im);
|
||||
appendChar (screen_char);
|
||||
appendChar (second_last);
|
||||
|
||||
if ( ip )
|
||||
appendOutputBuffer (ip);
|
||||
|
@ -3059,29 +3055,27 @@ int FVTerm::appendLowerRight (FChar*& screen_char) const
|
|||
else if ( ic )
|
||||
{
|
||||
appendOutputBuffer (ic);
|
||||
appendChar (screen_char);
|
||||
appendChar (second_last);
|
||||
|
||||
if ( ip )
|
||||
appendOutputBuffer (ip);
|
||||
}
|
||||
}
|
||||
|
||||
return screen_char->ch;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::characterFilter (FChar*& next_char)
|
||||
inline void FVTerm::characterFilter (FChar& next_char)
|
||||
{
|
||||
charSubstitution& sub_map = fterm->getCharSubstitutionMap();
|
||||
|
||||
if ( sub_map.find(next_char->encoded_char) != sub_map.end() )
|
||||
next_char->encoded_char = sub_map[next_char->encoded_char];
|
||||
if ( sub_map.find(next_char.encoded_char) != sub_map.end() )
|
||||
next_char.encoded_char = sub_map[next_char.encoded_char];
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::appendOutputBuffer (const std::string& s)
|
||||
{
|
||||
const char* const& c_string = s.c_str();
|
||||
const auto& c_string = s.c_str();
|
||||
FTermcap::paddingPrint (c_string, 1, appendOutputBuffer);
|
||||
}
|
||||
|
||||
|
|
|
@ -1360,7 +1360,7 @@ void FWidget::hideArea (const FSize& size)
|
|||
if ( size.getWidth() == 0 )
|
||||
return;
|
||||
|
||||
for (int y{0}; y < int(size.getHeight()); y++)
|
||||
for (auto y{0}; y < int(size.getHeight()); y++)
|
||||
{
|
||||
print() << FPoint{1, 1 + y} << FString{size.getWidth(), L' '};
|
||||
}
|
||||
|
|
|
@ -451,7 +451,7 @@ inline void drawBox (FWidget* w, const FRect& r)
|
|||
<< FString{r.getWidth() - 2, fc::BoxDrawingsHorizontal} // ─
|
||||
<< fc::BoxDrawingsDownAndLeft; // ┐
|
||||
|
||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
for (auto y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
{
|
||||
w->print() << FPoint{r.getX1(), y}
|
||||
<< fc::BoxDrawingsVertical // │
|
||||
|
@ -475,7 +475,7 @@ inline void drawNewFontBox (FWidget* w, const FRect& r)
|
|||
<< FString{r.getWidth() - 2, fc::NF_border_line_horizontal} // ─
|
||||
<< fc::NF_border_corner_middle_upper_right; // ┐
|
||||
|
||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
for (auto y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
{
|
||||
w->print() << FPoint{r.getX1(), y}
|
||||
<< fc::NF_border_line_vertical // │
|
||||
|
@ -497,7 +497,7 @@ inline void drawNewFontListBox (FWidget* w, const FRect& r)
|
|||
<< FString{r.getWidth() - 2, fc::NF_border_line_horizontal} // ─
|
||||
<< fc::NF_border_line_left_down; // ╷
|
||||
|
||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
for (auto y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
{
|
||||
w->print() << FPoint{r.getX1(), y}
|
||||
<< fc::NF_border_line_left // border left ⎸
|
||||
|
|
|
@ -247,7 +247,7 @@ void FWindow::drawBorder()
|
|||
<< FString{r.getWidth() - 2, fc::NF_border_line_upper} // ¯
|
||||
<< fc::NF_rev_border_corner_upper_right; // ⎤
|
||||
|
||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
for (auto y = r.getY1() + 1; y < r.getY2(); y++)
|
||||
{
|
||||
print() << FPoint{r.getX1(), y}
|
||||
<< fc::NF_border_line_left // border left ⎸
|
||||
|
|
|
@ -189,7 +189,7 @@ class FApplication : public FWidget
|
|||
void sendKeyboardAccelerator();
|
||||
void processKeyboardEvent() const;
|
||||
bool processDialogSwitchAccelerator() const;
|
||||
bool processAccelerator (const FWidget* const&) const;
|
||||
bool processAccelerator (const FWidget&) const;
|
||||
bool getMouseEvent() const;
|
||||
FWidget*& determineClickedWidget();
|
||||
void unsetMoveSizeMode() const;
|
||||
|
|
|
@ -216,7 +216,7 @@ class FComboBox : public FWidget
|
|||
void draw() override;
|
||||
void onePosUp();
|
||||
void onePosDown();
|
||||
void passEventToListWindow (FMouseEvent* const&);
|
||||
void passEventToListWindow (const FMouseEvent&);
|
||||
void processClick() const;
|
||||
void processChanged() const;
|
||||
|
||||
|
|
|
@ -192,9 +192,9 @@ class FMenu : public FWindow, public FMenuList
|
|||
void mouseMoveDeselection (FMenuItem*, MouseStates&);
|
||||
void mouseUpOverBorder();
|
||||
void mouseMoveOverBorder (MouseStates&) const;
|
||||
void passEventToSubMenu (FMouseEvent* const&);
|
||||
void passEventToSuperMenu (FMouseEvent* const&);
|
||||
void passEventToMenuBar (FMouseEvent* const&) const;
|
||||
void passEventToSubMenu (const FMouseEvent&);
|
||||
void passEventToSuperMenu (const FMouseEvent&);
|
||||
void passEventToMenuBar (const FMouseEvent&) const;
|
||||
bool containsMenuStructure (const FPoint&);
|
||||
bool containsMenuStructure (int, int);
|
||||
FMenu* superMenuAt (const FPoint&);
|
||||
|
|
|
@ -140,7 +140,7 @@ class FMenuBar : public FWindow, public FMenuList
|
|||
void mouseDownOverList (const FMouseEvent*);
|
||||
void mouseUpOverList (const FMouseEvent*);
|
||||
void mouseMoveOverList (const FMouseEvent*);
|
||||
void passEventToMenu (const FMouseEvent* const&) const;
|
||||
void passEventToMenu (const FMouseEvent&) const;
|
||||
void leaveMenuBar();
|
||||
|
||||
// Data members
|
||||
|
|
|
@ -152,12 +152,12 @@ class FOptiAttr final
|
|||
void set_orig_orig_colors (const char[]);
|
||||
|
||||
// Inquiry
|
||||
static bool isNormal (const FChar* const&);
|
||||
static bool isNormal (const FChar&);
|
||||
|
||||
// Methods
|
||||
void initialize();
|
||||
static FColor vga2ansi (FColor);
|
||||
const char* changeAttribute (FChar*&, FChar*&);
|
||||
const char* changeAttribute (FChar&, FChar&);
|
||||
|
||||
private:
|
||||
// Typedefs and Enumerations
|
||||
|
@ -202,62 +202,62 @@ class FOptiAttr final
|
|||
};
|
||||
|
||||
// Mutators
|
||||
bool setTermBold (FChar*&);
|
||||
bool unsetTermBold (FChar*&);
|
||||
bool setTermDim (FChar*&);
|
||||
bool unsetTermDim (FChar*&);
|
||||
bool setTermItalic (FChar*&);
|
||||
bool unsetTermItalic (FChar*&);
|
||||
bool setTermUnderline (FChar*&);
|
||||
bool unsetTermUnderline (FChar*&);
|
||||
bool setTermBlink (FChar*&);
|
||||
bool unsetTermBlink (FChar*&);
|
||||
bool setTermReverse (FChar*&);
|
||||
bool unsetTermReverse (FChar*&);
|
||||
bool setTermStandout (FChar*&);
|
||||
bool unsetTermStandout (FChar*&);
|
||||
bool setTermInvisible (FChar*&);
|
||||
bool unsetTermInvisible (FChar*&);
|
||||
bool setTermProtected (FChar*&);
|
||||
bool unsetTermProtected (FChar*&);
|
||||
bool setTermCrossedOut (FChar*&);
|
||||
bool unsetTermCrossedOut (FChar*&);
|
||||
bool setTermDoubleUnderline (FChar*&);
|
||||
bool unsetTermDoubleUnderline (FChar*&);
|
||||
bool setTermAttributes ( FChar*&
|
||||
bool setTermBold (FChar&);
|
||||
bool unsetTermBold (FChar&);
|
||||
bool setTermDim (FChar&);
|
||||
bool unsetTermDim (FChar&);
|
||||
bool setTermItalic (FChar&);
|
||||
bool unsetTermItalic (FChar&);
|
||||
bool setTermUnderline (FChar&);
|
||||
bool unsetTermUnderline (FChar&);
|
||||
bool setTermBlink (FChar&);
|
||||
bool unsetTermBlink (FChar&);
|
||||
bool setTermReverse (FChar&);
|
||||
bool unsetTermReverse (FChar&);
|
||||
bool setTermStandout (FChar&);
|
||||
bool unsetTermStandout (FChar&);
|
||||
bool setTermInvisible (FChar&);
|
||||
bool unsetTermInvisible (FChar&);
|
||||
bool setTermProtected (FChar&);
|
||||
bool unsetTermProtected (FChar&);
|
||||
bool setTermCrossedOut (FChar&);
|
||||
bool unsetTermCrossedOut (FChar&);
|
||||
bool setTermDoubleUnderline (FChar&);
|
||||
bool unsetTermDoubleUnderline (FChar&);
|
||||
bool setTermAttributes ( FChar&
|
||||
, bool, bool, bool
|
||||
, bool, bool, bool
|
||||
, bool, bool, bool );
|
||||
bool unsetTermAttributes (FChar*&);
|
||||
bool setTermAltCharset (FChar*&);
|
||||
bool unsetTermAltCharset (FChar*&);
|
||||
bool setTermPCcharset (FChar*&);
|
||||
bool unsetTermPCcharset (FChar*&);
|
||||
bool setTermDefaultColor (FChar*&);
|
||||
void setAttributesOn (FChar*&);
|
||||
void setAttributesOff (FChar*&);
|
||||
bool unsetTermAttributes (FChar&);
|
||||
bool setTermAltCharset (FChar&);
|
||||
bool unsetTermAltCharset (FChar&);
|
||||
bool setTermPCcharset (FChar&);
|
||||
bool unsetTermPCcharset (FChar&);
|
||||
bool setTermDefaultColor (FChar&);
|
||||
void setAttributesOn (FChar&);
|
||||
void setAttributesOff (FChar&);
|
||||
|
||||
// Inquiries
|
||||
static bool hasColor (const FChar* const&);
|
||||
static bool hasAttribute (const FChar* const&);
|
||||
static bool hasNoAttribute (const FChar* const&);
|
||||
static bool hasColor (const FChar&);
|
||||
static bool hasAttribute (const FChar&);
|
||||
static bool hasNoAttribute (const FChar&);
|
||||
|
||||
// Methods
|
||||
bool hasColorChanged (const FChar* const&, const FChar* const&) const;
|
||||
void resetColor (FChar*&) const;
|
||||
void prevent_no_color_video_attributes (FChar*&, bool = false);
|
||||
void deactivateAttributes (FChar*&, FChar*&);
|
||||
void changeAttributeSGR (FChar*&, FChar*&);
|
||||
void changeAttributeSeparately (FChar*&, FChar*&);
|
||||
void change_color (FChar*&, FChar*&);
|
||||
void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&);
|
||||
void change_current_color (const FChar* const&, FColor, FColor);
|
||||
void resetAttribute (FChar*&) const;
|
||||
void reset (FChar*&) const;
|
||||
bool hasColorChanged (const FChar&, const FChar&) const;
|
||||
void resetColor (FChar&) const;
|
||||
void prevent_no_color_video_attributes (FChar&, bool = false);
|
||||
void deactivateAttributes (FChar&, FChar&);
|
||||
void changeAttributeSGR (FChar&, FChar&);
|
||||
void changeAttributeSeparately (FChar&, FChar&);
|
||||
void change_color (FChar&, FChar&);
|
||||
void change_to_default_color (FChar&, FChar&, FColor&, FColor&);
|
||||
void change_current_color (const FChar&, FColor, FColor);
|
||||
void resetAttribute (FChar&) const;
|
||||
void reset (FChar&) const;
|
||||
bool caused_reset_attributes (const char[], uChar = all_tests) const;
|
||||
bool hasCharsetEquivalence() const;
|
||||
void detectSwitchOn (const FChar* const&, const FChar* const&);
|
||||
void detectSwitchOff (const FChar* const&, const FChar* const&);
|
||||
void detectSwitchOn (const FChar&, const FChar&);
|
||||
void detectSwitchOff (const FChar&, const FChar&);
|
||||
bool switchOn() const;
|
||||
bool switchOff() const;
|
||||
bool append_sequence (const char[]);
|
||||
|
|
|
@ -304,7 +304,7 @@ class FTerm final
|
|||
|
||||
void initTerminal();
|
||||
static void initScreenSettings();
|
||||
static const char* changeAttribute (FChar*&, FChar*&);
|
||||
static const char* changeAttribute (FChar&, FChar&);
|
||||
static void changeTermSizeFinished();
|
||||
|
||||
private:
|
||||
|
|
|
@ -387,12 +387,12 @@ class FVTerm
|
|||
static bool canClearTrailingWS (uInt&, uInt);
|
||||
bool skipUnchangedCharacters (uInt&, uInt, uInt) const;
|
||||
void printRange (uInt, uInt, uInt, bool) const;
|
||||
void replaceNonPrintableFullwidth (uInt, FChar*&) const;
|
||||
void printCharacter (uInt&, uInt, bool, FChar*&) const;
|
||||
void printFullWidthCharacter (uInt&, uInt, FChar*&) const;
|
||||
void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&) const;
|
||||
void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&) const;
|
||||
void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const;
|
||||
void replaceNonPrintableFullwidth (uInt, FChar&) const;
|
||||
void printCharacter (uInt&, uInt, bool, FChar&) const;
|
||||
void printFullWidthCharacter (uInt&, uInt, FChar&) const;
|
||||
void printFullWidthPaddingCharacter (uInt&, uInt, FChar&) const;
|
||||
void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar&) const;
|
||||
void skipPaddingCharacter (uInt&, uInt, const FChar&) const;
|
||||
exit_state eraseCharacters (uInt&, uInt, uInt, bool) const;
|
||||
exit_state repeatCharacter (uInt&, uInt, uInt) const;
|
||||
bool isFullWidthChar (const FChar&) const;
|
||||
|
@ -412,13 +412,13 @@ class FVTerm
|
|||
static bool hasPendingUpdates (const FTermArea*);
|
||||
static void markAsPrinted (uInt, uInt);
|
||||
static void markAsPrinted (uInt, uInt, uInt);
|
||||
static void newFontChanges (FChar*&);
|
||||
static void charsetChanges (FChar*&);
|
||||
void appendCharacter (FChar*&) const;
|
||||
void appendChar (FChar*&) const;
|
||||
void appendAttributes (FChar*&) const;
|
||||
int appendLowerRight (FChar*&) const;
|
||||
static void characterFilter (FChar*&);
|
||||
static void newFontChanges (FChar&);
|
||||
static void charsetChanges (FChar&);
|
||||
void appendCharacter (FChar&) const;
|
||||
void appendChar (FChar&) const;
|
||||
void appendAttributes (FChar&) const;
|
||||
void appendLowerRight (FChar&) const;
|
||||
static void characterFilter (FChar&);
|
||||
static void appendOutputBuffer (const std::string&);
|
||||
static void appendOutputBuffer (const char[]);
|
||||
static int appendOutputBuffer (int);
|
||||
|
|
|
@ -695,7 +695,7 @@ void FObjectTest::performTimerActionTest()
|
|||
CPPUNIT_ASSERT ( t2.getValue() == 0 );
|
||||
finalcut::FTimerEvent timer_ev (finalcut::fc::Timer_Event, 1);
|
||||
|
||||
for (int x = 0; x < 10; x++)
|
||||
for (auto x = 0; x < 10; x++)
|
||||
finalcut::FApplication::sendEvent (&t2, &timer_ev);
|
||||
|
||||
CPPUNIT_ASSERT ( t2.getValue() == 10 );
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2196,7 +2196,7 @@ void FStringTest::controlCodesTest()
|
|||
// C0 control codes (0x01 - 0x1f) - without null (0x00)
|
||||
finalcut::FString c0(0x1f);
|
||||
|
||||
for (int i = 0; i < 0x1f; i++)
|
||||
for (auto i = 0; i < 0x1f; i++)
|
||||
c0[i] = i + 1;
|
||||
|
||||
CPPUNIT_ASSERT ( c0.getLength() == 31 );
|
||||
|
@ -2210,7 +2210,8 @@ void FStringTest::controlCodesTest()
|
|||
// C1 control codes (0x80 - 0x9f)
|
||||
// Used as print characters in some character sets
|
||||
finalcut::FString c1(0x20);
|
||||
for (int i = 0; i <= 0x1f; i++)
|
||||
|
||||
for (auto i = 0; i <= 0x1f; i++)
|
||||
c1[i] = i + 0x80;
|
||||
|
||||
CPPUNIT_ASSERT ( c1.replaceControlCodes() == finalcut::FString(32, L' ') );
|
||||
|
|
Loading…
Reference in New Issue