Further small code improvements

This commit is contained in:
Markus Gans 2020-04-19 20:38:52 +02:00
parent 136b57eac6
commit d08dd8e9f4
68 changed files with 900 additions and 488 deletions

View File

@ -59,9 +59,6 @@ class SegmentView final : public finalcut::FDialog
unsigned char : 1; // padding bit unsigned char : 1; // padding bit
} sevenSegment; } sevenSegment;
// Mutator
void setGeometry (const FRect&, bool = true) override;
// Methods // Methods
void hexEncoding(); void hexEncoding();
void get7Segment (const wchar_t); void get7Segment (const wchar_t);
@ -79,13 +76,15 @@ class SegmentView final : public finalcut::FDialog
SegmentView::SegmentView (finalcut::FWidget* parent) SegmentView::SegmentView (finalcut::FWidget* parent)
: FDialog(parent) : FDialog(parent)
{ {
// Dialog settings
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setText ("Seven-segment display");
FDialog::setGeometry (FPoint(25, 5), FSize(42, 15));
// Set encoding // Set encoding
hexEncoding(); hexEncoding();
// Dialog settings
setText ("Seven-segment display");
setGeometry (FPoint(25, 5), FSize(42, 15));
// Input field // Input field
Input.setGeometry (FPoint(2, 2), FSize(12, 1)); Input.setGeometry (FPoint(2, 2), FSize(12, 1));
Input.setLabelText (L"&Hex value"); Input.setLabelText (L"&Hex value");
@ -116,14 +115,6 @@ SegmentView::SegmentView (finalcut::FWidget* parent)
); );
} }
//----------------------------------------------------------------------
void SegmentView::setGeometry (const FRect& box, bool adjust)
{
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setGeometry (box, adjust);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void SegmentView::hexEncoding() void SegmentView::hexEncoding()
{ {

View File

@ -57,9 +57,6 @@ class Background final : public finalcut::FDialog
Background& operator = (const Background&) = delete; Background& operator = (const Background&) = delete;
private: private:
// Mutator
void setGeometry (const FRect&, bool = true) override;
// Callback method // Callback method
void cb_changed (const finalcut::FWidget*, const FDataPtr); void cb_changed (const finalcut::FWidget*, const FDataPtr);
void cb_choice (const finalcut::FWidget*, const FDataPtr); void cb_choice (const finalcut::FWidget*, const FDataPtr);
@ -98,8 +95,10 @@ Background::Background (finalcut::FWidget* parent)
: FDialog(parent) : FDialog(parent)
{ {
// Dialog settings // Dialog settings
setText ("Background color palette"); // Avoids calling a virtual function from the constructor
setGeometry (FPoint(25, 5), FSize(32, 12)); // (CERT, OOP50-CPP)
FDialog::setText ("Background color palette");
FDialog::setGeometry (FPoint(25, 5), FSize(32, 12));
// Combobox // Combobox
color_choice.setGeometry (FPoint(2, 2), FSize(18, 1)); color_choice.setGeometry (FPoint(2, 2), FSize(18, 1));
@ -175,14 +174,6 @@ Background::Background (finalcut::FWidget* parent)
Background::~Background() // destructor Background::~Background() // destructor
{ } { }
//----------------------------------------------------------------------
void Background::setGeometry (const FRect& box, bool adjust)
{
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setGeometry (box, adjust);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Background::cb_changed (const finalcut::FWidget*, const FDataPtr) void Background::cb_changed (const finalcut::FWidget*, const FDataPtr)
{ {

View File

@ -119,9 +119,6 @@ class Calc final : public finalcut::FDialog
// Destructor // Destructor
~Calc() override; ~Calc() override;
// Mutator
void setGeometry (const FRect&, bool = true) override;
// Event handlers // Event handlers
void onKeyPress (finalcut::FKeyEvent*) override; void onKeyPress (finalcut::FKeyEvent*) override;
void onClose (finalcut::FCloseEvent*) override; void onClose (finalcut::FCloseEvent*) override;
@ -249,11 +246,15 @@ class Calc final : public finalcut::FDialog
Calc::Calc (FWidget* parent) Calc::Calc (FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
// Dialog settings
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setText ("Calculator");
FDialog::setGeometry (FPoint(19, 6), FSize(37, 18));
mapKeyFunctions(); mapKeyFunctions();
clearInfixOperator(); clearInfixOperator();
std::setlocale(LC_NUMERIC, "C"); std::setlocale(LC_NUMERIC, "C");
setText ("Calculator");
setGeometry (FPoint(19, 6), FSize(37, 18));
for (std::size_t key{0}; key < Calc::NUM_OF_BUTTONS; key++) for (std::size_t key{0}; key < Calc::NUM_OF_BUTTONS; key++)
{ {
@ -306,14 +307,6 @@ Calc::Calc (FWidget* parent)
Calc::~Calc() Calc::~Calc()
{ } { }
//----------------------------------------------------------------------
void Calc::setGeometry (const FRect& box, bool adjust)
{
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setGeometry (box, adjust);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::onKeyPress (finalcut::FKeyEvent* ev) void Calc::onKeyPress (finalcut::FKeyEvent* ev)
{ {

View File

@ -55,9 +55,6 @@ class CheckList final : public finalcut::FDialog
// Disable copy assignment operator (=) // Disable copy assignment operator (=)
CheckList& operator = (const CheckList&) = delete; CheckList& operator = (const CheckList&) = delete;
// Mutator
void setGeometry (const FRect&, bool = true) override;
private: private:
// Method // Method
void populate(); void populate();
@ -78,11 +75,14 @@ class CheckList final : public finalcut::FDialog
CheckList::CheckList (finalcut::FWidget* parent) CheckList::CheckList (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
setText (L"Shopping list"); // Dialog settings
setShadow(); // Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setText (L"Shopping list");
const std::size_t nf_offset = ( isNewFont() ) ? 1 : 0; const std::size_t nf_offset = ( isNewFont() ) ? 1 : 0;
setGeometry ( FPoint(int(1 + (parent->getWidth() - 28) / 2), 5) FDialog::setGeometry ( FPoint(int(1 + (parent->getWidth() - 28) / 2), 5)
, FSize(28 + nf_offset, 13) ); , FSize(28 + nf_offset, 13) );
setShadow();
listView.ignorePadding(); listView.ignorePadding();
listView.setGeometry ( FPoint(1 + int(nf_offset), 2) listView.setGeometry ( FPoint(1 + int(nf_offset), 2)
, FSize(getWidth() - nf_offset, getHeight() - 1) ); , FSize(getWidth() - nf_offset, getHeight() - 1) );
@ -118,14 +118,6 @@ CheckList::CheckList (finalcut::FWidget* parent)
CheckList::~CheckList() // destructor CheckList::~CheckList() // destructor
{ } { }
//----------------------------------------------------------------------
void CheckList::setGeometry (const FRect& box, bool adjust)
{
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setGeometry (box, adjust);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void CheckList::populate() void CheckList::populate()
{ {

View File

@ -55,7 +55,7 @@ class Mandelbrot final : public finalcut::FDialog
Mandelbrot::Mandelbrot (finalcut::FWidget* parent) Mandelbrot::Mandelbrot (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
setText ("Mandelbrot set"); FDialog::setText ("Mandelbrot set");
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -82,8 +82,8 @@ ColorChooser::ColorChooser (finalcut::FWidget* parent)
{ {
const FColor fg = parent->getForegroundColor(); const FColor fg = parent->getForegroundColor();
const FColor bg = parent->getBackgroundColor(); const FColor bg = parent->getBackgroundColor();
setForegroundColor(fg); FWidget::setForegroundColor(fg);
setBackgroundColor(bg); FWidget::setBackgroundColor(bg);
headline.setForegroundColor(fg); headline.setForegroundColor(fg);
headline.setBackgroundColor(bg); headline.setBackgroundColor(bg);
} }
@ -236,8 +236,8 @@ Brushes::Brushes (finalcut::FWidget* parent)
{ {
const FColor fg = parent->getForegroundColor(); const FColor fg = parent->getForegroundColor();
const FColor bg = parent->getBackgroundColor(); const FColor bg = parent->getBackgroundColor();
setForegroundColor(fg); FWidget::setForegroundColor(fg);
setBackgroundColor(bg); FWidget::setBackgroundColor(bg);
headline.setForegroundColor(fg); headline.setForegroundColor(fg);
headline.setBackgroundColor(bg); headline.setBackgroundColor(bg);
} }
@ -381,7 +381,7 @@ class MouseDraw final : public finalcut::FDialog
MouseDraw::MouseDraw (finalcut::FWidget* parent) MouseDraw::MouseDraw (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
setText ("Drawing with the mouse"); FDialog::setText ("Drawing with the mouse");
c_chooser.setPos (FPoint(1, 1)); c_chooser.setPos (FPoint(1, 1));
c_chooser.addCallback c_chooser.addCallback
( (

View File

@ -84,7 +84,7 @@ RotoZoomer::RotoZoomer (finalcut::FWidget* parent, bool b, int l)
, benchmark(b) , benchmark(b)
, loops(l) , loops(l)
{ {
setText ("Rotozoomer effect"); FDialog::setText ("Rotozoomer effect");
int h{0}; int h{0};

View File

@ -216,8 +216,8 @@ class Scrollviewdemo final : public finalcut::FDialog
Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent) Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
setGeometry (FPoint(16, 3), FSize(50, 19)); FDialog::setGeometry (FPoint(16, 3), FSize(50, 19));
setText ("Scrolling viewport example"); FDialog::setText ("Scrolling viewport example");
// The scrolling viewport widget // The scrolling viewport widget
sview.setGeometry(FPoint(3, 2), FSize(44, 12)); sview.setGeometry(FPoint(3, 2), FSize(44, 12));

View File

@ -222,15 +222,15 @@ void streamToInterger()
finalcut::FString("-321") >> stream_int; finalcut::FString("-321") >> stream_int;
std::cout << "stream out: " << stream_int << std::endl; std::cout << "stream out: " << stream_int << std::endl;
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::overflow_error& ex) catch (const std::overflow_error& ex)
{ {
std::cerr << "overflow: " << ex.what() << std::endl; std::cerr << "overflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }
@ -246,15 +246,15 @@ void streamToUnsignedInterger()
finalcut::FString("123") >> stream_uint; finalcut::FString("123") >> stream_uint;
std::cout << "stream out: " << stream_uint << std::endl; std::cout << "stream out: " << stream_uint << std::endl;
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::overflow_error& ex) catch (const std::overflow_error& ex)
{ {
std::cerr << "overflow: " << ex.what() << std::endl; std::cerr << "overflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }
@ -270,11 +270,15 @@ void streamToDouble()
finalcut::FString("0.123456e+2") >> stream_double; finalcut::FString("0.123456e+2") >> stream_double;
std::cout << "stream out: " << stream_double << std::endl; std::cout << "stream out: " << stream_double << std::endl;
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::overflow_error& ex)
{
std::cerr << "overflow: " << ex.what() << std::endl;
}
catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }
@ -290,11 +294,15 @@ void streamToFloat()
finalcut::FString("0.123e-3") >> stream_float; finalcut::FString("0.123e-3") >> stream_float;
std::cout << "stream out: " << stream_float << std::endl; std::cout << "stream out: " << stream_float << std::endl;
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::overflow_error& ex)
{
std::cerr << "overflow: " << ex.what() << std::endl;
}
catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }
@ -486,11 +494,15 @@ void convertToNumberExample()
const uLong ulong_num = finalcut::FString("123456789").toULong(); const uLong ulong_num = finalcut::FString("123456789").toULong();
std::cout << " toULong: " << ulong_num << std::endl; std::cout << " toULong: " << ulong_num << std::endl;
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::overflow_error& ex)
{
std::cerr << "overflow: " << ex.what() << std::endl;
}
catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }
@ -501,11 +513,15 @@ void convertToNumberExample()
const long long_num = finalcut::FString("-9876543210").toLong(); const long long_num = finalcut::FString("-9876543210").toLong();
std::cout << " toLong: " << long_num << std::endl; std::cout << " toLong: " << long_num << std::endl;
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::overflow_error& ex)
{
std::cerr << "overflow: " << ex.what() << std::endl;
}
catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }
@ -522,11 +538,15 @@ void convertToNumberExample()
<< double_num << std::endl; << double_num << std::endl;
std::cout.flags(save_flags); std::cout.flags(save_flags);
} }
catch (const std::invalid_argument& ex) catch (const std::underflow_error& ex)
{ {
std::cerr << "Invalid argument: " << ex.what() << std::endl; std::cerr << "underflow: " << ex.what() << std::endl;
} }
catch (const std::exception& ex) catch (const std::overflow_error& ex)
{
std::cerr << "overflow: " << ex.what() << std::endl;
}
catch (const std::invalid_argument& ex)
{ {
std::cerr << "Arithmetic error: " << ex.what() << std::endl; std::cerr << "Arithmetic error: " << ex.what() << std::endl;
} }

View File

@ -66,7 +66,7 @@ class AttribDlg final : public finalcut::FDialog
void adjustSize() override; void adjustSize() override;
// Data members // Data members
FColor bgcolor; FColor bgcolor{getFWidgetColors().label_bg};
finalcut::FButton next_button{"&Next >", this}; finalcut::FButton next_button{"&Next >", this};
finalcut::FButton back_button{"< &Back", this}; finalcut::FButton back_button{"< &Back", this};
}; };
@ -74,9 +74,8 @@ class AttribDlg final : public finalcut::FDialog
//---------------------------------------------------------------------- //----------------------------------------------------------------------
AttribDlg::AttribDlg (finalcut::FWidget* parent) AttribDlg::AttribDlg (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
, bgcolor(getFWidgetColors().label_bg)
{ {
setText ( "A terminal attributes test (" FDialog::setText ( "A terminal attributes test ("
+ finalcut::FString(getTermType()) + finalcut::FString(getTermType())
+ ")"); + ")");

View File

@ -189,8 +189,8 @@ class MainWindow final : public finalcut::FDialog
} }
// Data members // Data members
finalcut::FString line1{}; finalcut::FString line1{" .-. .-. .-."};
finalcut::FString line2{}; finalcut::FString line2{"`._.' `._.' `._.' "};
Transparent* transpwin{nullptr}; Transparent* transpwin{nullptr};
Transparent* shadowwin{nullptr}; Transparent* shadowwin{nullptr};
Transparent* ibg{nullptr}; Transparent* ibg{nullptr};
@ -202,9 +202,6 @@ class MainWindow final : public finalcut::FDialog
MainWindow::MainWindow (finalcut::FWidget* parent) MainWindow::MainWindow (finalcut::FWidget* parent)
: FDialog(parent) : FDialog(parent)
{ {
line1 = " .-. .-. .-.";
line2 = "`._.' `._.' `._.' ";
// The memory allocation for the following three sub windows occurs // The memory allocation for the following three sub windows occurs
// with the operator new. The lifetime of the generated widget // with the operator new. The lifetime of the generated widget
// is managed by the parent object (this). The operator delete // is managed by the parent object (this). The operator delete

View File

@ -57,9 +57,6 @@ class ProgressDialog final : public finalcut::FDialog
// Disable copy assignment operator (=) // Disable copy assignment operator (=)
ProgressDialog& operator = (const ProgressDialog&) = delete; ProgressDialog& operator = (const ProgressDialog&) = delete;
// Mutator
void setGeometry (const FRect&, bool = true) override;
private: private:
// Event handlers // Event handlers
void onShow (finalcut::FShowEvent*) override; void onShow (finalcut::FShowEvent*) override;
@ -81,9 +78,12 @@ class ProgressDialog final : public finalcut::FDialog
ProgressDialog::ProgressDialog (finalcut::FWidget* parent) ProgressDialog::ProgressDialog (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
setGeometry ( FPoint(int((getParentWidget()->getWidth() - 40) / 2), 7) // Dialog settings
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setGeometry ( FPoint(int((getParentWidget()->getWidth() - 40) / 2), 7)
, FSize(40, 10) ); , FSize(40, 10) );
setText("Progress bar"); FDialog::setText("Progress bar");
//setModal(); //setModal();
reset.setText("&Reset"); reset.setText("&Reset");
@ -132,14 +132,6 @@ ProgressDialog::~ProgressDialog() // destructor
delCallback(&reset); delCallback(&reset);
} }
//----------------------------------------------------------------------
void ProgressDialog::setGeometry (const FRect& box, bool adjust)
{
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setGeometry (box, adjust);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void ProgressDialog::onShow (finalcut::FShowEvent*) void ProgressDialog::onShow (finalcut::FShowEvent*)
{ {
@ -150,7 +142,8 @@ void ProgressDialog::onShow (finalcut::FShowEvent*)
void ProgressDialog::onTimer (finalcut::FTimerEvent*) void ProgressDialog::onTimer (finalcut::FTimerEvent*)
{ {
auto p = progressBar.getPercentage(); auto p = progressBar.getPercentage();
progressBar.setPercentage(++p); p++;
progressBar.setPercentage(p);
flush(); flush();
if ( p != 100 ) if ( p != 100 )
@ -182,7 +175,8 @@ void ProgressDialog::cb_reset_bar (const finalcut::FWidget*, const FDataPtr)
void ProgressDialog::cb_more_bar (const finalcut::FWidget*, const FDataPtr) void ProgressDialog::cb_more_bar (const finalcut::FWidget*, const FDataPtr)
{ {
auto p = progressBar.getPercentage(); auto p = progressBar.getPercentage();
progressBar.setPercentage(++p); p++;
progressBar.setPercentage(p);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -279,6 +273,7 @@ class MyDialog final : public finalcut::FDialog
private: private:
// Methods // Methods
void init();
void initMenu(); void initMenu();
void initMenuCallbacks(); void initMenuCallbacks();
void initFileMenuCallbacks(); void initFileMenuCallbacks();
@ -375,6 +370,16 @@ class MyDialog final : public finalcut::FDialog
//---------------------------------------------------------------------- //----------------------------------------------------------------------
MyDialog::MyDialog (finalcut::FWidget* parent) MyDialog::MyDialog (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{
init();
}
//----------------------------------------------------------------------
MyDialog::~MyDialog() // destructor
{ }
//----------------------------------------------------------------------
void MyDialog::init()
{ {
initMenu(); // Initialize the program menu initMenu(); // Initialize the program menu
initMenuCallbacks(); // Initialize program menu callbacks initMenuCallbacks(); // Initialize program menu callbacks
@ -384,10 +389,6 @@ MyDialog::MyDialog (finalcut::FWidget* parent)
initialized = true; initialized = true;
} }
//----------------------------------------------------------------------
MyDialog::~MyDialog() // destructor
{ }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::initMenu() void MyDialog::initMenu()
{ {

View File

@ -75,7 +75,10 @@ class Watch final : public finalcut::FDialog
Watch::Watch (FWidget* parent) Watch::Watch (FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
setText ("Watch"); // Dialog settings
// Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP)
FDialog::setText ("Watch");
const int pw = int(getParentWidget()->getWidth()); const int pw = int(getParentWidget()->getWidth());
FDialog::setGeometry (FPoint(1 + (pw - 22) / 2, 3), FSize(22, 13)); FDialog::setGeometry (FPoint(1 + (pw - 22) / 2, 3), FSize(22, 13));

View File

@ -201,8 +201,8 @@ class Window final : public finalcut::FDialog
void configureDialogButtons(); void configureDialogButtons();
void activateWindow (finalcut::FDialog*); void activateWindow (finalcut::FDialog*);
void adjustSize() override; void adjustSize() override;
void addClickedCallback (finalcut::FWidget*, WindowCallback); template<typename CallbackT>
void addClickedCallback (finalcut::FWidget*, FAppCallback); void addClickedCallback (finalcut::FWidget*, CallbackT);
template <typename IteratorT> template <typename IteratorT>
finalcut::FDialog* getNext (IteratorT); finalcut::FDialog* getNext (IteratorT);
template <typename IteratorT> template <typename IteratorT>
@ -373,22 +373,9 @@ void Window::adjustSize()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template<typename CallbackT>
void Window::addClickedCallback ( finalcut::FWidget* widget void Window::addClickedCallback ( finalcut::FWidget* widget
, WindowCallback call ) , CallbackT call )
{
FMemberCallback callback
= reinterpret_cast<FMemberCallback>(call);
widget->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, callback)
);
}
//----------------------------------------------------------------------
void Window::addClickedCallback ( finalcut::FWidget* widget
, FAppCallback call )
{ {
FMemberCallback callback FMemberCallback callback
= reinterpret_cast<FMemberCallback>(call); = reinterpret_cast<FMemberCallback>(call);

View File

@ -3,4 +3,5 @@ sonar.projectName=finalcut
sonar.projectVersion=0.6.1 sonar.projectVersion=0.6.1
sonar.sources=. sonar.sources=.
sonar.cfamily.build-wrapper-output=bw-output sonar.cfamily.build-wrapper-output=bw-output
sonar.exclusions=src/include/final/fconfig.h

403
src/.depend Normal file
View File

@ -0,0 +1,403 @@
fapplication.o: fapplication.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fevent.h include/final/fmenu.h \
include/final/fwindow.h include/final/fmenulist.h \
include/final/fmenuitem.h include/final/fmenubar.h \
include/final/fmessagebox.h include/final/fdialog.h \
include/final/fwidgetcolors.h include/final/fmouse.h \
include/final/fkeyboard.h include/final/fstartoptions.h \
include/final/fstatusbar.h include/final/ftermdata.h \
include/final/ftermios.h
fbutton.o: fbutton.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fcolorpair.h \
include/final/fevent.h include/final/fbutton.h \
include/final/fwidgetcolors.h include/final/fstatusbar.h \
include/final/fwindow.h
fbuttongroup.o: fbuttongroup.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fbuttongroup.h \
include/final/fscrollview.h include/final/fscrollbar.h \
include/final/fwidgetcolors.h include/final/fcolorpair.h \
include/final/fevent.h include/final/fstatusbar.h \
include/final/fwindow.h include/final/ftogglebutton.h
fcharmap.o: fcharmap.cpp include/final/fc.h include/final/ftypes.h \
include/final/fcharmap.h
fcheckbox.o: fcheckbox.cpp include/final/fc.h include/final/ftypes.h \
include/final/fcheckbox.h include/final/ftogglebutton.h \
include/final/fwidget.h include/final/fvterm.h include/final/fterm.h \
include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h
fcheckmenuitem.o: fcheckmenuitem.cpp include/final/fc.h \
include/final/ftypes.h include/final/fcheckmenuitem.h \
include/final/fmenuitem.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fmenu.h include/final/fwindow.h \
include/final/fmenulist.h
fcombobox.o: fcombobox.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fcolorpair.h \
include/final/fcombobox.h include/final/flineedit.h \
include/final/flistbox.h include/final/fscrollbar.h \
include/final/fwindow.h include/final/fevent.h include/final/flabel.h \
include/final/fwidgetcolors.h include/final/fmouse.h \
include/final/fkeyboard.h include/final/fstatusbar.h
fdialog.o: fdialog.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fcombobox.h \
include/final/flineedit.h include/final/flistbox.h \
include/final/fscrollbar.h include/final/fwindow.h \
include/final/fdialog.h include/final/fmenu.h \
include/final/fmenulist.h include/final/fmenuitem.h \
include/final/fevent.h include/final/fkeyboard.h \
include/final/fstatusbar.h include/final/ftooltip.h \
include/final/fwidgetcolors.h
fdialoglistmenu.o: fdialoglistmenu.cpp include/final/fc.h \
include/final/ftypes.h include/final/fdialoglistmenu.h \
include/final/fmenu.h include/final/fwindow.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fmenulist.h \
include/final/fmenuitem.h
fevent.o: fevent.cpp include/final/fevent.h include/final/fc.h \
include/final/ftypes.h include/final/fpoint.h include/final/fstring.h
ffiledialog.o: ffiledialog.cpp include/final/fevent.h include/final/fc.h \
include/final/ftypes.h include/final/fpoint.h include/final/fstring.h \
include/final/fsystem.h include/final/ffiledialog.h \
include/final/fbutton.h include/final/fwidget.h include/final/fvterm.h \
include/final/fterm.h include/final/fconfig.h include/final/fobject.h \
include/final/frect.h include/final/fsize.h \
include/final/fwidgetcolors.h include/final/fcheckbox.h \
include/final/ftogglebutton.h include/final/fdialog.h \
include/final/fmenu.h include/final/fwindow.h \
include/final/fmenulist.h include/final/fmenuitem.h \
include/final/flineedit.h include/final/flistbox.h \
include/final/fscrollbar.h include/final/fmessagebox.h \
include/final/fstatusbar.h
fkey_map.o: fkey_map.cpp include/final/fc.h include/final/ftypes.h \
include/final/fkey_map.h
fkeyboard.o: fkeyboard.cpp include/final/fkeyboard.h \
include/final/fstring.h include/final/fc.h include/final/ftypes.h \
include/final/fkey_map.h include/final/fobject.h include/final/fterm.h \
include/final/fconfig.h include/final/fsystem.h \
include/final/ftermios.h include/final/ftermlinux.h \
include/final/ftermdata.h include/final/frect.h
flabel.o: flabel.cpp include/final/fapplication.h include/final/ftypes.h \
include/final/fwidget.h include/final/fvterm.h include/final/fc.h \
include/final/fterm.h include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h include/final/fcolorpair.h \
include/final/fevent.h include/final/flabel.h \
include/final/fwidgetcolors.h include/final/fstatusbar.h \
include/final/fwindow.h
flineedit.o: flineedit.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fevent.h include/final/flabel.h \
include/final/fwidgetcolors.h include/final/flineedit.h \
include/final/fstatusbar.h include/final/fwindow.h
flistbox.o: flistbox.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fcolorpair.h \
include/final/fevent.h include/final/flistbox.h \
include/final/fscrollbar.h include/final/fstatusbar.h \
include/final/fwindow.h include/final/fwidgetcolors.h
flistview.o: flistview.cpp include/final/emptyfstring.h \
include/final/fstring.h include/final/fc.h include/final/ftypes.h \
include/final/fapplication.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h include/final/fcolorpair.h \
include/final/fevent.h include/final/flistview.h \
include/final/fscrollbar.h include/final/ftermbuffer.h \
include/final/fstatusbar.h include/final/fwindow.h \
include/final/fwidgetcolors.h
fmenu.o: fmenu.cpp include/final/fapplication.h include/final/ftypes.h \
include/final/fwidget.h include/final/fvterm.h include/final/fc.h \
include/final/fterm.h include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h include/final/fcolorpair.h \
include/final/fdialog.h include/final/fmenu.h include/final/fwindow.h \
include/final/fmenulist.h include/final/fmenuitem.h \
include/final/fevent.h include/final/fmenubar.h \
include/final/fstatusbar.h include/final/fwidgetcolors.h
fmenubar.o: fmenubar.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fevent.h include/final/fmenu.h \
include/final/fwindow.h include/final/fmenulist.h \
include/final/fmenuitem.h include/final/fmenubar.h \
include/final/fstatusbar.h include/final/fwidgetcolors.h
fmenuitem.o: fmenuitem.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fdialog.h include/final/fmenu.h \
include/final/fwindow.h include/final/fmenulist.h \
include/final/fmenuitem.h include/final/fevent.h \
include/final/fmenubar.h include/final/fstatusbar.h
fmenulist.o: fmenulist.cpp include/final/fc.h include/final/ftypes.h \
include/final/fmenulist.h include/final/fmenuitem.h \
include/final/fwidget.h include/final/fvterm.h include/final/fterm.h \
include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h
fmessagebox.o: fmessagebox.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fbutton.h \
include/final/fwidgetcolors.h include/final/fmessagebox.h \
include/final/fdialog.h include/final/fmenu.h include/final/fwindow.h \
include/final/fmenulist.h include/final/fmenuitem.h
fmouse.o: fmouse.cpp include/final/fconfig.h include/final/fkeyboard.h \
include/final/fstring.h include/final/fc.h include/final/ftypes.h \
include/final/fmouse.h include/final/fpoint.h include/final/fobject.h \
include/final/fterm.h include/final/fsystem.h \
include/final/ftermxterminal.h
fobject.o: fobject.cpp include/final/emptyfstring.h \
include/final/fstring.h include/final/fc.h include/final/ftypes.h \
include/final/fevent.h include/final/fpoint.h include/final/fobject.h
foptiattr.o: foptiattr.cpp include/final/fc.h include/final/ftypes.h \
include/final/foptiattr.h include/final/fstring.h \
include/final/sgr_optimizer.h include/final/fstartoptions.h
foptimove.o: foptimove.cpp include/final/fc.h include/final/ftypes.h \
include/final/foptimove.h include/final/fstring.h
fpoint.o: fpoint.cpp include/final/fpoint.h include/final/fstring.h \
include/final/fc.h include/final/ftypes.h
fprogressbar.o: fprogressbar.cpp include/final/fevent.h \
include/final/fc.h include/final/ftypes.h include/final/fpoint.h \
include/final/fstring.h include/final/fcolorpair.h \
include/final/fprogressbar.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/fobject.h include/final/frect.h \
include/final/fsize.h include/final/fwidgetcolors.h
fradiobutton.o: fradiobutton.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fradiobutton.h \
include/final/ftogglebutton.h
fradiomenuitem.o: fradiomenuitem.cpp include/final/fc.h \
include/final/ftypes.h include/final/fradiomenuitem.h \
include/final/fmenuitem.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fmenu.h include/final/fwindow.h \
include/final/fmenulist.h
frect.o: frect.cpp include/final/fpoint.h include/final/fstring.h \
include/final/fc.h include/final/ftypes.h include/final/frect.h \
include/final/fsize.h
fscrollbar.o: fscrollbar.cpp include/final/fevent.h include/final/fc.h \
include/final/ftypes.h include/final/fpoint.h include/final/fstring.h \
include/final/fscrollbar.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/fobject.h include/final/frect.h \
include/final/fsize.h include/final/fwidgetcolors.h
fscrollview.o: fscrollview.cpp include/final/fevent.h include/final/fc.h \
include/final/ftypes.h include/final/fpoint.h include/final/fstring.h \
include/final/fscrollview.h include/final/fscrollbar.h \
include/final/fwidget.h include/final/fvterm.h include/final/fterm.h \
include/final/fconfig.h include/final/fsystem.h \
include/final/fobject.h include/final/frect.h include/final/fsize.h \
include/final/fwindow.h include/final/fwidgetcolors.h
fsize.o: fsize.cpp include/final/fpoint.h include/final/fstring.h \
include/final/fc.h include/final/ftypes.h include/final/fsize.h
fspinbox.o: fspinbox.cpp include/final/fcolorpair.h include/final/fc.h \
include/final/ftypes.h include/final/fstring.h include/final/fevent.h \
include/final/fpoint.h include/final/flabel.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/fobject.h include/final/frect.h \
include/final/fsize.h include/final/fwidgetcolors.h \
include/final/flineedit.h include/final/fspinbox.h \
include/final/fstatusbar.h include/final/fwindow.h
fstartoptions.o: fstartoptions.cpp include/final/fstartoptions.h \
include/final/fc.h include/final/ftypes.h include/final/fstring.h
fstatusbar.o: fstatusbar.cpp include/final/fevent.h include/final/fc.h \
include/final/ftypes.h include/final/fpoint.h include/final/fstring.h \
include/final/fstatusbar.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/fobject.h include/final/frect.h \
include/final/fsize.h include/final/fwindow.h \
include/final/fwidgetcolors.h
fstring.o: fstring.cpp include/final/fstring.h include/final/fc.h \
include/final/ftypes.h
fswitch.o: fswitch.cpp include/final/fcolorpair.h include/final/fc.h \
include/final/ftypes.h include/final/fstring.h include/final/fevent.h \
include/final/fpoint.h include/final/fswitch.h \
include/final/ftogglebutton.h include/final/fwidget.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/fobject.h include/final/frect.h \
include/final/fsize.h include/final/fwidgetcolors.h
fsystem.o: fsystem.cpp include/final/fsystem.h include/final/ftypes.h
fsystemimpl.o: fsystemimpl.cpp include/final/fsystemimpl.h \
include/final/fc.h include/final/ftypes.h include/final/fsystem.h
fterm.o: fterm.cpp include/final/fapplication.h include/final/ftypes.h \
include/final/fwidget.h include/final/fvterm.h include/final/fc.h \
include/final/fterm.h include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h include/final/fcharmap.h \
include/final/fcolorpalette.h include/final/fkey_map.h \
include/final/fkeyboard.h include/final/fmouse.h \
include/final/foptiattr.h include/final/sgr_optimizer.h \
include/final/foptimove.h include/final/fstartoptions.h \
include/final/fsystemimpl.h include/final/ftermbuffer.h \
include/final/ftermcap.h include/final/ftermcapquirks.h \
include/final/ftermdata.h include/final/ftermdebugdata.h \
include/final/ftermdetection.h include/final/ftermios.h \
include/final/ftermxterminal.h include/final/ftermlinux.h
fterm_functions.o: fterm_functions.cpp include/final/fcharmap.h \
include/final/fc.h include/final/ftypes.h include/final/fterm.h \
include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/ftermbuffer.h
ftermbuffer.o: ftermbuffer.cpp include/final/fc.h include/final/ftypes.h \
include/final/fcolorpair.h include/final/fstring.h \
include/final/fstyle.h include/final/ftermbuffer.h \
include/final/fvterm.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h
ftermcap.o: ftermcap.cpp include/final/emptyfstring.h \
include/final/fstring.h include/final/fc.h include/final/ftypes.h \
include/final/fkey_map.h include/final/fterm.h include/final/fconfig.h \
include/final/fsystem.h include/final/ftermdata.h \
include/final/frect.h include/final/ftermcap.h \
include/final/ftermdetection.h
ftermcapquirks.o: ftermcapquirks.cpp include/final/fc.h \
include/final/ftypes.h include/final/fkey_map.h include/final/fterm.h \
include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/ftermcap.h \
include/final/ftermcapquirks.h include/final/ftermdata.h \
include/final/frect.h include/final/ftermdetection.h
ftermdebugdata.o: ftermdebugdata.cpp include/final/fc.h \
include/final/ftypes.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/ftermdata.h include/final/frect.h \
include/final/ftermdetection.h include/final/ftermdebugdata.h
ftermdetection.o: ftermdetection.cpp include/final/emptyfstring.h \
include/final/fstring.h include/final/fc.h include/final/ftypes.h \
include/final/fsystem.h include/final/fterm.h include/final/fconfig.h \
include/final/ftermdata.h include/final/frect.h \
include/final/ftermdetection.h include/final/ftermios.h
ftermfreebsd.o: ftermfreebsd.cpp include/final/fcharmap.h \
include/final/fc.h include/final/ftypes.h include/final/fsystem.h \
include/final/fterm.h include/final/fconfig.h include/final/fstring.h \
include/final/ftermdata.h include/final/frect.h \
include/final/ftermfreebsd.h
ftermios.o: ftermios.cpp include/final/ftermios.h include/final/fstring.h \
include/final/fc.h include/final/ftypes.h include/final/fterm.h \
include/final/fconfig.h include/final/fsystem.h
ftermlinux.o: ftermlinux.cpp include/final/fc.h include/final/ftypes.h \
include/final/fcharmap.h include/final/fsystem.h include/final/fterm.h \
include/final/fconfig.h include/final/fstring.h \
include/final/ftermcap.h include/final/ftermdetection.h \
include/final/ftermlinux.h include/final/ftermdata.h \
include/final/frect.h ../fonts/newfont.h ../fonts/newfont_8x16.h \
../fonts/newfont_9x16.h ../fonts/unicodemap.h ../fonts/vgafont.h
ftermopenbsd.o: ftermopenbsd.cpp include/final/fsystem.h \
include/final/ftypes.h include/final/fterm.h include/final/fconfig.h \
include/final/fc.h include/final/fstring.h \
include/final/ftermopenbsd.h
ftermxterminal.o: ftermxterminal.cpp include/final/fc.h \
include/final/ftypes.h include/final/fstring.h include/final/fterm.h \
include/final/fconfig.h include/final/fsystem.h \
include/final/ftermcap.h include/final/ftermdetection.h \
include/final/ftermfreebsd.h include/final/ftermios.h \
include/final/ftermxterminal.h include/final/fsize.h
ftextview.o: ftextview.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fdialog.h include/final/fmenu.h \
include/final/fwindow.h include/final/fmenulist.h \
include/final/fmenuitem.h include/final/fevent.h \
include/final/fscrollbar.h include/final/fstatusbar.h \
include/final/ftextview.h include/final/fwidgetcolors.h
ftogglebutton.o: ftogglebutton.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fbuttongroup.h \
include/final/fscrollview.h include/final/fscrollbar.h \
include/final/fwidgetcolors.h include/final/fevent.h \
include/final/fstatusbar.h include/final/fwindow.h \
include/final/ftogglebutton.h
ftooltip.o: ftooltip.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/ftooltip.h include/final/fwindow.h \
include/final/fwidgetcolors.h
fvterm.o: fvterm.cpp include/final/fapplication.h include/final/ftypes.h \
include/final/fwidget.h include/final/fvterm.h include/final/fc.h \
include/final/fterm.h include/final/fconfig.h include/final/fstring.h \
include/final/fsystem.h include/final/fobject.h include/final/fpoint.h \
include/final/frect.h include/final/fsize.h include/final/fcharmap.h \
include/final/fcolorpair.h include/final/fkeyboard.h \
include/final/foptiattr.h include/final/sgr_optimizer.h \
include/final/foptimove.h include/final/fstyle.h \
include/final/ftermdata.h include/final/ftermbuffer.h \
include/final/ftermcap.h include/final/fwindow.h
fwidget.o: fwidget.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fevent.h include/final/fmenubar.h \
include/final/fmenulist.h include/final/fmenuitem.h \
include/final/fwindow.h include/final/fstatusbar.h \
include/final/ftermdata.h include/final/fwidgetcolors.h
fwidget_functions.o: fwidget_functions.cpp include/final/fcolorpair.h \
include/final/fc.h include/final/ftypes.h include/final/fstring.h \
include/final/fstyle.h include/final/fwidget.h include/final/fvterm.h \
include/final/fterm.h include/final/fconfig.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fwidgetcolors.h
fwidgetcolors.o: fwidgetcolors.cpp include/final/fc.h \
include/final/ftypes.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fwidgetcolors.h
fwindow.o: fwindow.cpp include/final/fapplication.h \
include/final/ftypes.h include/final/fwidget.h include/final/fvterm.h \
include/final/fc.h include/final/fterm.h include/final/fconfig.h \
include/final/fstring.h include/final/fsystem.h \
include/final/fobject.h include/final/fpoint.h include/final/frect.h \
include/final/fsize.h include/final/fcombobox.h \
include/final/flineedit.h include/final/flistbox.h \
include/final/fscrollbar.h include/final/fwindow.h \
include/final/fevent.h include/final/fmenu.h include/final/fmenulist.h \
include/final/fmenuitem.h include/final/fmenubar.h \
include/final/fstatusbar.h
sgr_optimizer.o: sgr_optimizer.cpp include/final/fc.h \
include/final/ftypes.h include/final/sgr_optimizer.h

View File

@ -277,7 +277,7 @@ void FComboBox::setMaxVisibleItems (std::size_t items)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FComboBox::insert (FListBoxItem listItem) void FComboBox::insert (const FListBoxItem& listItem)
{ {
list_window.list.insert(listItem); list_window.list.insert(listItem);

View File

@ -40,7 +40,7 @@ bool sortByName ( const FFileDialog::dir_entry& lhs
, const FFileDialog::dir_entry& rhs ) , const FFileDialog::dir_entry& rhs )
{ {
// lhs < rhs // lhs < rhs
return bool( strcasecmp(lhs.name, rhs.name) < 0 ); return bool( strcasecmp(lhs.name.c_str(), rhs.name.c_str()) < 0 );
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -189,14 +189,11 @@ void FFileDialog::setPath (const FString& dir)
return; return;
} }
if ( S_ISLNK(sb.st_mode) ) if ( S_ISLNK(sb.st_mode) && lstat(dirname, &sb) != 0 )
{
if ( lstat(dirname, &sb) != 0 )
{ {
directory = '/'; directory = '/';
return; return;
} }
}
if ( ! S_ISDIR(sb.st_mode) ) if ( ! S_ISDIR(sb.st_mode) )
{ {
@ -446,10 +443,6 @@ void FFileDialog::clear()
if ( dir_entries.empty() ) if ( dir_entries.empty() )
return; return;
// delete all directory entries;
for (auto&& entry : dir_entries)
std::free (entry.name);
dir_entries.clear(); dir_entries.clear();
dir_entries.shrink_to_fit(); dir_entries.shrink_to_fit();
} }
@ -465,7 +458,7 @@ sInt64 FFileDialog::numOfDirs()
, [] (const dir_entry& entry) , [] (const dir_entry& entry)
{ {
return entry.directory return entry.directory
&& std::strcmp(entry.name, ".") != 0; && std::strcmp(entry.name.c_str(), ".") != 0;
} }
); );
return n; return n;
@ -476,7 +469,7 @@ void FFileDialog::sortDir()
{ {
sInt64 start{0}; sInt64 start{0};
if ( std::strcmp((*dir_entries.begin()).name, "..") == 0 ) if ( std::strcmp((*dir_entries.begin()).name.c_str(), "..") == 0 )
start = 1; start = 1;
const sInt64 dir_num = numOfDirs(); const sInt64 dir_num = numOfDirs();
@ -564,7 +557,7 @@ void FFileDialog::getEntry (const char* const dir, const struct dirent* d_entry)
const char* const filter = filter_pattern.c_str(); const char* const filter = filter_pattern.c_str();
dir_entry entry{}; dir_entry entry{};
entry.name = strdup(d_entry->d_name); entry.name = d_entry->d_name;
#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE #if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
entry.fifo = (d_entry->d_type & DT_FIFO) == DT_FIFO; entry.fifo = (d_entry->d_type & DT_FIFO) == DT_FIFO;
@ -590,10 +583,10 @@ void FFileDialog::getEntry (const char* const dir, const struct dirent* d_entry)
if ( entry.directory ) if ( entry.directory )
dir_entries.push_back (entry); dir_entries.push_back (entry);
else if ( pattern_match(filter, entry.name) ) else if ( pattern_match(filter, entry.name.c_str()) )
dir_entries.push_back (entry); dir_entries.push_back (entry);
else else
std::free(entry.name); entry.name.clear();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -612,7 +605,7 @@ void FFileDialog::followSymLink (const char* const dir, dir_entry& entry)
std::strncpy (symLink, dir, sizeof(symLink)); std::strncpy (symLink, dir, sizeof(symLink));
symLink[sizeof(symLink) - 1] = '\0'; symLink[sizeof(symLink) - 1] = '\0';
std::strncat ( symLink std::strncat ( symLink
, entry.name , entry.name.c_str()
, sizeof(symLink) - std::strlen(symLink) - 1); , sizeof(symLink) - std::strlen(symLink) - 1);
symLink[sizeof(symLink) - 1] = '\0'; symLink[sizeof(symLink) - 1] = '\0';
@ -655,7 +648,7 @@ void FFileDialog::selectDirectoryEntry (const char* const name)
for (auto&& entry : dir_entries) for (auto&& entry : dir_entries)
{ {
if ( std::strcmp(entry.name, name) == 0 ) if ( std::strcmp(entry.name.c_str(), name) == 0 )
{ {
filebrowser.setCurrentItem(i); filebrowser.setCurrentItem(i);
filename.setText(FString(name) + '/'); filename.setText(FString(name) + '/');
@ -793,10 +786,10 @@ void FFileDialog::cb_processActivate (const FWidget*, const FDataPtr)
, std::end(dir_entries) , std::end(dir_entries)
, [&input] (const dir_entry& entry) , [&input] (const dir_entry& entry)
{ {
return entry.name return entry.name.c_str()
&& input && input
&& ! input.isNull() && ! input.isNull()
&& std::strcmp(entry.name, input) == 0 && std::strcmp(entry.name.c_str(), input) == 0
&& entry.directory; && entry.directory;
} }
); );

View File

@ -255,11 +255,12 @@ inline FKey FKeyboard::getMetaKey()
{ {
std::size_t n{}; std::size_t n{};
if ( len == 2 && ( fifo_buf[1] == 'O' if ( len == 2
&& ( fifo_buf[1] == 'O'
|| fifo_buf[1] == '[' || fifo_buf[1] == '['
|| fifo_buf[1] == ']' ) ) || fifo_buf[1] == ']' )
&& ! isKeypressTimeout() )
{ {
if ( ! isKeypressTimeout() )
return fc::Fkey_incomplete; return fc::Fkey_incomplete;
} }

View File

@ -271,11 +271,13 @@ void FLabel::setHotkeyAccelerator()
std::size_t FLabel::getAlignOffset (const std::size_t length) std::size_t FLabel::getAlignOffset (const std::size_t length)
{ {
const std::size_t width(getWidth()); const std::size_t width(getWidth());
assert ( alignment == fc::alignLeft
|| alignment == fc::alignCenter
|| alignment == fc::alignRight );
switch ( alignment ) switch ( alignment )
{ {
case fc::alignLeft: case fc::alignLeft:
default:
return 0; return 0;
case fc::alignCenter: case fc::alignCenter:
@ -357,7 +359,7 @@ void FLabel::drawMultiLine()
else else
align_offset = getAlignOffset(length); align_offset = getAlignOffset(length);
printLine (std::move(label_text)); printLine (label_text);
y++; y++;
} }
} }
@ -374,11 +376,11 @@ void FLabel::drawSingleLine()
print() << FPoint(1, 1); print() << FPoint(1, 1);
align_offset = getAlignOffset(column_width); align_offset = getAlignOffset(column_width);
printLine (std::move(label_text)); printLine (label_text);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FLabel::printLine (FString&& line) void FLabel::printLine (FString& line)
{ {
std::size_t to_char{}; std::size_t to_char{};
std::size_t to_column{}; std::size_t to_column{};

View File

@ -627,18 +627,15 @@ void FLineEdit::adjustLabel()
assert ( label_orientation == label_above assert ( label_orientation == label_above
|| label_orientation == label_left ); || label_orientation == label_left );
switch ( label_orientation ) if ( label_orientation == label_above )
{ {
case label_above:
label->setGeometry ( FPoint(w->getX(), w->getY() - 1) label->setGeometry ( FPoint(w->getX(), w->getY() - 1)
, FSize(label_width, 1) ); , FSize(label_width, 1) );
break; }
else if ( label_orientation == label_left )
case label_left: {
default:
label->setGeometry ( FPoint(w->getX() - int(label_width) - 1, w->getY()) label->setGeometry ( FPoint(w->getX() - int(label_width) - 1, w->getY())
, FSize(label_width, 1) ); , FSize(label_width, 1) );
break;
} }
} }
@ -745,19 +742,21 @@ void FLineEdit::drawInputField()
if ( isActiveFocus && getMaxColor() < 16 ) if ( isActiveFocus && getMaxColor() < 16 )
setBold(); setBold();
const std::size_t text_offset_column = [this] () -> std::size_t const std::size_t text_offset_column = [this] ()
{ {
assert ( input_type == FLineEdit::textfield
|| input_type == FLineEdit::password );
switch ( input_type ) switch ( input_type )
{ {
case FLineEdit::textfield: case FLineEdit::textfield:
default:
return printTextField(); return printTextField();
case FLineEdit::password: case FLineEdit::password:
return printPassword(); return printPassword();
} }
return 0; return std::size_t(0);
}(); }();
while ( x_pos + 1 < getWidth() ) while ( x_pos + 1 < getWidth() )
@ -817,13 +816,12 @@ inline std::size_t FLineEdit::printPassword()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FLineEdit::getCursorColumnPos() inline std::size_t FLineEdit::getCursorColumnPos()
{ {
switch ( input_type ) if ( input_type == FLineEdit::textfield )
{ {
case FLineEdit::textfield:
default:
return getColumnWidth (print_text, cursor_pos); return getColumnWidth (print_text, cursor_pos);
}
case FLineEdit::password: else if ( input_type == FLineEdit::password )
{
return cursor_pos; return cursor_pos;
} }

View File

@ -189,7 +189,7 @@ void FListBox::hide()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListBox::insert (FListBoxItem listItem) void FListBox::insert (const FListBoxItem& listItem)
{ {
const std::size_t column_width = getColumnWidth(listItem.text); const std::size_t column_width = getColumnWidth(listItem.text);
const bool has_brackets(listItem.brackets); const bool has_brackets(listItem.brackets);
@ -374,9 +374,9 @@ void FListBox::onMouseUp (FMouseEvent* ev)
const int mouse_y = ev->getY(); const int mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < int(getWidth()) if ( mouse_x > 1 && mouse_x < int(getWidth())
&& mouse_y > 1 && mouse_y < int(getHeight()) ) && mouse_y > 1 && mouse_y < int(getHeight())
&& ! isMultiSelection() )
{ {
if ( ! isMultiSelection() )
processSelect(); processSelect();
} }
} }
@ -1754,11 +1754,18 @@ void FListBox::cb_vbarChange (const FWidget*, const FDataPtr)
int distance{1}; int distance{1};
const int yoffset_before = yoffset; const int yoffset_before = yoffset;
scrollType = vbar->getScrollType(); scrollType = vbar->getScrollType();
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:
@ -1818,11 +1825,18 @@ void FListBox::cb_hbarChange (const FWidget*, const FDataPtr)
int distance{1}; int distance{1};
const int xoffset_before = xoffset; const int xoffset_before = xoffset;
scrollType = hbar->getScrollType(); scrollType = hbar->getScrollType();
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:

View File

@ -94,10 +94,18 @@ uInt64 firstNumberFromString (const FString& str)
{ {
number = uInt64(num_str.toLong()); number = uInt64(num_str.toLong());
} }
catch (const std::exception&) catch (const std::invalid_argument&)
{ {
return 0; return 0;
} }
catch (const std::underflow_error&)
{
return std::numeric_limits<uInt64>::min();
}
catch (const std::overflow_error&)
{
return std::numeric_limits<uInt64>::max();
}
return number; return number;
} }
@ -504,14 +512,10 @@ FListViewIterator::FListViewIterator (const FListViewIterator& i)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FListViewIterator::FListViewIterator (FListViewIterator&& i) noexcept FListViewIterator::FListViewIterator (FListViewIterator&& i) noexcept
: iter_path(i.iter_path) // move constructor : iter_path(std::move(i.iter_path)) // move constructor
, node(i.node) , node(std::move(i.node))
, position(i.position) , position(std::move(i.position))
{ { }
i.iter_path = iterator_stack{};
i.node = iterator{};
i.position = 0;
}
// FListViewIterator operators // FListViewIterator operators
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -526,12 +530,9 @@ FListViewIterator& FListViewIterator::operator = (const FListViewIterator& i)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FListViewIterator& FListViewIterator::operator = (FListViewIterator&& i) noexcept FListViewIterator& FListViewIterator::operator = (FListViewIterator&& i) noexcept
{ {
iter_path = i.iter_path; iter_path = std::move(i.iter_path);
node = i.node; node = std::move(i.node);
position = i.position; position = std::move(i.position);
i.iter_path = iterator_stack{};
i.node = iterator{};
i.position = 0;
return *this; return *this;
} }
@ -1014,11 +1015,16 @@ void FListView::sort()
if ( sort_column < 1 && sort_column > int(header.size()) ) if ( sort_column < 1 && sort_column > int(header.size()) )
return; return;
switch ( getColumnSortType(sort_column) ) fc::sorting_type column_sort_type = getColumnSortType(sort_column);
assert ( column_sort_type == fc::by_name
|| column_sort_type == fc::by_number
|| column_sort_type == fc::user_defined
|| column_sort_type == fc::unknown );
switch ( column_sort_type )
{ {
case fc::unknown: case fc::unknown:
case fc::by_name: case fc::by_name:
default:
if ( sort_order == fc::ascending ) if ( sort_order == fc::ascending )
{ {
sort (sortAscendingByName); sort (sortAscendingByName);
@ -1584,10 +1590,13 @@ std::size_t FListView::getAlignOffset ( const fc::text_alignment align
, const std::size_t column_width , const std::size_t column_width
, const std::size_t width ) , const std::size_t width )
{ {
assert ( align == fc::alignLeft
|| align == fc::alignCenter
|| align == fc::alignRight );
switch ( align ) switch ( align )
{ {
case fc::alignLeft: case fc::alignLeft:
default:
return 0; return 0;
case fc::alignCenter: case fc::alignCenter:
@ -2855,11 +2864,18 @@ void FListView::cb_vbarChange (const FWidget*, const FDataPtr)
static constexpr int wheel_distance = 4; static constexpr int wheel_distance = 4;
int distance{1}; int distance{1};
first_line_position_before = first_visible_line.getPosition(); first_line_position_before = first_visible_line.getPosition();
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:
@ -2915,11 +2931,18 @@ void FListView::cb_hbarChange (const FWidget*, const FDataPtr)
static constexpr int wheel_distance = 4; static constexpr int wheel_distance = 4;
int distance{1}; int distance{1};
const int xoffset_before = xoffset; const int xoffset_before = xoffset;
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:

View File

@ -678,18 +678,19 @@ void FMenu::hideSuperMenus()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FMenu::mouseDownOverList (FPoint mouse_pos) bool FMenu::mouseDownOverList (const FPoint& mouse_pos)
{ {
bool focus_changed{false}; bool focus_changed{false};
mouse_pos -= FPoint(getRightPadding(), getTopPadding()); FPoint pos{mouse_pos};
pos -= FPoint(getRightPadding(), getTopPadding());
for (auto&& item : getItemList()) for (auto&& item : getItemList())
{ {
const int x1 = item->getX(); const int x1 = item->getX();
const int x2 = item->getX() + int(item->getWidth()); const int x2 = item->getX() + int(item->getWidth());
const int y = item->getY(); const int y = item->getY();
const int mouse_x = mouse_pos.getX(); const int mouse_x = pos.getX();
const int mouse_y = mouse_pos.getY(); const int mouse_y = pos.getY();
if ( mouse_x >= x1 if ( mouse_x >= x1
&& mouse_x < x2 && mouse_x < x2
@ -764,17 +765,18 @@ void FMenu::mouseDownSelection (FMenuItem* m_item, bool& focus_changed)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FMenu::mouseUpOverList (FPoint mouse_pos) bool FMenu::mouseUpOverList (const FPoint& mouse_pos)
{ {
mouse_pos -= FPoint(getRightPadding(), getTopPadding()); FPoint pos{mouse_pos};
pos -= FPoint(getRightPadding(), getTopPadding());
for (auto&& item : getItemList()) for (auto&& item : getItemList())
{ {
const int x1 = item->getX(); const int x1 = item->getX();
const int x2 = item->getX() + int(item->getWidth()); const int x2 = item->getX() + int(item->getWidth());
const int y = item->getY(); const int y = item->getY();
const int mouse_x = mouse_pos.getX(); const int mouse_x = pos.getX();
const int mouse_y = mouse_pos.getY(); const int mouse_y = pos.getY();
if ( item->isSelected() if ( item->isSelected()
&& mouse_x >= x1 && mouse_x >= x1
@ -819,17 +821,18 @@ bool FMenu::mouseUpOverList (FPoint mouse_pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenu::mouseMoveOverList (FPoint mouse_pos, mouseStates& ms) void FMenu::mouseMoveOverList (const FPoint& mouse_pos, mouseStates& ms)
{ {
mouse_pos -= FPoint(getRightPadding(), getTopPadding()); FPoint pos{mouse_pos};
pos -= FPoint(getRightPadding(), getTopPadding());
for (auto&& item : getItemList()) for (auto&& item : getItemList())
{ {
const int x1 = item->getX(); const int x1 = item->getX();
const int x2 = item->getX() + int(item->getWidth()); const int x2 = item->getX() + int(item->getWidth());
const int y = item->getY(); const int y = item->getY();
const int mouse_x = mouse_pos.getX(); const int mouse_x = pos.getX();
const int mouse_y = mouse_pos.getY(); const int mouse_y = pos.getY();
if ( mouse_x >= x1 && mouse_x < x2 && mouse_y == y ) if ( mouse_x >= x1 && mouse_x < x2 && mouse_y == y )
mouseMoveSelection (item, ms); mouseMoveSelection (item, ms);
@ -1367,16 +1370,14 @@ inline void FMenu::drawMenuText (menuText& data)
for (std::size_t z{0}; z < data.text.getLength(); z++) for (std::size_t z{0}; z < data.text.getLength(); z++)
{ {
if ( ! std::iswprint(std::wint_t(data.text[z])) ) if ( ! std::iswprint(std::wint_t(data.text[z]))
{ && ! isNewFont()
if ( ! isNewFont()
&& ( data.text[z] < fc::NF_rev_left_arrow2 && ( data.text[z] < fc::NF_rev_left_arrow2
|| data.text[z] > fc::NF_check_mark ) || data.text[z] > fc::NF_check_mark )
&& ! charEncodable(wchar_t(data.text[z])) ) && ! charEncodable(wchar_t(data.text[z])) )
{ {
data.text[z] = L' '; data.text[z] = L' ';
} }
}
if ( z == data.hotkeypos ) if ( z == data.hotkeypos )
{ {

View File

@ -596,15 +596,13 @@ inline void FMenuBar::drawMenuText (menuText& data)
if ( data.startpos > screenWidth - z ) if ( data.startpos > screenWidth - z )
break; break;
if ( ! std::iswprint(std::wint_t(data.text[z])) ) if ( ! std::iswprint(std::wint_t(data.text[z]))
{ && ! isNewFont()
if ( ! isNewFont()
&& ( data.text[z] < fc::NF_rev_left_arrow2 && ( data.text[z] < fc::NF_rev_left_arrow2
|| data.text[z] > fc::NF_check_mark ) ) || data.text[z] > fc::NF_check_mark ) )
{ {
data.text[z] = L' '; data.text[z] = L' ';
} }
}
if ( z == data.hotkeypos ) if ( z == data.hotkeypos )
{ {
@ -849,12 +847,9 @@ void FMenuBar::mouseUpOverList (const FMouseEvent* ev)
&& item->isSelected() ) && item->isSelected() )
{ {
// Mouse pointer over item // Mouse pointer over item
if ( ! activateMenu(item) ) if ( ! activateMenu(item) && clickItem(item) )
{
if ( clickItem(item) )
return; return;
} }
}
else else
{ {
unselectMenuItem(item); unselectMenuItem(item);

View File

@ -684,9 +684,11 @@ void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev
break; break;
case fc::MouseMove_Event: case fc::MouseMove_Event:
default:
widget->onMouseMove(_ev.get()); widget->onMouseMove(_ev.get());
break; break;
default:
break;
} }
} }

View File

@ -180,17 +180,22 @@ inline bool FMouse::isInputDataPending()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FMouse* FMouse::createMouseObject (const mouse_type mt) inline FMouse* FMouse::createMouseObject (const mouse_type mt)
{ {
assert ( mt == FMouse::none
|| mt == FMouse::gpm
|| mt == FMouse::x11
|| mt == FMouse::sgr
|| mt == FMouse::urxvt );
switch ( mt ) switch ( mt )
{ {
case none: case none:
default:
return nullptr; return nullptr;
case gpm: case gpm:
#ifdef F_HAVE_LIBGPM #ifdef F_HAVE_LIBGPM
return new FMouseGPM; return new FMouseGPM;
#else #else
break; return nullptr;
#endif #endif
case x11: case x11:
@ -203,7 +208,7 @@ inline FMouse* FMouse::createMouseObject (const mouse_type mt)
return new FMouseUrxvt; return new FMouseUrxvt;
} }
return new FMouseX11; return nullptr;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -490,15 +490,13 @@ char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
check_boundaries (xold, yold, xnew, ynew); check_boundaries (xold, yold, xnew, ynew);
// Method 0: direct cursor addressing // Method 0: direct cursor addressing
if ( isMethod0Faster(move_time, xnew, ynew) ) if ( isMethod0Faster(move_time, xnew, ynew)
{ && ( xold < 0
if ( xold < 0
|| yold < 0 || yold < 0
|| isWideMove (xold, yold, xnew, ynew) ) || isWideMove (xold, yold, xnew, ynew) ) )
{ {
return ( move_time < LONG_DURATION ) ? move_buf : nullptr; return ( move_time < LONG_DURATION ) ? move_buf : nullptr;
} }
}
// Method 1: local movement // Method 1: local movement
if ( isMethod1Faster(move_time, xold, yold, xnew, ynew) ) if ( isMethod1Faster(move_time, xold, yold, xnew, ynew) )

View File

@ -44,9 +44,8 @@ FPoint& FPoint::operator = (const FPoint& p)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FPoint& FPoint::operator = (FPoint&& p) noexcept FPoint& FPoint::operator = (FPoint&& p) noexcept
{ {
xpos = p.xpos; xpos = std::move(p.xpos);
ypos = p.ypos; ypos = std::move(p.ypos);
p.xpos = p.ypos = 0;
return *this; return *this;
} }

View File

@ -69,12 +69,10 @@ FRect& FRect::operator = (const FRect& r)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FRect& FRect::operator = (FRect&& r) noexcept FRect& FRect::operator = (FRect&& r) noexcept
{ {
X1 = r.X1; X1 = std::move(r.X1);
Y1 = r.Y1; Y1 = std::move(r.Y1);
X2 = r.X2; X2 = std::move(r.X2);
Y2 = r.Y2; Y2 = std::move(r.Y2);
r.X1 = r.Y1 = 0;
r.X2 = r.Y2 = -1;
return *this; return *this;
} }

View File

@ -202,15 +202,12 @@ void FScrollView::setPos (const FPoint& p, bool adjust)
scroll_geometry.setPos ( getTermX() + getLeftPadding() - 1 scroll_geometry.setPos ( getTermX() + getLeftPadding() - 1
, getTermY() + getTopPadding() - 1 ); , getTermY() + getTopPadding() - 1 );
if ( ! adjust ) if ( ! adjust && viewport )
{
if ( viewport )
{ {
viewport->offset_left = scroll_geometry.getX(); viewport->offset_left = scroll_geometry.getX();
viewport->offset_top = scroll_geometry.getY(); viewport->offset_top = scroll_geometry.getY();
} }
} }
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollView::setWidth (std::size_t w, bool adjust) void FScrollView::setWidth (std::size_t w, bool adjust)
@ -790,10 +787,13 @@ void FScrollView::calculateScrollbarPos()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollView::setHorizontalScrollBarVisibility() void FScrollView::setHorizontalScrollBarVisibility()
{ {
assert ( v_mode == fc::Auto
|| v_mode == fc::Hidden
|| v_mode == fc::Scroll );
switch ( h_mode ) switch ( h_mode )
{ {
case fc::Auto: case fc::Auto:
default:
if ( getScrollWidth() > getViewportWidth() ) if ( getScrollWidth() > getViewportWidth() )
hbar->show(); hbar->show();
else else
@ -813,10 +813,13 @@ void FScrollView::setHorizontalScrollBarVisibility()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollView::setVerticalScrollBarVisibility() void FScrollView::setVerticalScrollBarVisibility()
{ {
assert ( v_mode == fc::Auto
|| v_mode == fc::Hidden
|| v_mode == fc::Scroll );
switch ( v_mode ) switch ( v_mode )
{ {
case fc::Auto: case fc::Auto:
default:
if ( getScrollHeight() > getViewportHeight() ) if ( getScrollHeight() > getViewportHeight() )
vbar->show(); vbar->show();
else else
@ -859,6 +862,14 @@ void FScrollView::cb_vbarChange (const FWidget*, const FDataPtr)
FScrollbar::sType scrollType = vbar->getScrollType(); FScrollbar::sType scrollType = vbar->getScrollType();
static constexpr int wheel_distance = 4; static constexpr int wheel_distance = 4;
int distance{1}; int distance{1};
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
if ( scrollType >= FScrollbar::scrollStepBackward ) if ( scrollType >= FScrollbar::scrollStepBackward )
{ {
@ -872,7 +883,6 @@ void FScrollView::cb_vbarChange (const FWidget*, const FDataPtr)
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:
@ -911,6 +921,14 @@ void FScrollView::cb_hbarChange (const FWidget*, const FDataPtr)
FScrollbar::sType scrollType = hbar->getScrollType(); FScrollbar::sType scrollType = hbar->getScrollType();
static constexpr int wheel_distance = 4; static constexpr int wheel_distance = 4;
int distance{1}; int distance{1};
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
if ( scrollType >= FScrollbar::scrollStepBackward ) if ( scrollType >= FScrollbar::scrollStepBackward )
{ {
@ -924,7 +942,6 @@ void FScrollView::cb_hbarChange (const FWidget*, const FDataPtr)
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:

View File

@ -47,9 +47,8 @@ FSize& FSize::operator = (const FSize& s)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FSize& FSize::operator = (FSize&& s) noexcept FSize& FSize::operator = (FSize&& s) noexcept
{ {
width = s.width; width = std::move(s.width);
height = s.height; height = std::move(s.height);
s.width = s.height = 0;
return *this; return *this;
} }
@ -83,7 +82,7 @@ void FSize::setHeight (std::size_t h)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FSize::setSize (FSize s) void FSize::setSize (const FSize& s)
{ {
width = s.width; width = s.width;
height = s.height; height = s.height;

View File

@ -281,8 +281,15 @@ void FSpinBox::onTimer (FTimerEvent*)
addTimer(repeat_time); addTimer(repeat_time);
} }
assert ( spining_state == FSpinBox::noSpin
|| spining_state == FSpinBox::spinUp
|| spining_state == FSpinBox::spinDown );
switch ( spining_state ) switch ( spining_state )
{ {
case FSpinBox::noSpin:
break;
case FSpinBox::spinUp: case FSpinBox::spinUp:
increaseValue(); increaseValue();
updateInputField(); updateInputField();
@ -292,10 +299,6 @@ void FSpinBox::onTimer (FTimerEvent*)
decreaseValue(); decreaseValue();
updateInputField(); updateInputField();
break; break;
case FSpinBox::noSpin:
default:
break;
} }
} }

View File

@ -43,7 +43,6 @@ FStartOptions::FStartOptions()
, sgr_optimizer{true} , sgr_optimizer{true}
, vgafont{false} , vgafont{false}
, newfont{false} , newfont{false}
, encoding{fc::UNKNOWN}
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST) #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
, meta_sends_escape{true} , meta_sends_escape{true}
, change_cursorstyle{true} , change_cursorstyle{true}

View File

@ -43,8 +43,8 @@ FSwitch::FSwitch(FWidget* parent)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FSwitch::FSwitch (const FString& txt, FWidget* parent) FSwitch::FSwitch (const FString& txt, FWidget* parent)
: FToggleButton(txt, parent) : FToggleButton(txt, parent)
, switch_offset_pos(txt.getLength() + 1)
{ {
switch_offset_pos = txt.getLength() + 1;
setButtonWidth(11); setButtonWidth(11);
} }

View File

@ -1070,7 +1070,9 @@ void FTerm::setEncoding (fc::encoding enc)
assert ( enc == fc::UTF8 assert ( enc == fc::UTF8
|| enc == fc::VT100 // VT100 line drawing || enc == fc::VT100 // VT100 line drawing
|| enc == fc::PC // CP-437 || enc == fc::PC // CP-437
|| enc == fc::ASCII ); || enc == fc::ASCII
|| enc == fc::UNKNOWN
|| enc == fc::NUM_OF_ENCODINGS );
// Set the new putchar() function pointer // Set the new putchar() function pointer
switch ( enc ) switch ( enc )
@ -1090,7 +1092,6 @@ void FTerm::setEncoding (fc::encoding enc)
case fc::ASCII: case fc::ASCII:
case fc::UNKNOWN: case fc::UNKNOWN:
case fc::NUM_OF_ENCODINGS: case fc::NUM_OF_ENCODINGS:
default:
putchar() = &FTerm::putchar_ASCII; putchar() = &FTerm::putchar_ASCII;
} }
@ -1794,13 +1795,12 @@ void FTerm::init_individual_term_encoding()
data->setTermEncoding (fc::PC); data->setTermEncoding (fc::PC);
putchar() = &FTerm::putchar_ASCII; // function pointer putchar() = &FTerm::putchar_ASCII; // function pointer
if ( hasUTF8() && getStartOptions().encoding == fc::UNKNOWN ) if ( hasUTF8()
{ && getStartOptions().encoding == fc::UNKNOWN
if ( isXTerminal() ) && isXTerminal() )
putchar() = &FTerm::putchar_UTF8; // function pointer putchar() = &FTerm::putchar_UTF8; // function pointer
} }
} }
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::init_force_vt100_encoding() void FTerm::init_force_vt100_encoding()
@ -2326,7 +2326,7 @@ bool FTerm::init_terminal()
{ {
FTermios::storeTTYsettings(); FTermios::storeTTYsettings();
} }
catch (const std::runtime_error& ex) catch (const std::system_error& ex)
{ {
FString msg = "FTerm: " + FString(ex.what()); FString msg = "FTerm: " + FString(ex.what());
data->setExitMessage(msg); data->setExitMessage(msg);
@ -2554,7 +2554,6 @@ void FTerm::signal_handler (int signum)
<< signum << signum
<< " (" << strsignal(signum) << ")" << std::endl; << " (" << strsignal(signum) << ")" << std::endl;
std::terminate(); std::terminate();
break;
default: default:
break; break;

View File

@ -200,10 +200,18 @@ uInt env2uint (const char* env)
{ {
return str.toUInt(); return str.toUInt();
} }
catch (const std::exception&) catch (const std::invalid_argument&)
{ {
return 0; return 0;
} }
catch (const std::underflow_error&)
{
return std::numeric_limits<uInt>::min();
}
catch (const std::overflow_error&)
{
return std::numeric_limits<uInt>::max();
}
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -507,7 +515,7 @@ std::size_t getColumnWidth (const FTermBuffer& tb)
return std::accumulate ( std::next(tb.begin()) return std::accumulate ( std::next(tb.begin())
, tb.end() , tb.end()
, tb.front().attr.bit.char_width , tb.front().attr.bit.char_width
, [] (std::size_t s, FChar c) -> std::size_t , [] (std::size_t s, FChar c)
{ {
return std::move(s) + c.attr.bit.char_width; return std::move(s) + c.attr.bit.char_width;
} }

View File

@ -50,7 +50,7 @@ const FString FTermBuffer::toString() const
std::transform ( data.begin() std::transform ( data.begin()
, data.end() , data.end()
, std::back_inserter(wide_string) , std::back_inserter(wide_string)
, [] (const FChar& fchar) -> wchar_t , [] (const FChar& fchar)
{ {
return fchar.ch; return fchar.ch;
} }

View File

@ -558,9 +558,8 @@ const FString FTermDetection::getXTermColorName (FColor color)
tv.tv_usec = 150000; // 150 ms tv.tv_usec = 150000; // 150 ms
// read the terminal answer // read the terminal answer
if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0 ) if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0
{ && std::scanf("\033]4;%10hu;%509[^\n]s", &color, temp) == 2 )
if ( std::scanf("\033]4;%10hu;%509[^\n]s", &color, temp) == 2 )
{ {
std::size_t n = std::strlen(temp); std::size_t n = std::strlen(temp);
@ -574,7 +573,6 @@ const FString FTermDetection::getXTermColorName (FColor color)
color_str = temp; color_str = temp;
} }
}
return color_str; return color_str;
} }
@ -640,8 +638,8 @@ const FString FTermDetection::getAnswerbackMsg()
tv.tv_usec = 150000; // 150 ms tv.tv_usec = 150000; // 150 ms
// Read the answerback message // Read the answerback message
if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0 ) if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0
if ( std::fgets (temp, sizeof(temp) - 1, stdin) != nullptr ) && std::fgets (temp, sizeof(temp) - 1, stdin) != nullptr )
answerback = temp; answerback = temp;
return answerback; return answerback;
@ -712,16 +710,30 @@ char* FTermDetection::parseSecDA (char current_termtype[])
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FTermDetection::str2int (const FString& s) int FTermDetection::str2int (const FString& s)
{ {
// This is not a general string to integer conversion method.
// It is only used in this class to convert the device attribute
// parameters into numbers.
constexpr int ERROR = -1;
if ( ! s ) if ( ! s )
return -1; return ERROR;
try try
{ {
return s.toInt(); return s.toInt();
} }
catch (const std::exception&) catch (const std::invalid_argument&)
{ {
return -1; return ERROR;
}
catch (const std::underflow_error&)
{
return ERROR;
}
catch (const std::overflow_error&)
{
return ERROR;
} }
} }

View File

@ -24,6 +24,7 @@
#undef __STRICT_ANSI__ // need for fileno #undef __STRICT_ANSI__ // need for fileno
#endif #endif
#include <system_error>
#include <unordered_map> #include <unordered_map>
#include "final/ftermios.h" #include "final/ftermios.h"
@ -74,7 +75,7 @@ termios FTermios::getTTY()
struct termios t{}; struct termios t{};
if ( tcgetattr(stdin_no, &t) == -1 ) if ( tcgetattr(stdin_no, &t) == -1 )
throw std::runtime_error("Cannot find tty"); throw std::system_error(errno, std::generic_category());
return t; return t;
} }

View File

@ -749,6 +749,14 @@ void FTextView::cb_vbarChange (const FWidget*, const FDataPtr)
const FScrollbar::sType scrollType = vbar->getScrollType(); const FScrollbar::sType scrollType = vbar->getScrollType();
static constexpr int wheel_distance = 4; static constexpr int wheel_distance = 4;
int distance{1}; int distance{1};
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
if ( scrollType >= FScrollbar::scrollStepBackward ) if ( scrollType >= FScrollbar::scrollStepBackward )
update_scrollbar = true; update_scrollbar = true;
@ -758,7 +766,6 @@ void FTextView::cb_vbarChange (const FWidget*, const FDataPtr)
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:
@ -801,6 +808,14 @@ void FTextView::cb_hbarChange (const FWidget*, const FDataPtr)
const FScrollbar::sType scrollType = hbar->getScrollType(); const FScrollbar::sType scrollType = hbar->getScrollType();
static constexpr int wheel_distance = 4; static constexpr int wheel_distance = 4;
int distance{1}; int distance{1};
assert ( scrollType == FScrollbar::noScroll
|| scrollType == FScrollbar::scrollJump
|| scrollType == FScrollbar::scrollStepBackward
|| scrollType == FScrollbar::scrollStepForward
|| scrollType == FScrollbar::scrollPageBackward
|| scrollType == FScrollbar::scrollPageForward
|| scrollType == FScrollbar::scrollWheelUp
|| scrollType == FScrollbar::scrollWheelDown );
if ( scrollType >= FScrollbar::scrollStepBackward ) if ( scrollType >= FScrollbar::scrollStepBackward )
update_scrollbar = true; update_scrollbar = true;
@ -810,7 +825,6 @@ void FTextView::cb_hbarChange (const FWidget*, const FDataPtr)
switch ( scrollType ) switch ( scrollType )
{ {
case FScrollbar::noScroll: case FScrollbar::noScroll:
default:
break; break;
case FScrollbar::scrollPageBackward: case FScrollbar::scrollPageBackward:

View File

@ -520,7 +520,7 @@ void FToggleButton::init()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FToggleButton::drawText (FString&& label_text, std::size_t hotkeypos) void FToggleButton::drawText (const FString& label_text, std::size_t hotkeypos)
{ {
if ( isMonochron() ) if ( isMonochron() )
setReverse(true); setReverse(true);

View File

@ -90,12 +90,6 @@ void FToolTip::show()
FWindow::show(); FWindow::show();
} }
//----------------------------------------------------------------------
void FToolTip::hide()
{
FWindow::hide();
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FToolTip::onMouseDown (FMouseEvent*) void FToolTip::onMouseDown (FMouseEvent*)
{ {

View File

@ -151,15 +151,13 @@ void FVTerm::setTermXY (int x, int y)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FVTerm::setTerminalUpdates (terminal_update refresh_state) void FVTerm::setTerminalUpdates (terminal_update refresh_state)
{ {
switch ( refresh_state ) if ( refresh_state == stop_terminal_updates )
{ {
case stop_terminal_updates:
no_terminal_updates = true; no_terminal_updates = true;
break; }
else if ( refresh_state == continue_terminal_updates
case continue_terminal_updates: || refresh_state == start_terminal_updates )
case start_terminal_updates: {
default:
no_terminal_updates = false; no_terminal_updates = false;
} }
@ -1176,9 +1174,7 @@ void FVTerm::scrollAreaForward (FTermArea* area)
area->changes[y_max].xmax = uInt(area->width - 1); area->changes[y_max].xmax = uInt(area->width - 1);
area->has_changes = true; area->has_changes = true;
if ( area == vdesktop ) if ( area == vdesktop && TCAP(fc::t_scroll_forward) )
{
if ( TCAP(fc::t_scroll_forward) )
{ {
setTermXY (0, vdesktop->height); setTermXY (0, vdesktop->height);
FTerm::scrollTermForward(); FTerm::scrollTermForward();
@ -1192,7 +1188,6 @@ void FVTerm::scrollAreaForward (FTermArea* area)
} }
} }
} }
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FVTerm::scrollAreaReverse (FTermArea* area) void FVTerm::scrollAreaReverse (FTermArea* area)
@ -1234,9 +1229,7 @@ void FVTerm::scrollAreaReverse (FTermArea* area)
area->changes[0].xmax = uInt(area->width - 1); area->changes[0].xmax = uInt(area->width - 1);
area->has_changes = true; area->has_changes = true;
if ( area == vdesktop ) if ( area == vdesktop && TCAP(fc::t_scroll_reverse) )
{
if ( TCAP(fc::t_scroll_reverse) )
{ {
setTermXY (0, 0); setTermXY (0, 0);
FTerm::scrollTermReverse(); FTerm::scrollTermReverse();
@ -1250,7 +1243,6 @@ void FVTerm::scrollAreaReverse (FTermArea* area)
} }
} }
} }
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FVTerm::clearArea (FTermArea* area, int fillchar) void FVTerm::clearArea (FTermArea* area, int fillchar)
@ -1721,7 +1713,7 @@ bool FVTerm::hasChildAreaChanges (FTermArea* area)
return std::any_of ( area->preproc_list.begin() return std::any_of ( area->preproc_list.begin()
, area->preproc_list.end() , area->preproc_list.end()
, [] (const FVTermPreprocessing& pcall) -> bool , [] (const FVTermPreprocessing& pcall)
{ {
return pcall.instance return pcall.instance
&& pcall.instance->child_print_area && pcall.instance->child_print_area

View File

@ -235,11 +235,11 @@ std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
return double_flatline_mask.bottom; return double_flatline_mask.bottom;
case fc::left: case fc::left:
default:
return double_flatline_mask.left; return double_flatline_mask.left;
} }
return double_flatline_mask.left; static std::vector<bool> empty;
return empty;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -671,9 +671,6 @@ void FWidget::setDoubleFlatLine (fc::sides side, bool bit)
length = double_flatline_mask.left.size(); length = double_flatline_mask.left.size();
double_flatline_mask.left.assign(length, bit); double_flatline_mask.left.assign(length, bit);
break; break;
default:
break;
} }
} }
@ -723,9 +720,6 @@ void FWidget::setDoubleFlatLine (fc::sides side, int pos, bool bit)
double_flatline_mask.left[index] = bit; double_flatline_mask.left[index] = bit;
break; break;
default:
break;
} }
} }
@ -807,7 +801,7 @@ bool FWidget::close()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::addCallback ( const FString& cb_signal void FWidget::addCallback ( const FString& cb_signal
, FCallback cb_function , const FCallback& cb_function
, FDataPtr data ) , FDataPtr data )
{ {
// Add a (normal) function pointer as callback // Add a (normal) function pointer as callback
@ -819,7 +813,7 @@ void FWidget::addCallback ( const FString& cb_signal
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::addCallback ( const FString& cb_signal void FWidget::addCallback ( const FString& cb_signal
, FWidget* cb_instance , FWidget* cb_instance
, FCallback cb_function , const FCallback& cb_function
, FDataPtr data ) , FDataPtr data )
{ {
// Add a member function pointer as callback // Add a member function pointer as callback
@ -829,7 +823,7 @@ void FWidget::addCallback ( const FString& cb_signal
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::delCallback (FCallback cb_function) void FWidget::delCallback (const FCallback& cb_function)
{ {
// Delete cb_function form callback list // Delete cb_function form callback list
@ -1103,14 +1097,13 @@ bool FWidget::focusFirstChild()
{ {
widget->setFocus(); widget->setFocus();
if ( widget->numOfChildren() >= 1 ) if ( widget->numOfChildren() >= 1
{ && ! widget->focusFirstChild()
if ( ! widget->focusFirstChild() && widget->isWindowWidget() ) && widget->isWindowWidget() )
{ {
++iter; ++iter;
continue; continue;
} }
}
return true; return true;
} }
@ -1145,11 +1138,9 @@ bool FWidget::focusLastChild()
{ {
widget->setFocus(); widget->setFocus();
if ( widget->numOfChildren() >= 1 ) if ( widget->numOfChildren() >= 1
{ && ! widget->focusLastChild() && widget->isWindowWidget() )
if ( ! widget->focusLastChild() && widget->isWindowWidget() )
continue; continue;
}
return true; return true;
} }

View File

@ -56,21 +56,13 @@ class FColorPair
{ } { }
// Copy constructor // Copy constructor
FColorPair (const FColorPair& pair) FColorPair (const FColorPair& pair) = default;
: fg_color{pair.fg_color}
, bg_color{pair.bg_color}
{ }
// Destructor // Destructor
~FColorPair() = default; ~FColorPair() = default;
// copy assignment operator (=) // copy assignment operator (=)
FColorPair& operator = (const FColorPair& pair) FColorPair& operator = (const FColorPair& pair) = default;
{
fg_color = pair.fg_color;
bg_color = pair.bg_color;
return *this;
}
// Accessor // Accessor
const FString getClassName() const const FString getClassName() const

View File

@ -181,7 +181,7 @@ class FComboBox : public FWidget
bool hasShadow(); bool hasShadow();
// Methods // Methods
void insert (FListBoxItem); void insert (const FListBoxItem&);
template <typename T> template <typename T>
void insert ( const std::initializer_list<T>& list void insert ( const std::initializer_list<T>& list
, FDataPtr = nullptr ); , FDataPtr = nullptr );

View File

@ -144,7 +144,7 @@ class FFileDialog : public FDialog
// Typedef // Typedef
struct dir_entry struct dir_entry
{ {
char* name; std::string name;
// Type of file // Type of file
uChar fifo : 1; uChar fifo : 1;
uChar character_device : 1; uChar character_device : 1;

View File

@ -115,9 +115,9 @@ class FKeyboard final
void disableUTF8(); void disableUTF8();
void enableMouseSequences(); void enableMouseSequences();
void disableMouseSequences(); void disableMouseSequences();
void setPressCommand (FKeyboardCommand); void setPressCommand (const FKeyboardCommand&);
void setReleaseCommand (FKeyboardCommand); void setReleaseCommand (const FKeyboardCommand&);
void setEscPressedCommand (FKeyboardCommand); void setEscPressedCommand (const FKeyboardCommand&);
// Inquiry // Inquiry
bool isInputDataPending(); bool isInputDataPending();
@ -236,15 +236,15 @@ inline void FKeyboard::disableMouseSequences()
{ mouse_support = false; } { mouse_support = false; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FKeyboard::setPressCommand (FKeyboardCommand cmd) inline void FKeyboard::setPressCommand (const FKeyboardCommand& cmd)
{ keypressed_cmd = cmd; } { keypressed_cmd = cmd; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FKeyboard::setReleaseCommand (FKeyboardCommand cmd) inline void FKeyboard::setReleaseCommand (const FKeyboardCommand& cmd)
{ keyreleased_cmd = cmd; } { keyreleased_cmd = cmd; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FKeyboard::setEscPressedCommand (FKeyboardCommand cmd) inline void FKeyboard::setEscPressedCommand (const FKeyboardCommand& cmd)
{ escape_key_cmd = cmd; } { escape_key_cmd = cmd; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -135,7 +135,7 @@ class FLabel : public FWidget
void draw() override; void draw() override;
void drawMultiLine(); void drawMultiLine();
void drawSingleLine(); void drawSingleLine();
void printLine (FString&&); void printLine (FString&);
// Data members // Data members
FStringList multiline_text{}; FStringList multiline_text{};

View File

@ -201,7 +201,7 @@ class FListBox : public FWidget
void insert (Iterator, Iterator, InsertConverter); void insert (Iterator, Iterator, InsertConverter);
template <typename Container, typename LazyConverter> template <typename Container, typename LazyConverter>
void insert (Container, LazyConverter); void insert (Container, LazyConverter);
void insert (FListBoxItem); void insert (const FListBoxItem&);
template <typename T> template <typename T>
void insert ( const std::initializer_list<T>& list void insert ( const std::initializer_list<T>& list
, fc::brackets_type = fc::NoBrackets , fc::brackets_type = fc::NoBrackets

View File

@ -179,11 +179,11 @@ class FMenu : public FWindow, public FMenuList
void closeOpenedSubMenu(); void closeOpenedSubMenu();
void hideSubMenus(); void hideSubMenus();
void hideSuperMenus(); void hideSuperMenus();
bool mouseDownOverList (FPoint); bool mouseDownOverList (const FPoint&);
void mouseDownSubmenu (const FMenuItem*); void mouseDownSubmenu (const FMenuItem*);
void mouseDownSelection (FMenuItem*, bool&); void mouseDownSelection (FMenuItem*, bool&);
bool mouseUpOverList (FPoint); bool mouseUpOverList (const FPoint&);
void mouseMoveOverList (FPoint, mouseStates&); void mouseMoveOverList (const FPoint&, mouseStates&);
void mouseMoveSelection (FMenuItem*, mouseStates&); void mouseMoveSelection (FMenuItem*, mouseStates&);
void mouseMoveDeselection (FMenuItem*, mouseStates&); void mouseMoveDeselection (FMenuItem*, mouseStates&);
void mouseUpOverBorder(); void mouseUpOverBorder();

View File

@ -109,9 +109,9 @@ inline FPoint::FPoint (const FPoint& p) // copy constructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FPoint::FPoint (FPoint&& p) noexcept // move constructor inline FPoint::FPoint (FPoint&& p) noexcept // move constructor
: xpos(p.xpos) : xpos(std::move(p.xpos))
, ypos(p.ypos) , ypos(std::move(p.ypos))
{ p.xpos = p.ypos = 0; } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FPoint::FPoint (int x, int y) inline FPoint::FPoint (int x, int y)

View File

@ -156,14 +156,11 @@ inline FRect::FRect (const FRect& r) // copy constructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FRect::FRect (FRect&& r) noexcept // move constructor inline FRect::FRect (FRect&& r) noexcept // move constructor
: X1(r.X1) : X1(std::move(r.X1))
, Y1(r.Y1) , Y1(std::move(r.Y1))
, X2(r.X2) , X2(std::move(r.X2))
, Y2(r.Y2) , Y2(std::move(r.Y2))
{ { }
r.X1 = r.Y1 = 0;
r.X2 = r.Y2 = -1;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FRect::FRect (int x, int y, std::size_t width, std::size_t height) inline FRect::FRect (int x, int y, std::size_t width, std::size_t height)

View File

@ -76,7 +76,7 @@ class FSize
std::size_t getArea() const; std::size_t getArea() const;
void setWidth (std::size_t); void setWidth (std::size_t);
void setHeight (std::size_t); void setHeight (std::size_t);
void setSize (FSize); void setSize (const FSize&);
void setSize (std::size_t, std::size_t); void setSize (std::size_t, std::size_t);
// Inquiry // Inquiry
@ -118,9 +118,9 @@ inline FSize::FSize (const FSize& s) // copy constructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FSize::FSize (FSize&& s) noexcept // move constructor inline FSize::FSize (FSize&& s) noexcept // move constructor
: width(s.width) : width(std::move(s.width))
, height(s.height) , height(std::move(s.height))
{ s.width = s.height = 0; } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FSize::FSize (std::size_t w, std::size_t h) inline FSize::FSize (std::size_t w, std::size_t h)

View File

@ -82,7 +82,7 @@ class FStartOptions final
uInt8 sgr_optimizer : 1; uInt8 sgr_optimizer : 1;
uInt8 vgafont : 1; uInt8 vgafont : 1;
uInt8 newfont : 1; uInt8 newfont : 1;
fc::encoding encoding; fc::encoding encoding{fc::UNKNOWN};
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST) #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
uInt8 meta_sends_escape : 1; uInt8 meta_sends_escape : 1;

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2019 Markus Gans * * Copyright 2019-2020 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -48,6 +48,9 @@ namespace finalcut
class FSystem class FSystem
{ {
public: public:
// Using-declaration
using fn_putc = int (*)(int);
// Constructor // Constructor
FSystem(); FSystem();
@ -64,7 +67,7 @@ class FSystem
virtual FILE* fopen (const char*, const char*) = 0; virtual FILE* fopen (const char*, const char*) = 0;
virtual int fclose (FILE*) = 0; virtual int fclose (FILE*) = 0;
virtual int putchar (int) = 0; virtual int putchar (int) = 0;
virtual int tputs (const char*, int, int (*)(int)) = 0; virtual int tputs (const char*, int, fn_putc) = 0;
virtual uid_t getuid() = 0; virtual uid_t getuid() = 0;
virtual uid_t geteuid() = 0; virtual uid_t geteuid() = 0;
virtual int getpwuid_r ( uid_t, struct passwd*, char* virtual int getpwuid_r ( uid_t, struct passwd*, char*

View File

@ -170,7 +170,7 @@ class FSystemImpl : public FSystem
#endif #endif
} }
int tputs (const char* str, int affcnt, int (*putc)(int)) override int tputs (const char* str, int affcnt, fn_putc putc) override
{ {
#if defined(__sun) && defined(__SVR4) #if defined(__sun) && defined(__SVR4)
return ::tputs ( C_STR(str) return ::tputs ( C_STR(str)

View File

@ -102,8 +102,8 @@ class FTermOpenBSD final
static bool setBeep (int, int); static bool setBeep (int, int);
static bool resetBeep(); static bool resetBeep();
private:
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST) #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
private:
// Methods // Methods
static bool saveBSDConsoleEncoding(); static bool saveBSDConsoleEncoding();
static bool setBSDConsoleEncoding (kbd_t); static bool setBSDConsoleEncoding (kbd_t);

View File

@ -147,7 +147,7 @@ class FToggleButton : public FWidget
// Methods // Methods
void init(); void init();
void drawText (FString&&, std::size_t); void drawText (const FString&, std::size_t);
void correctSize (FSize&); void correctSize (FSize&);
// Data members // Data members

View File

@ -94,7 +94,6 @@ class FToolTip : public FWindow
// Methods // Methods
void show() override; void show() override;
void hide() override;
// Event handler // Event handler
void onMouseDown (FMouseEvent*) override; void onMouseDown (FMouseEvent*) override;

View File

@ -566,12 +566,9 @@ struct FVTerm::FVTermPreprocessing
{ } { }
FVTermPreprocessing (FVTermPreprocessing&& p) noexcept // move constructor FVTermPreprocessing (FVTermPreprocessing&& p) noexcept // move constructor
: instance(p.instance) : instance(std::move(p.instance))
, function(p.function) , function(std::move(p.function))
{ { }
p.instance = nullptr;
p.function = nullptr;
}
// Overloaded operators // Overloaded operators
FVTermPreprocessing& operator = (const FVTermPreprocessing& p) FVTermPreprocessing& operator = (const FVTermPreprocessing& p)

View File

@ -313,13 +313,13 @@ class FWidget : public FVTerm, public FObject
virtual bool close(); virtual bool close();
void clearStatusbarMessage(); void clearStatusbarMessage();
void addCallback ( const FString& void addCallback ( const FString&
, FCallback , const FCallback&
, FDataPtr = nullptr ); , FDataPtr = nullptr );
void addCallback ( const FString& void addCallback ( const FString&
, FWidget* , FWidget*
, FCallback , const FCallback&
, FDataPtr = nullptr ); , FDataPtr = nullptr );
void delCallback (FCallback); void delCallback (const FCallback&);
void delCallback (const FWidget*); void delCallback (const FWidget*);
void delCallbacks(); void delCallbacks();
void emitCallback (const FString&); void emitCallback (const FString&);
@ -524,13 +524,9 @@ struct FWidget::FCallbackData
{ {
// Constructor // Constructor
FCallbackData() FCallbackData()
: cb_signal()
, cb_instance(nullptr)
, cb_function()
, data(nullptr)
{ } { }
FCallbackData (FString s, FWidget* i, FCallback c, FDataPtr d) FCallbackData (const FString& s, FWidget* i, const FCallback& c, FDataPtr d)
: cb_signal(s) : cb_signal(s)
, cb_instance(i) , cb_instance(i)
, cb_function(c) , cb_function(c)
@ -545,16 +541,11 @@ struct FWidget::FCallbackData
{ } { }
FCallbackData (FCallbackData&& c) noexcept // move constructor FCallbackData (FCallbackData&& c) noexcept // move constructor
: cb_signal(c.cb_signal) : cb_signal(std::move(c.cb_signal))
, cb_instance(c.cb_instance) , cb_instance(std::move(c.cb_instance))
, cb_function(c.cb_function) , cb_function(std::move(c.cb_function))
, data(c.data) , data(std::move(c.data))
{ { }
c.cb_signal.clear();
c.cb_instance = nullptr;
c.cb_function = nullptr;
c.data = nullptr;
}
// Destructor // Destructor
~FCallbackData() ~FCallbackData()
@ -572,14 +563,10 @@ struct FWidget::FCallbackData
FCallbackData& operator = (FCallbackData&& c) noexcept FCallbackData& operator = (FCallbackData&& c) noexcept
{ {
cb_signal = c.cb_signal; cb_signal = std::move(c.cb_signal);
cb_instance = c.cb_instance; cb_instance = std::move(c.cb_instance);
cb_function = c.cb_function; cb_function = std::move(c.cb_function);
data = c.data; data = std::move(c.data);
c.cb_signal.clear();
c.cb_instance = nullptr;
c.cb_function = nullptr;
c.data = nullptr;
return *this; return *this;
} }

1
src/libfinal.so.0 Symbolic link
View File

@ -0,0 +1 @@
libfinal.so.0.6.1

BIN
src/libfinal.so.0.6.1 Executable file

Binary file not shown.

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018-2019 Markus Gans * * Copyright 2018-2020 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -117,8 +117,8 @@ void FPointTest::moveConstructorTest()
{ {
finalcut::FPoint p1 (25, 16); finalcut::FPoint p1 (25, 16);
const finalcut::FPoint p2 (std::move(p1)); const finalcut::FPoint p2 (std::move(p1));
CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getX() == 25 );
CPPUNIT_ASSERT ( p1.getY() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 16 );
CPPUNIT_ASSERT ( p2.getX() == 25 ); CPPUNIT_ASSERT ( p2.getX() == 25 );
CPPUNIT_ASSERT ( p2.getY() == 16 ); CPPUNIT_ASSERT ( p2.getY() == 16 );
} }
@ -153,9 +153,9 @@ void FPointTest::assignmentTest()
// Move assignment operator // Move assignment operator
finalcut::FPoint p3 = std::move(p2); finalcut::FPoint p3 = std::move(p2);
CPPUNIT_ASSERT ( p2.getX() == 0 ); CPPUNIT_ASSERT ( p2.getX() == 40 );
CPPUNIT_ASSERT ( p2.getY() == 0 ); CPPUNIT_ASSERT ( p2.getY() == 12 );
CPPUNIT_ASSERT ( p2.isOrigin() ); CPPUNIT_ASSERT ( ! p2.isOrigin() );
CPPUNIT_ASSERT ( p3.getX() == 40 ); CPPUNIT_ASSERT ( p3.getX() == 40 );
CPPUNIT_ASSERT ( p3.getY() == 12 ); CPPUNIT_ASSERT ( p3.getY() == 12 );

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018-2019 Markus Gans * * Copyright 2018-2020 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -134,11 +134,11 @@ void FRectTest::moveConstructorTest()
{ {
finalcut::FRect r1(3, 3, 15, 7); finalcut::FRect r1(3, 3, 15, 7);
const finalcut::FRect r2 (std::move(r1)); const finalcut::FRect r2 (std::move(r1));
CPPUNIT_ASSERT ( r1.getX() == 0 ); CPPUNIT_ASSERT ( r1.getX() == 3 );
CPPUNIT_ASSERT ( r1.getY() == 0 ); CPPUNIT_ASSERT ( r1.getY() == 3 );
CPPUNIT_ASSERT ( r1.isEmpty() ); CPPUNIT_ASSERT ( ! r1.isEmpty() );
CPPUNIT_ASSERT ( r1.getWidth() == 0 ); CPPUNIT_ASSERT ( r1.getWidth() == 15 );
CPPUNIT_ASSERT ( r1.getHeight() == 0 ); CPPUNIT_ASSERT ( r1.getHeight() == 7 );
CPPUNIT_ASSERT ( r2.getX() == 3 ); CPPUNIT_ASSERT ( r2.getX() == 3 );
CPPUNIT_ASSERT ( r2.getY() == 3 ); CPPUNIT_ASSERT ( r2.getY() == 3 );
CPPUNIT_ASSERT ( ! r2.isEmpty() ); CPPUNIT_ASSERT ( ! r2.isEmpty() );
@ -359,15 +359,15 @@ void FRectTest::assignmentTest()
finalcut::FRect r6; finalcut::FRect r6;
r6 = std::move(r5); // Move assignment operator r6 = std::move(r5); // Move assignment operator
CPPUNIT_ASSERT ( r5.getX1() == 0 ); CPPUNIT_ASSERT ( r5.getX1() == 2 );
CPPUNIT_ASSERT ( r5.getY1() == 0 ); CPPUNIT_ASSERT ( r5.getY1() == 9 );
CPPUNIT_ASSERT ( r5.getX2() == -1 ); CPPUNIT_ASSERT ( r5.getX2() == 11 );
CPPUNIT_ASSERT ( r5.getY2() == -1 ); CPPUNIT_ASSERT ( r5.getY2() == 18 );
CPPUNIT_ASSERT ( r5.isEmpty() ); CPPUNIT_ASSERT ( ! r5.isEmpty() );
CPPUNIT_ASSERT ( r5.getWidth() == 0 ); CPPUNIT_ASSERT ( r5.getWidth() == 10 );
CPPUNIT_ASSERT ( r5.getHeight() == 0 ); CPPUNIT_ASSERT ( r5.getHeight() == 10 );
CPPUNIT_ASSERT ( r5.getSize() == finalcut::FSize(0, 0) ); CPPUNIT_ASSERT ( r5.getSize() == finalcut::FSize(10, 10) );
CPPUNIT_ASSERT ( r5.getPos() == finalcut::FPoint(0, 0) ); CPPUNIT_ASSERT ( r5.getPos() == finalcut::FPoint(2, 9) );
CPPUNIT_ASSERT ( r6.getX1() == 2 ); CPPUNIT_ASSERT ( r6.getX1() == 2 );
CPPUNIT_ASSERT ( r6.getY1() == 9 ); CPPUNIT_ASSERT ( r6.getY1() == 9 );
CPPUNIT_ASSERT ( r6.getX2() == 11 ); CPPUNIT_ASSERT ( r6.getX2() == 11 );

View File

@ -122,9 +122,9 @@ void FSizeTest::moveConstructorTest()
{ {
finalcut::FSize s1 (120, 36); finalcut::FSize s1 (120, 36);
const finalcut::FSize s2 (std::move(s1)); const finalcut::FSize s2 (std::move(s1));
CPPUNIT_ASSERT ( s1.getWidth() == 0 ); CPPUNIT_ASSERT ( s1.getWidth() == 120 );
CPPUNIT_ASSERT ( s1.getHeight() == 0 ); CPPUNIT_ASSERT ( s1.getHeight() == 36 );
CPPUNIT_ASSERT ( s1.isEmpty() ); CPPUNIT_ASSERT ( ! s1.isEmpty() );
CPPUNIT_ASSERT ( s2.getWidth() == 120 ); CPPUNIT_ASSERT ( s2.getWidth() == 120 );
CPPUNIT_ASSERT ( s2.getHeight() == 36 ); CPPUNIT_ASSERT ( s2.getHeight() == 36 );
} }
@ -161,9 +161,9 @@ void FSizeTest::assignmentTest()
// Move assignment operator // Move assignment operator
finalcut::FSize s3; finalcut::FSize s3;
s3 = std::move(s2); s3 = std::move(s2);
CPPUNIT_ASSERT ( s2.getWidth() == 0 ); CPPUNIT_ASSERT ( s2.getWidth() == 5 );
CPPUNIT_ASSERT ( s2.getHeight() == 0 ); CPPUNIT_ASSERT ( s2.getHeight() == 4 );
CPPUNIT_ASSERT ( s2.isEmpty() ); CPPUNIT_ASSERT ( ! s2.isEmpty() );
CPPUNIT_ASSERT ( s3.getWidth() == 5 ); CPPUNIT_ASSERT ( s3.getWidth() == 5 );
CPPUNIT_ASSERT ( s3.getHeight() == 4 ); CPPUNIT_ASSERT ( s3.getHeight() == 4 );