Further small code improvements
This commit is contained in:
parent
136b57eac6
commit
d08dd8e9f4
|
@ -59,9 +59,6 @@ class SegmentView final : public finalcut::FDialog
|
|||
unsigned char : 1; // padding bit
|
||||
} sevenSegment;
|
||||
|
||||
// Mutator
|
||||
void setGeometry (const FRect&, bool = true) override;
|
||||
|
||||
// Methods
|
||||
void hexEncoding();
|
||||
void get7Segment (const wchar_t);
|
||||
|
@ -79,13 +76,15 @@ class SegmentView final : public finalcut::FDialog
|
|||
SegmentView::SegmentView (finalcut::FWidget* 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
|
||||
hexEncoding();
|
||||
|
||||
// Dialog settings
|
||||
setText ("Seven-segment display");
|
||||
setGeometry (FPoint(25, 5), FSize(42, 15));
|
||||
|
||||
// Input field
|
||||
Input.setGeometry (FPoint(2, 2), FSize(12, 1));
|
||||
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()
|
||||
{
|
||||
|
|
|
@ -57,9 +57,6 @@ class Background final : public finalcut::FDialog
|
|||
Background& operator = (const Background&) = delete;
|
||||
|
||||
private:
|
||||
// Mutator
|
||||
void setGeometry (const FRect&, bool = true) override;
|
||||
|
||||
// Callback method
|
||||
void cb_changed (const finalcut::FWidget*, const FDataPtr);
|
||||
void cb_choice (const finalcut::FWidget*, const FDataPtr);
|
||||
|
@ -98,8 +95,10 @@ Background::Background (finalcut::FWidget* parent)
|
|||
: FDialog(parent)
|
||||
{
|
||||
// Dialog settings
|
||||
setText ("Background color palette");
|
||||
setGeometry (FPoint(25, 5), FSize(32, 12));
|
||||
// Avoids calling a virtual function from the constructor
|
||||
// (CERT, OOP50-CPP)
|
||||
FDialog::setText ("Background color palette");
|
||||
FDialog::setGeometry (FPoint(25, 5), FSize(32, 12));
|
||||
|
||||
// Combobox
|
||||
color_choice.setGeometry (FPoint(2, 2), FSize(18, 1));
|
||||
|
@ -175,14 +174,6 @@ Background::Background (finalcut::FWidget* parent)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -119,9 +119,6 @@ class Calc final : public finalcut::FDialog
|
|||
// Destructor
|
||||
~Calc() override;
|
||||
|
||||
// Mutator
|
||||
void setGeometry (const FRect&, bool = true) override;
|
||||
|
||||
// Event handlers
|
||||
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||
void onClose (finalcut::FCloseEvent*) override;
|
||||
|
@ -249,11 +246,15 @@ class Calc final : public finalcut::FDialog
|
|||
Calc::Calc (FWidget* 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();
|
||||
clearInfixOperator();
|
||||
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++)
|
||||
{
|
||||
|
@ -306,14 +307,6 @@ Calc::Calc (FWidget* parent)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -55,9 +55,6 @@ class CheckList final : public finalcut::FDialog
|
|||
// Disable copy assignment operator (=)
|
||||
CheckList& operator = (const CheckList&) = delete;
|
||||
|
||||
// Mutator
|
||||
void setGeometry (const FRect&, bool = true) override;
|
||||
|
||||
private:
|
||||
// Method
|
||||
void populate();
|
||||
|
@ -78,11 +75,14 @@ class CheckList final : public finalcut::FDialog
|
|||
CheckList::CheckList (finalcut::FWidget* parent)
|
||||
: finalcut::FDialog(parent)
|
||||
{
|
||||
setText (L"Shopping list");
|
||||
setShadow();
|
||||
// Dialog settings
|
||||
// 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;
|
||||
setGeometry ( FPoint(int(1 + (parent->getWidth() - 28) / 2), 5)
|
||||
FDialog::setGeometry ( FPoint(int(1 + (parent->getWidth() - 28) / 2), 5)
|
||||
, FSize(28 + nf_offset, 13) );
|
||||
setShadow();
|
||||
listView.ignorePadding();
|
||||
listView.setGeometry ( FPoint(1 + int(nf_offset), 2)
|
||||
, FSize(getWidth() - nf_offset, getHeight() - 1) );
|
||||
|
@ -118,14 +118,6 @@ CheckList::CheckList (finalcut::FWidget* parent)
|
|||
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()
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ class Mandelbrot final : public finalcut::FDialog
|
|||
Mandelbrot::Mandelbrot (finalcut::FWidget* parent)
|
||||
: finalcut::FDialog(parent)
|
||||
{
|
||||
setText ("Mandelbrot set");
|
||||
FDialog::setText ("Mandelbrot set");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -82,8 +82,8 @@ ColorChooser::ColorChooser (finalcut::FWidget* parent)
|
|||
{
|
||||
const FColor fg = parent->getForegroundColor();
|
||||
const FColor bg = parent->getBackgroundColor();
|
||||
setForegroundColor(fg);
|
||||
setBackgroundColor(bg);
|
||||
FWidget::setForegroundColor(fg);
|
||||
FWidget::setBackgroundColor(bg);
|
||||
headline.setForegroundColor(fg);
|
||||
headline.setBackgroundColor(bg);
|
||||
}
|
||||
|
@ -236,8 +236,8 @@ Brushes::Brushes (finalcut::FWidget* parent)
|
|||
{
|
||||
const FColor fg = parent->getForegroundColor();
|
||||
const FColor bg = parent->getBackgroundColor();
|
||||
setForegroundColor(fg);
|
||||
setBackgroundColor(bg);
|
||||
FWidget::setForegroundColor(fg);
|
||||
FWidget::setBackgroundColor(bg);
|
||||
headline.setForegroundColor(fg);
|
||||
headline.setBackgroundColor(bg);
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ class MouseDraw final : public finalcut::FDialog
|
|||
MouseDraw::MouseDraw (finalcut::FWidget* parent)
|
||||
: finalcut::FDialog(parent)
|
||||
{
|
||||
setText ("Drawing with the mouse");
|
||||
FDialog::setText ("Drawing with the mouse");
|
||||
c_chooser.setPos (FPoint(1, 1));
|
||||
c_chooser.addCallback
|
||||
(
|
||||
|
|
|
@ -84,7 +84,7 @@ RotoZoomer::RotoZoomer (finalcut::FWidget* parent, bool b, int l)
|
|||
, benchmark(b)
|
||||
, loops(l)
|
||||
{
|
||||
setText ("Rotozoomer effect");
|
||||
FDialog::setText ("Rotozoomer effect");
|
||||
|
||||
int h{0};
|
||||
|
||||
|
|
|
@ -216,8 +216,8 @@ class Scrollviewdemo final : public finalcut::FDialog
|
|||
Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent)
|
||||
: finalcut::FDialog(parent)
|
||||
{
|
||||
setGeometry (FPoint(16, 3), FSize(50, 19));
|
||||
setText ("Scrolling viewport example");
|
||||
FDialog::setGeometry (FPoint(16, 3), FSize(50, 19));
|
||||
FDialog::setText ("Scrolling viewport example");
|
||||
|
||||
// The scrolling viewport widget
|
||||
sview.setGeometry(FPoint(3, 2), FSize(44, 12));
|
||||
|
|
|
@ -222,15 +222,15 @@ void streamToInterger()
|
|||
finalcut::FString("-321") >> stream_int;
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -246,15 +246,15 @@ void streamToUnsignedInterger()
|
|||
finalcut::FString("123") >> stream_uint;
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -270,11 +270,15 @@ void streamToDouble()
|
|||
finalcut::FString("0.123456e+2") >> stream_double;
|
||||
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;
|
||||
}
|
||||
|
@ -290,11 +294,15 @@ void streamToFloat()
|
|||
finalcut::FString("0.123e-3") >> stream_float;
|
||||
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;
|
||||
}
|
||||
|
@ -486,11 +494,15 @@ void convertToNumberExample()
|
|||
const uLong ulong_num = finalcut::FString("123456789").toULong();
|
||||
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;
|
||||
}
|
||||
|
@ -501,11 +513,15 @@ void convertToNumberExample()
|
|||
const long long_num = finalcut::FString("-9876543210").toLong();
|
||||
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;
|
||||
}
|
||||
|
@ -522,11 +538,15 @@ void convertToNumberExample()
|
|||
<< double_num << std::endl;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class AttribDlg final : public finalcut::FDialog
|
|||
void adjustSize() override;
|
||||
|
||||
// Data members
|
||||
FColor bgcolor;
|
||||
FColor bgcolor{getFWidgetColors().label_bg};
|
||||
finalcut::FButton next_button{"&Next >", this};
|
||||
finalcut::FButton back_button{"< &Back", this};
|
||||
};
|
||||
|
@ -74,9 +74,8 @@ class AttribDlg final : public finalcut::FDialog
|
|||
//----------------------------------------------------------------------
|
||||
AttribDlg::AttribDlg (finalcut::FWidget* parent)
|
||||
: finalcut::FDialog(parent)
|
||||
, bgcolor(getFWidgetColors().label_bg)
|
||||
{
|
||||
setText ( "A terminal attributes test ("
|
||||
FDialog::setText ( "A terminal attributes test ("
|
||||
+ finalcut::FString(getTermType())
|
||||
+ ")");
|
||||
|
||||
|
|
|
@ -189,8 +189,8 @@ class MainWindow final : public finalcut::FDialog
|
|||
}
|
||||
|
||||
// Data members
|
||||
finalcut::FString line1{};
|
||||
finalcut::FString line2{};
|
||||
finalcut::FString line1{" .-. .-. .-."};
|
||||
finalcut::FString line2{"`._.' `._.' `._.' "};
|
||||
Transparent* transpwin{nullptr};
|
||||
Transparent* shadowwin{nullptr};
|
||||
Transparent* ibg{nullptr};
|
||||
|
@ -202,9 +202,6 @@ class MainWindow final : public finalcut::FDialog
|
|||
MainWindow::MainWindow (finalcut::FWidget* parent)
|
||||
: FDialog(parent)
|
||||
{
|
||||
line1 = " .-. .-. .-.";
|
||||
line2 = "`._.' `._.' `._.' ";
|
||||
|
||||
// The memory allocation for the following three sub windows occurs
|
||||
// with the operator new. The lifetime of the generated widget
|
||||
// is managed by the parent object (this). The operator delete
|
||||
|
|
|
@ -57,9 +57,6 @@ class ProgressDialog final : public finalcut::FDialog
|
|||
// Disable copy assignment operator (=)
|
||||
ProgressDialog& operator = (const ProgressDialog&) = delete;
|
||||
|
||||
// Mutator
|
||||
void setGeometry (const FRect&, bool = true) override;
|
||||
|
||||
private:
|
||||
// Event handlers
|
||||
void onShow (finalcut::FShowEvent*) override;
|
||||
|
@ -81,9 +78,12 @@ class ProgressDialog final : public finalcut::FDialog
|
|||
ProgressDialog::ProgressDialog (finalcut::FWidget* 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) );
|
||||
setText("Progress bar");
|
||||
FDialog::setText("Progress bar");
|
||||
//setModal();
|
||||
|
||||
reset.setText("&Reset");
|
||||
|
@ -132,14 +132,6 @@ ProgressDialog::~ProgressDialog() // destructor
|
|||
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*)
|
||||
{
|
||||
|
@ -150,7 +142,8 @@ void ProgressDialog::onShow (finalcut::FShowEvent*)
|
|||
void ProgressDialog::onTimer (finalcut::FTimerEvent*)
|
||||
{
|
||||
auto p = progressBar.getPercentage();
|
||||
progressBar.setPercentage(++p);
|
||||
p++;
|
||||
progressBar.setPercentage(p);
|
||||
flush();
|
||||
|
||||
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)
|
||||
{
|
||||
auto p = progressBar.getPercentage();
|
||||
progressBar.setPercentage(++p);
|
||||
p++;
|
||||
progressBar.setPercentage(p);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -279,6 +273,7 @@ class MyDialog final : public finalcut::FDialog
|
|||
|
||||
private:
|
||||
// Methods
|
||||
void init();
|
||||
void initMenu();
|
||||
void initMenuCallbacks();
|
||||
void initFileMenuCallbacks();
|
||||
|
@ -375,6 +370,16 @@ class MyDialog final : public finalcut::FDialog
|
|||
//----------------------------------------------------------------------
|
||||
MyDialog::MyDialog (finalcut::FWidget* parent)
|
||||
: finalcut::FDialog(parent)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
MyDialog::~MyDialog() // destructor
|
||||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void MyDialog::init()
|
||||
{
|
||||
initMenu(); // Initialize the program menu
|
||||
initMenuCallbacks(); // Initialize program menu callbacks
|
||||
|
@ -384,10 +389,6 @@ MyDialog::MyDialog (finalcut::FWidget* parent)
|
|||
initialized = true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
MyDialog::~MyDialog() // destructor
|
||||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void MyDialog::initMenu()
|
||||
{
|
||||
|
|
|
@ -75,7 +75,10 @@ class Watch final : public finalcut::FDialog
|
|||
Watch::Watch (FWidget* 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());
|
||||
FDialog::setGeometry (FPoint(1 + (pw - 22) / 2, 3), FSize(22, 13));
|
||||
|
||||
|
|
|
@ -201,8 +201,8 @@ class Window final : public finalcut::FDialog
|
|||
void configureDialogButtons();
|
||||
void activateWindow (finalcut::FDialog*);
|
||||
void adjustSize() override;
|
||||
void addClickedCallback (finalcut::FWidget*, WindowCallback);
|
||||
void addClickedCallback (finalcut::FWidget*, FAppCallback);
|
||||
template<typename CallbackT>
|
||||
void addClickedCallback (finalcut::FWidget*, CallbackT);
|
||||
template <typename IteratorT>
|
||||
finalcut::FDialog* getNext (IteratorT);
|
||||
template <typename IteratorT>
|
||||
|
@ -373,22 +373,9 @@ void Window::adjustSize()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
template<typename CallbackT>
|
||||
void Window::addClickedCallback ( finalcut::FWidget* widget
|
||||
, WindowCallback call )
|
||||
{
|
||||
FMemberCallback callback
|
||||
= reinterpret_cast<FMemberCallback>(call);
|
||||
|
||||
widget->addCallback
|
||||
(
|
||||
"clicked",
|
||||
F_METHOD_CALLBACK (this, callback)
|
||||
);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void Window::addClickedCallback ( finalcut::FWidget* widget
|
||||
, FAppCallback call )
|
||||
, CallbackT call )
|
||||
{
|
||||
FMemberCallback callback
|
||||
= reinterpret_cast<FMemberCallback>(call);
|
||||
|
|
|
@ -3,4 +3,5 @@ sonar.projectName=finalcut
|
|||
sonar.projectVersion=0.6.1
|
||||
sonar.sources=.
|
||||
sonar.cfamily.build-wrapper-output=bw-output
|
||||
sonar.exclusions=src/include/final/fconfig.h
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ bool sortByName ( const FFileDialog::dir_entry& lhs
|
|||
, const FFileDialog::dir_entry& 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;
|
||||
}
|
||||
|
||||
if ( S_ISLNK(sb.st_mode) )
|
||||
{
|
||||
if ( lstat(dirname, &sb) != 0 )
|
||||
if ( S_ISLNK(sb.st_mode) && lstat(dirname, &sb) != 0 )
|
||||
{
|
||||
directory = '/';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! S_ISDIR(sb.st_mode) )
|
||||
{
|
||||
|
@ -446,10 +443,6 @@ void FFileDialog::clear()
|
|||
if ( dir_entries.empty() )
|
||||
return;
|
||||
|
||||
// delete all directory entries;
|
||||
for (auto&& entry : dir_entries)
|
||||
std::free (entry.name);
|
||||
|
||||
dir_entries.clear();
|
||||
dir_entries.shrink_to_fit();
|
||||
}
|
||||
|
@ -465,7 +458,7 @@ sInt64 FFileDialog::numOfDirs()
|
|||
, [] (const dir_entry& entry)
|
||||
{
|
||||
return entry.directory
|
||||
&& std::strcmp(entry.name, ".") != 0;
|
||||
&& std::strcmp(entry.name.c_str(), ".") != 0;
|
||||
}
|
||||
);
|
||||
return n;
|
||||
|
@ -476,7 +469,7 @@ void FFileDialog::sortDir()
|
|||
{
|
||||
sInt64 start{0};
|
||||
|
||||
if ( std::strcmp((*dir_entries.begin()).name, "..") == 0 )
|
||||
if ( std::strcmp((*dir_entries.begin()).name.c_str(), "..") == 0 )
|
||||
start = 1;
|
||||
|
||||
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();
|
||||
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
|
||||
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 )
|
||||
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);
|
||||
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));
|
||||
symLink[sizeof(symLink) - 1] = '\0';
|
||||
std::strncat ( symLink
|
||||
, entry.name
|
||||
, entry.name.c_str()
|
||||
, sizeof(symLink) - std::strlen(symLink) - 1);
|
||||
symLink[sizeof(symLink) - 1] = '\0';
|
||||
|
||||
|
@ -655,7 +648,7 @@ void FFileDialog::selectDirectoryEntry (const char* const name)
|
|||
|
||||
for (auto&& entry : dir_entries)
|
||||
{
|
||||
if ( std::strcmp(entry.name, name) == 0 )
|
||||
if ( std::strcmp(entry.name.c_str(), name) == 0 )
|
||||
{
|
||||
filebrowser.setCurrentItem(i);
|
||||
filename.setText(FString(name) + '/');
|
||||
|
@ -793,10 +786,10 @@ void FFileDialog::cb_processActivate (const FWidget*, const FDataPtr)
|
|||
, std::end(dir_entries)
|
||||
, [&input] (const dir_entry& entry)
|
||||
{
|
||||
return entry.name
|
||||
return entry.name.c_str()
|
||||
&& input
|
||||
&& ! input.isNull()
|
||||
&& std::strcmp(entry.name, input) == 0
|
||||
&& std::strcmp(entry.name.c_str(), input) == 0
|
||||
&& entry.directory;
|
||||
}
|
||||
);
|
||||
|
|
|
@ -255,11 +255,12 @@ inline FKey FKeyboard::getMetaKey()
|
|||
{
|
||||
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] == ']' )
|
||||
&& ! isKeypressTimeout() )
|
||||
{
|
||||
if ( ! isKeypressTimeout() )
|
||||
return fc::Fkey_incomplete;
|
||||
}
|
||||
|
||||
|
|
|
@ -271,11 +271,13 @@ void FLabel::setHotkeyAccelerator()
|
|||
std::size_t FLabel::getAlignOffset (const std::size_t length)
|
||||
{
|
||||
const std::size_t width(getWidth());
|
||||
assert ( alignment == fc::alignLeft
|
||||
|| alignment == fc::alignCenter
|
||||
|| alignment == fc::alignRight );
|
||||
|
||||
switch ( alignment )
|
||||
{
|
||||
case fc::alignLeft:
|
||||
default:
|
||||
return 0;
|
||||
|
||||
case fc::alignCenter:
|
||||
|
@ -357,7 +359,7 @@ void FLabel::drawMultiLine()
|
|||
else
|
||||
align_offset = getAlignOffset(length);
|
||||
|
||||
printLine (std::move(label_text));
|
||||
printLine (label_text);
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
@ -374,11 +376,11 @@ void FLabel::drawSingleLine()
|
|||
|
||||
print() << FPoint(1, 1);
|
||||
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_column{};
|
||||
|
|
|
@ -627,18 +627,15 @@ void FLineEdit::adjustLabel()
|
|||
assert ( label_orientation == label_above
|
||||
|| label_orientation == label_left );
|
||||
|
||||
switch ( label_orientation )
|
||||
if ( label_orientation == label_above )
|
||||
{
|
||||
case label_above:
|
||||
label->setGeometry ( FPoint(w->getX(), w->getY() - 1)
|
||||
, FSize(label_width, 1) );
|
||||
break;
|
||||
|
||||
case label_left:
|
||||
default:
|
||||
}
|
||||
else if ( label_orientation == label_left )
|
||||
{
|
||||
label->setGeometry ( FPoint(w->getX() - int(label_width) - 1, w->getY())
|
||||
, FSize(label_width, 1) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -745,19 +742,21 @@ void FLineEdit::drawInputField()
|
|||
if ( isActiveFocus && getMaxColor() < 16 )
|
||||
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 )
|
||||
{
|
||||
case FLineEdit::textfield:
|
||||
default:
|
||||
return printTextField();
|
||||
|
||||
case FLineEdit::password:
|
||||
return printPassword();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return std::size_t(0);
|
||||
}();
|
||||
|
||||
while ( x_pos + 1 < getWidth() )
|
||||
|
@ -817,13 +816,12 @@ inline std::size_t FLineEdit::printPassword()
|
|||
//----------------------------------------------------------------------
|
||||
inline std::size_t FLineEdit::getCursorColumnPos()
|
||||
{
|
||||
switch ( input_type )
|
||||
if ( input_type == FLineEdit::textfield )
|
||||
{
|
||||
case FLineEdit::textfield:
|
||||
default:
|
||||
return getColumnWidth (print_text, cursor_pos);
|
||||
|
||||
case FLineEdit::password:
|
||||
}
|
||||
else if ( input_type == FLineEdit::password )
|
||||
{
|
||||
return cursor_pos;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 bool has_brackets(listItem.brackets);
|
||||
|
@ -374,9 +374,9 @@ void FListBox::onMouseUp (FMouseEvent* ev)
|
|||
const int mouse_y = ev->getY();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -1754,11 +1754,18 @@ void FListBox::cb_vbarChange (const FWidget*, const FDataPtr)
|
|||
int distance{1};
|
||||
const int yoffset_before = yoffset;
|
||||
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 )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
@ -1818,11 +1825,18 @@ void FListBox::cb_hbarChange (const FWidget*, const FDataPtr)
|
|||
int distance{1};
|
||||
const int xoffset_before = xoffset;
|
||||
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 )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
|
|
@ -94,10 +94,18 @@ uInt64 firstNumberFromString (const FString& str)
|
|||
{
|
||||
number = uInt64(num_str.toLong());
|
||||
}
|
||||
catch (const std::exception&)
|
||||
catch (const std::invalid_argument&)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -504,14 +512,10 @@ FListViewIterator::FListViewIterator (const FListViewIterator& i)
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
FListViewIterator::FListViewIterator (FListViewIterator&& i) noexcept
|
||||
: iter_path(i.iter_path) // move constructor
|
||||
, node(i.node)
|
||||
, position(i.position)
|
||||
{
|
||||
i.iter_path = iterator_stack{};
|
||||
i.node = iterator{};
|
||||
i.position = 0;
|
||||
}
|
||||
: iter_path(std::move(i.iter_path)) // move constructor
|
||||
, node(std::move(i.node))
|
||||
, position(std::move(i.position))
|
||||
{ }
|
||||
|
||||
// FListViewIterator operators
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -526,12 +530,9 @@ FListViewIterator& FListViewIterator::operator = (const FListViewIterator& i)
|
|||
//----------------------------------------------------------------------
|
||||
FListViewIterator& FListViewIterator::operator = (FListViewIterator&& i) noexcept
|
||||
{
|
||||
iter_path = i.iter_path;
|
||||
node = i.node;
|
||||
position = i.position;
|
||||
i.iter_path = iterator_stack{};
|
||||
i.node = iterator{};
|
||||
i.position = 0;
|
||||
iter_path = std::move(i.iter_path);
|
||||
node = std::move(i.node);
|
||||
position = std::move(i.position);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1014,11 +1015,16 @@ void FListView::sort()
|
|||
if ( sort_column < 1 && sort_column > int(header.size()) )
|
||||
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::by_name:
|
||||
default:
|
||||
if ( sort_order == fc::ascending )
|
||||
{
|
||||
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 width )
|
||||
{
|
||||
assert ( align == fc::alignLeft
|
||||
|| align == fc::alignCenter
|
||||
|| align == fc::alignRight );
|
||||
|
||||
switch ( align )
|
||||
{
|
||||
case fc::alignLeft:
|
||||
default:
|
||||
return 0;
|
||||
|
||||
case fc::alignCenter:
|
||||
|
@ -2855,11 +2864,18 @@ void FListView::cb_vbarChange (const FWidget*, const FDataPtr)
|
|||
static constexpr int wheel_distance = 4;
|
||||
int distance{1};
|
||||
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 )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
@ -2915,11 +2931,18 @@ void FListView::cb_hbarChange (const FWidget*, const FDataPtr)
|
|||
static constexpr int wheel_distance = 4;
|
||||
int distance{1};
|
||||
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 )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
|
|
@ -678,18 +678,19 @@ void FMenu::hideSuperMenus()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FMenu::mouseDownOverList (FPoint mouse_pos)
|
||||
bool FMenu::mouseDownOverList (const FPoint& mouse_pos)
|
||||
{
|
||||
bool focus_changed{false};
|
||||
mouse_pos -= FPoint(getRightPadding(), getTopPadding());
|
||||
FPoint pos{mouse_pos};
|
||||
pos -= FPoint(getRightPadding(), getTopPadding());
|
||||
|
||||
for (auto&& item : getItemList())
|
||||
{
|
||||
const int x1 = item->getX();
|
||||
const int x2 = item->getX() + int(item->getWidth());
|
||||
const int y = item->getY();
|
||||
const int mouse_x = mouse_pos.getX();
|
||||
const int mouse_y = mouse_pos.getY();
|
||||
const int mouse_x = pos.getX();
|
||||
const int mouse_y = pos.getY();
|
||||
|
||||
if ( mouse_x >= x1
|
||||
&& 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())
|
||||
{
|
||||
const int x1 = item->getX();
|
||||
const int x2 = item->getX() + int(item->getWidth());
|
||||
const int y = item->getY();
|
||||
const int mouse_x = mouse_pos.getX();
|
||||
const int mouse_y = mouse_pos.getY();
|
||||
const int mouse_x = pos.getX();
|
||||
const int mouse_y = pos.getY();
|
||||
|
||||
if ( item->isSelected()
|
||||
&& 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())
|
||||
{
|
||||
const int x1 = item->getX();
|
||||
const int x2 = item->getX() + int(item->getWidth());
|
||||
const int y = item->getY();
|
||||
const int mouse_x = mouse_pos.getX();
|
||||
const int mouse_y = mouse_pos.getY();
|
||||
const int mouse_x = pos.getX();
|
||||
const int mouse_y = pos.getY();
|
||||
|
||||
if ( mouse_x >= x1 && mouse_x < x2 && mouse_y == y )
|
||||
mouseMoveSelection (item, ms);
|
||||
|
@ -1367,16 +1370,14 @@ inline void FMenu::drawMenuText (menuText& data)
|
|||
|
||||
for (std::size_t z{0}; z < data.text.getLength(); z++)
|
||||
{
|
||||
if ( ! std::iswprint(std::wint_t(data.text[z])) )
|
||||
{
|
||||
if ( ! isNewFont()
|
||||
if ( ! std::iswprint(std::wint_t(data.text[z]))
|
||||
&& ! isNewFont()
|
||||
&& ( data.text[z] < fc::NF_rev_left_arrow2
|
||||
|| data.text[z] > fc::NF_check_mark )
|
||||
&& ! charEncodable(wchar_t(data.text[z])) )
|
||||
{
|
||||
data.text[z] = L' ';
|
||||
}
|
||||
}
|
||||
|
||||
if ( z == data.hotkeypos )
|
||||
{
|
||||
|
|
|
@ -596,15 +596,13 @@ inline void FMenuBar::drawMenuText (menuText& data)
|
|||
if ( data.startpos > screenWidth - z )
|
||||
break;
|
||||
|
||||
if ( ! std::iswprint(std::wint_t(data.text[z])) )
|
||||
{
|
||||
if ( ! isNewFont()
|
||||
if ( ! std::iswprint(std::wint_t(data.text[z]))
|
||||
&& ! isNewFont()
|
||||
&& ( data.text[z] < fc::NF_rev_left_arrow2
|
||||
|| data.text[z] > fc::NF_check_mark ) )
|
||||
{
|
||||
data.text[z] = L' ';
|
||||
}
|
||||
}
|
||||
|
||||
if ( z == data.hotkeypos )
|
||||
{
|
||||
|
@ -849,12 +847,9 @@ void FMenuBar::mouseUpOverList (const FMouseEvent* ev)
|
|||
&& item->isSelected() )
|
||||
{
|
||||
// Mouse pointer over item
|
||||
if ( ! activateMenu(item) )
|
||||
{
|
||||
if ( clickItem(item) )
|
||||
if ( ! activateMenu(item) && clickItem(item) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unselectMenuItem(item);
|
||||
|
|
|
@ -684,9 +684,11 @@ void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev
|
|||
break;
|
||||
|
||||
case fc::MouseMove_Event:
|
||||
default:
|
||||
widget->onMouseMove(_ev.get());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -180,17 +180,22 @@ inline bool FMouse::isInputDataPending()
|
|||
//----------------------------------------------------------------------
|
||||
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 )
|
||||
{
|
||||
case none:
|
||||
default:
|
||||
return nullptr;
|
||||
|
||||
case gpm:
|
||||
#ifdef F_HAVE_LIBGPM
|
||||
return new FMouseGPM;
|
||||
#else
|
||||
break;
|
||||
return nullptr;
|
||||
#endif
|
||||
|
||||
case x11:
|
||||
|
@ -203,7 +208,7 @@ inline FMouse* FMouse::createMouseObject (const mouse_type mt)
|
|||
return new FMouseUrxvt;
|
||||
}
|
||||
|
||||
return new FMouseX11;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -490,15 +490,13 @@ char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
|
|||
check_boundaries (xold, yold, xnew, ynew);
|
||||
|
||||
// Method 0: direct cursor addressing
|
||||
if ( isMethod0Faster(move_time, xnew, ynew) )
|
||||
{
|
||||
if ( xold < 0
|
||||
if ( isMethod0Faster(move_time, xnew, ynew)
|
||||
&& ( xold < 0
|
||||
|| yold < 0
|
||||
|| isWideMove (xold, yold, xnew, ynew) )
|
||||
|| isWideMove (xold, yold, xnew, ynew) ) )
|
||||
{
|
||||
return ( move_time < LONG_DURATION ) ? move_buf : nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Method 1: local movement
|
||||
if ( isMethod1Faster(move_time, xold, yold, xnew, ynew) )
|
||||
|
|
|
@ -44,9 +44,8 @@ FPoint& FPoint::operator = (const FPoint& p)
|
|||
//----------------------------------------------------------------------
|
||||
FPoint& FPoint::operator = (FPoint&& p) noexcept
|
||||
{
|
||||
xpos = p.xpos;
|
||||
ypos = p.ypos;
|
||||
p.xpos = p.ypos = 0;
|
||||
xpos = std::move(p.xpos);
|
||||
ypos = std::move(p.ypos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,12 +69,10 @@ FRect& FRect::operator = (const FRect& r)
|
|||
//----------------------------------------------------------------------
|
||||
FRect& FRect::operator = (FRect&& r) noexcept
|
||||
{
|
||||
X1 = r.X1;
|
||||
Y1 = r.Y1;
|
||||
X2 = r.X2;
|
||||
Y2 = r.Y2;
|
||||
r.X1 = r.Y1 = 0;
|
||||
r.X2 = r.Y2 = -1;
|
||||
X1 = std::move(r.X1);
|
||||
Y1 = std::move(r.Y1);
|
||||
X2 = std::move(r.X2);
|
||||
Y2 = std::move(r.Y2);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -202,14 +202,11 @@ void FScrollView::setPos (const FPoint& p, bool adjust)
|
|||
scroll_geometry.setPos ( getTermX() + getLeftPadding() - 1
|
||||
, getTermY() + getTopPadding() - 1 );
|
||||
|
||||
if ( ! adjust )
|
||||
{
|
||||
if ( viewport )
|
||||
if ( ! adjust && viewport )
|
||||
{
|
||||
viewport->offset_left = scroll_geometry.getX();
|
||||
viewport->offset_top = scroll_geometry.getY();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -790,10 +787,13 @@ void FScrollView::calculateScrollbarPos()
|
|||
//----------------------------------------------------------------------
|
||||
void FScrollView::setHorizontalScrollBarVisibility()
|
||||
{
|
||||
assert ( v_mode == fc::Auto
|
||||
|| v_mode == fc::Hidden
|
||||
|| v_mode == fc::Scroll );
|
||||
|
||||
switch ( h_mode )
|
||||
{
|
||||
case fc::Auto:
|
||||
default:
|
||||
if ( getScrollWidth() > getViewportWidth() )
|
||||
hbar->show();
|
||||
else
|
||||
|
@ -813,10 +813,13 @@ void FScrollView::setHorizontalScrollBarVisibility()
|
|||
//----------------------------------------------------------------------
|
||||
void FScrollView::setVerticalScrollBarVisibility()
|
||||
{
|
||||
assert ( v_mode == fc::Auto
|
||||
|| v_mode == fc::Hidden
|
||||
|| v_mode == fc::Scroll );
|
||||
|
||||
switch ( v_mode )
|
||||
{
|
||||
case fc::Auto:
|
||||
default:
|
||||
if ( getScrollHeight() > getViewportHeight() )
|
||||
vbar->show();
|
||||
else
|
||||
|
@ -859,6 +862,14 @@ void FScrollView::cb_vbarChange (const FWidget*, const FDataPtr)
|
|||
FScrollbar::sType scrollType = vbar->getScrollType();
|
||||
static constexpr int wheel_distance = 4;
|
||||
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 )
|
||||
{
|
||||
|
@ -872,7 +883,6 @@ void FScrollView::cb_vbarChange (const FWidget*, const FDataPtr)
|
|||
switch ( scrollType )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
@ -911,6 +921,14 @@ void FScrollView::cb_hbarChange (const FWidget*, const FDataPtr)
|
|||
FScrollbar::sType scrollType = hbar->getScrollType();
|
||||
static constexpr int wheel_distance = 4;
|
||||
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 )
|
||||
{
|
||||
|
@ -924,7 +942,6 @@ void FScrollView::cb_hbarChange (const FWidget*, const FDataPtr)
|
|||
switch ( scrollType )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
|
|
@ -47,9 +47,8 @@ FSize& FSize::operator = (const FSize& s)
|
|||
//----------------------------------------------------------------------
|
||||
FSize& FSize::operator = (FSize&& s) noexcept
|
||||
{
|
||||
width = s.width;
|
||||
height = s.height;
|
||||
s.width = s.height = 0;
|
||||
width = std::move(s.width);
|
||||
height = std::move(s.height);
|
||||
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;
|
||||
height = s.height;
|
||||
|
|
|
@ -281,8 +281,15 @@ void FSpinBox::onTimer (FTimerEvent*)
|
|||
addTimer(repeat_time);
|
||||
}
|
||||
|
||||
assert ( spining_state == FSpinBox::noSpin
|
||||
|| spining_state == FSpinBox::spinUp
|
||||
|| spining_state == FSpinBox::spinDown );
|
||||
|
||||
switch ( spining_state )
|
||||
{
|
||||
case FSpinBox::noSpin:
|
||||
break;
|
||||
|
||||
case FSpinBox::spinUp:
|
||||
increaseValue();
|
||||
updateInputField();
|
||||
|
@ -292,10 +299,6 @@ void FSpinBox::onTimer (FTimerEvent*)
|
|||
decreaseValue();
|
||||
updateInputField();
|
||||
break;
|
||||
|
||||
case FSpinBox::noSpin:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ FStartOptions::FStartOptions()
|
|||
, sgr_optimizer{true}
|
||||
, vgafont{false}
|
||||
, newfont{false}
|
||||
, encoding{fc::UNKNOWN}
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
|
||||
, meta_sends_escape{true}
|
||||
, change_cursorstyle{true}
|
||||
|
|
|
@ -43,8 +43,8 @@ FSwitch::FSwitch(FWidget* parent)
|
|||
//----------------------------------------------------------------------
|
||||
FSwitch::FSwitch (const FString& txt, FWidget* parent)
|
||||
: FToggleButton(txt, parent)
|
||||
, switch_offset_pos(txt.getLength() + 1)
|
||||
{
|
||||
switch_offset_pos = txt.getLength() + 1;
|
||||
setButtonWidth(11);
|
||||
}
|
||||
|
||||
|
|
|
@ -1070,7 +1070,9 @@ void FTerm::setEncoding (fc::encoding enc)
|
|||
assert ( enc == fc::UTF8
|
||||
|| enc == fc::VT100 // VT100 line drawing
|
||||
|| 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
|
||||
switch ( enc )
|
||||
|
@ -1090,7 +1092,6 @@ void FTerm::setEncoding (fc::encoding enc)
|
|||
case fc::ASCII:
|
||||
case fc::UNKNOWN:
|
||||
case fc::NUM_OF_ENCODINGS:
|
||||
default:
|
||||
putchar() = &FTerm::putchar_ASCII;
|
||||
}
|
||||
|
||||
|
@ -1794,12 +1795,11 @@ void FTerm::init_individual_term_encoding()
|
|||
data->setTermEncoding (fc::PC);
|
||||
putchar() = &FTerm::putchar_ASCII; // function pointer
|
||||
|
||||
if ( hasUTF8() && getStartOptions().encoding == fc::UNKNOWN )
|
||||
{
|
||||
if ( isXTerminal() )
|
||||
if ( hasUTF8()
|
||||
&& getStartOptions().encoding == fc::UNKNOWN
|
||||
&& isXTerminal() )
|
||||
putchar() = &FTerm::putchar_UTF8; // function pointer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -2326,7 +2326,7 @@ bool FTerm::init_terminal()
|
|||
{
|
||||
FTermios::storeTTYsettings();
|
||||
}
|
||||
catch (const std::runtime_error& ex)
|
||||
catch (const std::system_error& ex)
|
||||
{
|
||||
FString msg = "FTerm: " + FString(ex.what());
|
||||
data->setExitMessage(msg);
|
||||
|
@ -2554,7 +2554,6 @@ void FTerm::signal_handler (int signum)
|
|||
<< signum
|
||||
<< " (" << strsignal(signum) << ")" << std::endl;
|
||||
std::terminate();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -200,10 +200,18 @@ uInt env2uint (const char* env)
|
|||
{
|
||||
return str.toUInt();
|
||||
}
|
||||
catch (const std::exception&)
|
||||
catch (const std::invalid_argument&)
|
||||
{
|
||||
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())
|
||||
, tb.end()
|
||||
, 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;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ const FString FTermBuffer::toString() const
|
|||
std::transform ( data.begin()
|
||||
, data.end()
|
||||
, std::back_inserter(wide_string)
|
||||
, [] (const FChar& fchar) -> wchar_t
|
||||
, [] (const FChar& fchar)
|
||||
{
|
||||
return fchar.ch;
|
||||
}
|
||||
|
|
|
@ -558,9 +558,8 @@ const FString FTermDetection::getXTermColorName (FColor color)
|
|||
tv.tv_usec = 150000; // 150 ms
|
||||
|
||||
// read the terminal answer
|
||||
if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0 )
|
||||
{
|
||||
if ( std::scanf("\033]4;%10hu;%509[^\n]s", &color, temp) == 2 )
|
||||
if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0
|
||||
&& std::scanf("\033]4;%10hu;%509[^\n]s", &color, temp) == 2 )
|
||||
{
|
||||
std::size_t n = std::strlen(temp);
|
||||
|
||||
|
@ -574,7 +573,6 @@ const FString FTermDetection::getXTermColorName (FColor color)
|
|||
|
||||
color_str = temp;
|
||||
}
|
||||
}
|
||||
|
||||
return color_str;
|
||||
}
|
||||
|
@ -640,8 +638,8 @@ const FString FTermDetection::getAnswerbackMsg()
|
|||
tv.tv_usec = 150000; // 150 ms
|
||||
|
||||
// Read the answerback message
|
||||
if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0 )
|
||||
if ( std::fgets (temp, sizeof(temp) - 1, stdin) != nullptr )
|
||||
if ( select (stdin_no + 1, &ifds, nullptr, nullptr, &tv) > 0
|
||||
&& std::fgets (temp, sizeof(temp) - 1, stdin) != nullptr )
|
||||
answerback = temp;
|
||||
|
||||
return answerback;
|
||||
|
@ -712,16 +710,30 @@ char* FTermDetection::parseSecDA (char current_termtype[])
|
|||
//----------------------------------------------------------------------
|
||||
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 )
|
||||
return -1;
|
||||
return ERROR;
|
||||
|
||||
try
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#undef __STRICT_ANSI__ // need for fileno
|
||||
#endif
|
||||
|
||||
#include <system_error>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "final/ftermios.h"
|
||||
|
@ -74,7 +75,7 @@ termios FTermios::getTTY()
|
|||
struct termios t{};
|
||||
|
||||
if ( tcgetattr(stdin_no, &t) == -1 )
|
||||
throw std::runtime_error("Cannot find tty");
|
||||
throw std::system_error(errno, std::generic_category());
|
||||
|
||||
return t;
|
||||
}
|
||||
|
|
|
@ -749,6 +749,14 @@ void FTextView::cb_vbarChange (const FWidget*, const FDataPtr)
|
|||
const FScrollbar::sType scrollType = vbar->getScrollType();
|
||||
static constexpr int wheel_distance = 4;
|
||||
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 )
|
||||
update_scrollbar = true;
|
||||
|
@ -758,7 +766,6 @@ void FTextView::cb_vbarChange (const FWidget*, const FDataPtr)
|
|||
switch ( scrollType )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
@ -801,6 +808,14 @@ void FTextView::cb_hbarChange (const FWidget*, const FDataPtr)
|
|||
const FScrollbar::sType scrollType = hbar->getScrollType();
|
||||
static constexpr int wheel_distance = 4;
|
||||
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 )
|
||||
update_scrollbar = true;
|
||||
|
@ -810,7 +825,6 @@ void FTextView::cb_hbarChange (const FWidget*, const FDataPtr)
|
|||
switch ( scrollType )
|
||||
{
|
||||
case FScrollbar::noScroll:
|
||||
default:
|
||||
break;
|
||||
|
||||
case FScrollbar::scrollPageBackward:
|
||||
|
|
|
@ -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() )
|
||||
setReverse(true);
|
||||
|
|
|
@ -90,12 +90,6 @@ void FToolTip::show()
|
|||
FWindow::show();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FToolTip::hide()
|
||||
{
|
||||
FWindow::hide();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FToolTip::onMouseDown (FMouseEvent*)
|
||||
{
|
||||
|
|
|
@ -151,15 +151,13 @@ void FVTerm::setTermXY (int x, int y)
|
|||
//----------------------------------------------------------------------
|
||||
void FVTerm::setTerminalUpdates (terminal_update refresh_state)
|
||||
{
|
||||
switch ( refresh_state )
|
||||
if ( refresh_state == stop_terminal_updates )
|
||||
{
|
||||
case stop_terminal_updates:
|
||||
no_terminal_updates = true;
|
||||
break;
|
||||
|
||||
case continue_terminal_updates:
|
||||
case start_terminal_updates:
|
||||
default:
|
||||
}
|
||||
else if ( refresh_state == continue_terminal_updates
|
||||
|| refresh_state == start_terminal_updates )
|
||||
{
|
||||
no_terminal_updates = false;
|
||||
}
|
||||
|
||||
|
@ -1176,9 +1174,7 @@ void FVTerm::scrollAreaForward (FTermArea* area)
|
|||
area->changes[y_max].xmax = uInt(area->width - 1);
|
||||
area->has_changes = true;
|
||||
|
||||
if ( area == vdesktop )
|
||||
{
|
||||
if ( TCAP(fc::t_scroll_forward) )
|
||||
if ( area == vdesktop && TCAP(fc::t_scroll_forward) )
|
||||
{
|
||||
setTermXY (0, vdesktop->height);
|
||||
FTerm::scrollTermForward();
|
||||
|
@ -1191,7 +1187,6 @@ void FVTerm::scrollAreaForward (FTermArea* area)
|
|||
area->changes[y].xmax = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -1234,9 +1229,7 @@ void FVTerm::scrollAreaReverse (FTermArea* area)
|
|||
area->changes[0].xmax = uInt(area->width - 1);
|
||||
area->has_changes = true;
|
||||
|
||||
if ( area == vdesktop )
|
||||
{
|
||||
if ( TCAP(fc::t_scroll_reverse) )
|
||||
if ( area == vdesktop && TCAP(fc::t_scroll_reverse) )
|
||||
{
|
||||
setTermXY (0, 0);
|
||||
FTerm::scrollTermReverse();
|
||||
|
@ -1249,7 +1242,6 @@ void FVTerm::scrollAreaReverse (FTermArea* area)
|
|||
area->changes[y].xmax = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -1721,7 +1713,7 @@ bool FVTerm::hasChildAreaChanges (FTermArea* area)
|
|||
|
||||
return std::any_of ( area->preproc_list.begin()
|
||||
, area->preproc_list.end()
|
||||
, [] (const FVTermPreprocessing& pcall) -> bool
|
||||
, [] (const FVTermPreprocessing& pcall)
|
||||
{
|
||||
return pcall.instance
|
||||
&& pcall.instance->child_print_area
|
||||
|
|
|
@ -235,11 +235,11 @@ std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
|
|||
return double_flatline_mask.bottom;
|
||||
|
||||
case fc::left:
|
||||
default:
|
||||
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();
|
||||
double_flatline_mask.left.assign(length, bit);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -723,9 +720,6 @@ void FWidget::setDoubleFlatLine (fc::sides side, int pos, bool bit)
|
|||
double_flatline_mask.left[index] = bit;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -807,7 +801,7 @@ bool FWidget::close()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::addCallback ( const FString& cb_signal
|
||||
, FCallback cb_function
|
||||
, const FCallback& cb_function
|
||||
, FDataPtr data )
|
||||
{
|
||||
// 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
|
||||
, FWidget* cb_instance
|
||||
, FCallback cb_function
|
||||
, const FCallback& cb_function
|
||||
, FDataPtr data )
|
||||
{
|
||||
// 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
|
||||
|
||||
|
@ -1103,14 +1097,13 @@ bool FWidget::focusFirstChild()
|
|||
{
|
||||
widget->setFocus();
|
||||
|
||||
if ( widget->numOfChildren() >= 1 )
|
||||
{
|
||||
if ( ! widget->focusFirstChild() && widget->isWindowWidget() )
|
||||
if ( widget->numOfChildren() >= 1
|
||||
&& ! widget->focusFirstChild()
|
||||
&& widget->isWindowWidget() )
|
||||
{
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1145,11 +1138,9 @@ bool FWidget::focusLastChild()
|
|||
{
|
||||
widget->setFocus();
|
||||
|
||||
if ( widget->numOfChildren() >= 1 )
|
||||
{
|
||||
if ( ! widget->focusLastChild() && widget->isWindowWidget() )
|
||||
if ( widget->numOfChildren() >= 1
|
||||
&& ! widget->focusLastChild() && widget->isWindowWidget() )
|
||||
continue;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -56,21 +56,13 @@ class FColorPair
|
|||
{ }
|
||||
|
||||
// Copy constructor
|
||||
FColorPair (const FColorPair& pair)
|
||||
: fg_color{pair.fg_color}
|
||||
, bg_color{pair.bg_color}
|
||||
{ }
|
||||
FColorPair (const FColorPair& pair) = default;
|
||||
|
||||
// Destructor
|
||||
~FColorPair() = default;
|
||||
|
||||
// copy assignment operator (=)
|
||||
FColorPair& operator = (const FColorPair& pair)
|
||||
{
|
||||
fg_color = pair.fg_color;
|
||||
bg_color = pair.bg_color;
|
||||
return *this;
|
||||
}
|
||||
FColorPair& operator = (const FColorPair& pair) = default;
|
||||
|
||||
// Accessor
|
||||
const FString getClassName() const
|
||||
|
|
|
@ -181,7 +181,7 @@ class FComboBox : public FWidget
|
|||
bool hasShadow();
|
||||
|
||||
// Methods
|
||||
void insert (FListBoxItem);
|
||||
void insert (const FListBoxItem&);
|
||||
template <typename T>
|
||||
void insert ( const std::initializer_list<T>& list
|
||||
, FDataPtr = nullptr );
|
||||
|
|
|
@ -144,7 +144,7 @@ class FFileDialog : public FDialog
|
|||
// Typedef
|
||||
struct dir_entry
|
||||
{
|
||||
char* name;
|
||||
std::string name;
|
||||
// Type of file
|
||||
uChar fifo : 1;
|
||||
uChar character_device : 1;
|
||||
|
|
|
@ -115,9 +115,9 @@ class FKeyboard final
|
|||
void disableUTF8();
|
||||
void enableMouseSequences();
|
||||
void disableMouseSequences();
|
||||
void setPressCommand (FKeyboardCommand);
|
||||
void setReleaseCommand (FKeyboardCommand);
|
||||
void setEscPressedCommand (FKeyboardCommand);
|
||||
void setPressCommand (const FKeyboardCommand&);
|
||||
void setReleaseCommand (const FKeyboardCommand&);
|
||||
void setEscPressedCommand (const FKeyboardCommand&);
|
||||
|
||||
// Inquiry
|
||||
bool isInputDataPending();
|
||||
|
@ -236,15 +236,15 @@ inline void FKeyboard::disableMouseSequences()
|
|||
{ mouse_support = false; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FKeyboard::setPressCommand (FKeyboardCommand cmd)
|
||||
inline void FKeyboard::setPressCommand (const FKeyboardCommand& cmd)
|
||||
{ keypressed_cmd = cmd; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FKeyboard::setReleaseCommand (FKeyboardCommand cmd)
|
||||
inline void FKeyboard::setReleaseCommand (const FKeyboardCommand& cmd)
|
||||
{ keyreleased_cmd = cmd; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FKeyboard::setEscPressedCommand (FKeyboardCommand cmd)
|
||||
inline void FKeyboard::setEscPressedCommand (const FKeyboardCommand& cmd)
|
||||
{ escape_key_cmd = cmd; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -135,7 +135,7 @@ class FLabel : public FWidget
|
|||
void draw() override;
|
||||
void drawMultiLine();
|
||||
void drawSingleLine();
|
||||
void printLine (FString&&);
|
||||
void printLine (FString&);
|
||||
|
||||
// Data members
|
||||
FStringList multiline_text{};
|
||||
|
|
|
@ -201,7 +201,7 @@ class FListBox : public FWidget
|
|||
void insert (Iterator, Iterator, InsertConverter);
|
||||
template <typename Container, typename LazyConverter>
|
||||
void insert (Container, LazyConverter);
|
||||
void insert (FListBoxItem);
|
||||
void insert (const FListBoxItem&);
|
||||
template <typename T>
|
||||
void insert ( const std::initializer_list<T>& list
|
||||
, fc::brackets_type = fc::NoBrackets
|
||||
|
|
|
@ -179,11 +179,11 @@ class FMenu : public FWindow, public FMenuList
|
|||
void closeOpenedSubMenu();
|
||||
void hideSubMenus();
|
||||
void hideSuperMenus();
|
||||
bool mouseDownOverList (FPoint);
|
||||
bool mouseDownOverList (const FPoint&);
|
||||
void mouseDownSubmenu (const FMenuItem*);
|
||||
void mouseDownSelection (FMenuItem*, bool&);
|
||||
bool mouseUpOverList (FPoint);
|
||||
void mouseMoveOverList (FPoint, mouseStates&);
|
||||
bool mouseUpOverList (const FPoint&);
|
||||
void mouseMoveOverList (const FPoint&, mouseStates&);
|
||||
void mouseMoveSelection (FMenuItem*, mouseStates&);
|
||||
void mouseMoveDeselection (FMenuItem*, mouseStates&);
|
||||
void mouseUpOverBorder();
|
||||
|
|
|
@ -109,9 +109,9 @@ inline FPoint::FPoint (const FPoint& p) // copy constructor
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
inline FPoint::FPoint (FPoint&& p) noexcept // move constructor
|
||||
: xpos(p.xpos)
|
||||
, ypos(p.ypos)
|
||||
{ p.xpos = p.ypos = 0; }
|
||||
: xpos(std::move(p.xpos))
|
||||
, ypos(std::move(p.ypos))
|
||||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FPoint::FPoint (int x, int y)
|
||||
|
|
|
@ -156,14 +156,11 @@ inline FRect::FRect (const FRect& r) // copy constructor
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
inline FRect::FRect (FRect&& r) noexcept // move constructor
|
||||
: X1(r.X1)
|
||||
, Y1(r.Y1)
|
||||
, X2(r.X2)
|
||||
, Y2(r.Y2)
|
||||
{
|
||||
r.X1 = r.Y1 = 0;
|
||||
r.X2 = r.Y2 = -1;
|
||||
}
|
||||
: X1(std::move(r.X1))
|
||||
, Y1(std::move(r.Y1))
|
||||
, X2(std::move(r.X2))
|
||||
, Y2(std::move(r.Y2))
|
||||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FRect::FRect (int x, int y, std::size_t width, std::size_t height)
|
||||
|
|
|
@ -76,7 +76,7 @@ class FSize
|
|||
std::size_t getArea() const;
|
||||
void setWidth (std::size_t);
|
||||
void setHeight (std::size_t);
|
||||
void setSize (FSize);
|
||||
void setSize (const FSize&);
|
||||
void setSize (std::size_t, std::size_t);
|
||||
|
||||
// Inquiry
|
||||
|
@ -118,9 +118,9 @@ inline FSize::FSize (const FSize& s) // copy constructor
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
inline FSize::FSize (FSize&& s) noexcept // move constructor
|
||||
: width(s.width)
|
||||
, height(s.height)
|
||||
{ s.width = s.height = 0; }
|
||||
: width(std::move(s.width))
|
||||
, height(std::move(s.height))
|
||||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FSize::FSize (std::size_t w, std::size_t h)
|
||||
|
|
|
@ -82,7 +82,7 @@ class FStartOptions final
|
|||
uInt8 sgr_optimizer : 1;
|
||||
uInt8 vgafont : 1;
|
||||
uInt8 newfont : 1;
|
||||
fc::encoding encoding;
|
||||
fc::encoding encoding{fc::UNKNOWN};
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
|
||||
uInt8 meta_sends_escape : 1;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* *
|
||||
* 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 *
|
||||
* modify it under the terms of the GNU Lesser General Public License *
|
||||
|
@ -48,6 +48,9 @@ namespace finalcut
|
|||
class FSystem
|
||||
{
|
||||
public:
|
||||
// Using-declaration
|
||||
using fn_putc = int (*)(int);
|
||||
|
||||
// Constructor
|
||||
FSystem();
|
||||
|
||||
|
@ -64,7 +67,7 @@ class FSystem
|
|||
virtual FILE* fopen (const char*, const char*) = 0;
|
||||
virtual int fclose (FILE*) = 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 geteuid() = 0;
|
||||
virtual int getpwuid_r ( uid_t, struct passwd*, char*
|
||||
|
|
|
@ -170,7 +170,7 @@ class FSystemImpl : public FSystem
|
|||
#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)
|
||||
return ::tputs ( C_STR(str)
|
||||
|
|
|
@ -102,8 +102,8 @@ class FTermOpenBSD final
|
|||
static bool setBeep (int, int);
|
||||
static bool resetBeep();
|
||||
|
||||
private:
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
|
||||
private:
|
||||
// Methods
|
||||
static bool saveBSDConsoleEncoding();
|
||||
static bool setBSDConsoleEncoding (kbd_t);
|
||||
|
|
|
@ -147,7 +147,7 @@ class FToggleButton : public FWidget
|
|||
|
||||
// Methods
|
||||
void init();
|
||||
void drawText (FString&&, std::size_t);
|
||||
void drawText (const FString&, std::size_t);
|
||||
void correctSize (FSize&);
|
||||
|
||||
// Data members
|
||||
|
|
|
@ -94,7 +94,6 @@ class FToolTip : public FWindow
|
|||
|
||||
// Methods
|
||||
void show() override;
|
||||
void hide() override;
|
||||
|
||||
// Event handler
|
||||
void onMouseDown (FMouseEvent*) override;
|
||||
|
|
|
@ -566,12 +566,9 @@ struct FVTerm::FVTermPreprocessing
|
|||
{ }
|
||||
|
||||
FVTermPreprocessing (FVTermPreprocessing&& p) noexcept // move constructor
|
||||
: instance(p.instance)
|
||||
, function(p.function)
|
||||
{
|
||||
p.instance = nullptr;
|
||||
p.function = nullptr;
|
||||
}
|
||||
: instance(std::move(p.instance))
|
||||
, function(std::move(p.function))
|
||||
{ }
|
||||
|
||||
// Overloaded operators
|
||||
FVTermPreprocessing& operator = (const FVTermPreprocessing& p)
|
||||
|
|
|
@ -313,13 +313,13 @@ class FWidget : public FVTerm, public FObject
|
|||
virtual bool close();
|
||||
void clearStatusbarMessage();
|
||||
void addCallback ( const FString&
|
||||
, FCallback
|
||||
, const FCallback&
|
||||
, FDataPtr = nullptr );
|
||||
void addCallback ( const FString&
|
||||
, FWidget*
|
||||
, FCallback
|
||||
, const FCallback&
|
||||
, FDataPtr = nullptr );
|
||||
void delCallback (FCallback);
|
||||
void delCallback (const FCallback&);
|
||||
void delCallback (const FWidget*);
|
||||
void delCallbacks();
|
||||
void emitCallback (const FString&);
|
||||
|
@ -524,13 +524,9 @@ struct FWidget::FCallbackData
|
|||
{
|
||||
// Constructor
|
||||
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_instance(i)
|
||||
, cb_function(c)
|
||||
|
@ -545,16 +541,11 @@ struct FWidget::FCallbackData
|
|||
{ }
|
||||
|
||||
FCallbackData (FCallbackData&& c) noexcept // move constructor
|
||||
: cb_signal(c.cb_signal)
|
||||
, cb_instance(c.cb_instance)
|
||||
, cb_function(c.cb_function)
|
||||
, data(c.data)
|
||||
{
|
||||
c.cb_signal.clear();
|
||||
c.cb_instance = nullptr;
|
||||
c.cb_function = nullptr;
|
||||
c.data = nullptr;
|
||||
}
|
||||
: cb_signal(std::move(c.cb_signal))
|
||||
, cb_instance(std::move(c.cb_instance))
|
||||
, cb_function(std::move(c.cb_function))
|
||||
, data(std::move(c.data))
|
||||
{ }
|
||||
|
||||
// Destructor
|
||||
~FCallbackData()
|
||||
|
@ -572,14 +563,10 @@ struct FWidget::FCallbackData
|
|||
|
||||
FCallbackData& operator = (FCallbackData&& c) noexcept
|
||||
{
|
||||
cb_signal = c.cb_signal;
|
||||
cb_instance = c.cb_instance;
|
||||
cb_function = c.cb_function;
|
||||
data = c.data;
|
||||
c.cb_signal.clear();
|
||||
c.cb_instance = nullptr;
|
||||
c.cb_function = nullptr;
|
||||
c.data = nullptr;
|
||||
cb_signal = std::move(c.cb_signal);
|
||||
cb_instance = std::move(c.cb_instance);
|
||||
cb_function = std::move(c.cb_function);
|
||||
data = std::move(c.data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
libfinal.so.0.6.1
|
Binary file not shown.
|
@ -3,7 +3,7 @@
|
|||
* *
|
||||
* 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 *
|
||||
* modify it under the terms of the GNU Lesser General Public License *
|
||||
|
@ -117,8 +117,8 @@ void FPointTest::moveConstructorTest()
|
|||
{
|
||||
finalcut::FPoint p1 (25, 16);
|
||||
const finalcut::FPoint p2 (std::move(p1));
|
||||
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
||||
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
||||
CPPUNIT_ASSERT ( p1.getX() == 25 );
|
||||
CPPUNIT_ASSERT ( p1.getY() == 16 );
|
||||
CPPUNIT_ASSERT ( p2.getX() == 25 );
|
||||
CPPUNIT_ASSERT ( p2.getY() == 16 );
|
||||
}
|
||||
|
@ -153,9 +153,9 @@ void FPointTest::assignmentTest()
|
|||
|
||||
// Move assignment operator
|
||||
finalcut::FPoint p3 = std::move(p2);
|
||||
CPPUNIT_ASSERT ( p2.getX() == 0 );
|
||||
CPPUNIT_ASSERT ( p2.getY() == 0 );
|
||||
CPPUNIT_ASSERT ( p2.isOrigin() );
|
||||
CPPUNIT_ASSERT ( p2.getX() == 40 );
|
||||
CPPUNIT_ASSERT ( p2.getY() == 12 );
|
||||
CPPUNIT_ASSERT ( ! p2.isOrigin() );
|
||||
CPPUNIT_ASSERT ( p3.getX() == 40 );
|
||||
CPPUNIT_ASSERT ( p3.getY() == 12 );
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* *
|
||||
* 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 *
|
||||
* 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);
|
||||
const finalcut::FRect r2 (std::move(r1));
|
||||
CPPUNIT_ASSERT ( r1.getX() == 0 );
|
||||
CPPUNIT_ASSERT ( r1.getY() == 0 );
|
||||
CPPUNIT_ASSERT ( r1.isEmpty() );
|
||||
CPPUNIT_ASSERT ( r1.getWidth() == 0 );
|
||||
CPPUNIT_ASSERT ( r1.getHeight() == 0 );
|
||||
CPPUNIT_ASSERT ( r1.getX() == 3 );
|
||||
CPPUNIT_ASSERT ( r1.getY() == 3 );
|
||||
CPPUNIT_ASSERT ( ! r1.isEmpty() );
|
||||
CPPUNIT_ASSERT ( r1.getWidth() == 15 );
|
||||
CPPUNIT_ASSERT ( r1.getHeight() == 7 );
|
||||
CPPUNIT_ASSERT ( r2.getX() == 3 );
|
||||
CPPUNIT_ASSERT ( r2.getY() == 3 );
|
||||
CPPUNIT_ASSERT ( ! r2.isEmpty() );
|
||||
|
@ -359,15 +359,15 @@ void FRectTest::assignmentTest()
|
|||
|
||||
finalcut::FRect r6;
|
||||
r6 = std::move(r5); // Move assignment operator
|
||||
CPPUNIT_ASSERT ( r5.getX1() == 0 );
|
||||
CPPUNIT_ASSERT ( r5.getY1() == 0 );
|
||||
CPPUNIT_ASSERT ( r5.getX2() == -1 );
|
||||
CPPUNIT_ASSERT ( r5.getY2() == -1 );
|
||||
CPPUNIT_ASSERT ( r5.isEmpty() );
|
||||
CPPUNIT_ASSERT ( r5.getWidth() == 0 );
|
||||
CPPUNIT_ASSERT ( r5.getHeight() == 0 );
|
||||
CPPUNIT_ASSERT ( r5.getSize() == finalcut::FSize(0, 0) );
|
||||
CPPUNIT_ASSERT ( r5.getPos() == finalcut::FPoint(0, 0) );
|
||||
CPPUNIT_ASSERT ( r5.getX1() == 2 );
|
||||
CPPUNIT_ASSERT ( r5.getY1() == 9 );
|
||||
CPPUNIT_ASSERT ( r5.getX2() == 11 );
|
||||
CPPUNIT_ASSERT ( r5.getY2() == 18 );
|
||||
CPPUNIT_ASSERT ( ! r5.isEmpty() );
|
||||
CPPUNIT_ASSERT ( r5.getWidth() == 10 );
|
||||
CPPUNIT_ASSERT ( r5.getHeight() == 10 );
|
||||
CPPUNIT_ASSERT ( r5.getSize() == finalcut::FSize(10, 10) );
|
||||
CPPUNIT_ASSERT ( r5.getPos() == finalcut::FPoint(2, 9) );
|
||||
CPPUNIT_ASSERT ( r6.getX1() == 2 );
|
||||
CPPUNIT_ASSERT ( r6.getY1() == 9 );
|
||||
CPPUNIT_ASSERT ( r6.getX2() == 11 );
|
||||
|
|
|
@ -122,9 +122,9 @@ void FSizeTest::moveConstructorTest()
|
|||
{
|
||||
finalcut::FSize s1 (120, 36);
|
||||
const finalcut::FSize s2 (std::move(s1));
|
||||
CPPUNIT_ASSERT ( s1.getWidth() == 0 );
|
||||
CPPUNIT_ASSERT ( s1.getHeight() == 0 );
|
||||
CPPUNIT_ASSERT ( s1.isEmpty() );
|
||||
CPPUNIT_ASSERT ( s1.getWidth() == 120 );
|
||||
CPPUNIT_ASSERT ( s1.getHeight() == 36 );
|
||||
CPPUNIT_ASSERT ( ! s1.isEmpty() );
|
||||
CPPUNIT_ASSERT ( s2.getWidth() == 120 );
|
||||
CPPUNIT_ASSERT ( s2.getHeight() == 36 );
|
||||
}
|
||||
|
@ -161,9 +161,9 @@ void FSizeTest::assignmentTest()
|
|||
// Move assignment operator
|
||||
finalcut::FSize s3;
|
||||
s3 = std::move(s2);
|
||||
CPPUNIT_ASSERT ( s2.getWidth() == 0 );
|
||||
CPPUNIT_ASSERT ( s2.getHeight() == 0 );
|
||||
CPPUNIT_ASSERT ( s2.isEmpty() );
|
||||
CPPUNIT_ASSERT ( s2.getWidth() == 5 );
|
||||
CPPUNIT_ASSERT ( s2.getHeight() == 4 );
|
||||
CPPUNIT_ASSERT ( ! s2.isEmpty() );
|
||||
CPPUNIT_ASSERT ( s3.getWidth() == 5 );
|
||||
CPPUNIT_ASSERT ( s3.getHeight() == 4 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue