Use of default destructors

This commit is contained in:
Markus Gans 2020-11-24 21:06:39 +01:00
parent 25f2abe175
commit 7868a0dee9
101 changed files with 533 additions and 967 deletions

View File

@ -44,8 +44,7 @@ class SegmentView final : public finalcut::FDialog
explicit SegmentView (finalcut::FWidget* = nullptr);
private:
// Typedef
typedef struct
struct sevenSegment
{
unsigned char a : 1;
unsigned char b : 1;
@ -55,7 +54,7 @@ class SegmentView final : public finalcut::FDialog
unsigned char f : 1;
unsigned char g : 1;
unsigned char : 1; // padding bit
} sevenSegment;
};
// Methods
void hexEncoding();

View File

@ -38,8 +38,8 @@ using finalcut::FSize;
class Background final : public finalcut::FDialog
{
public:
// Typedef
typedef std::tuple<uChar, uChar, uChar> RGB;
// Using-declaration
using RGB = std::tuple<uChar, uChar, uChar>;
// Constructor
explicit Background (finalcut::FWidget* = nullptr);
@ -48,7 +48,7 @@ class Background final : public finalcut::FDialog
Background (const Background&) = delete;
// Destructor
~Background();
~Background() noexcept override;
// Disable copy assignment operator (=)
Background& operator = (const Background&) = delete;
@ -169,8 +169,7 @@ Background::Background (finalcut::FWidget* parent)
}
//----------------------------------------------------------------------
Background::~Background() // destructor
{ }
Background::~Background() noexcept = default; // destructor
//----------------------------------------------------------------------
void Background::cb_changed()

View File

@ -118,7 +118,7 @@ class Calc final : public finalcut::FDialog
explicit Calc (finalcut::FWidget* parent = nullptr);
// Destructor
~Calc() override;
~Calc() override = default;
private:
// Typedef and Enumeration
@ -305,10 +305,6 @@ Calc::Calc (FWidget* parent)
calculator_buttons[Equals]->addAccelerator(fc::Fkey_enter);
}
//----------------------------------------------------------------------
Calc::~Calc()
{ }
//----------------------------------------------------------------------
void Calc::onKeyPress (finalcut::FKeyEvent* ev)
{

View File

@ -51,7 +51,7 @@ class CheckList final : public finalcut::FDialog
CheckList (const CheckList&) = delete;
// Destructor
~CheckList() override;
~CheckList() override = default;
// Disable copy assignment operator (=)
CheckList& operator = (const CheckList&) = delete;
@ -115,10 +115,6 @@ CheckList::CheckList (finalcut::FWidget* parent)
);
}
//----------------------------------------------------------------------
CheckList::~CheckList() // destructor
{ }
//----------------------------------------------------------------------
void CheckList::populate()
{

View File

@ -27,8 +27,8 @@
using finalcut::FPoint;
using finalcut::FSize;
// Typedef
typedef std::shared_ptr<finalcut::FRadioButton> FRadioButtonPtr;
// Using-declaration
using FRadioButtonPtr = std::shared_ptr<finalcut::FRadioButton>;
// Function prototypes
void cb_quit (finalcut::FDialog&);

View File

@ -87,7 +87,7 @@ class Listbox final : public FDialog
Listbox (const Listbox&) = delete;
// Destructor
~Listbox() override;
~Listbox() override = default;
// Disable copy assignment operator (=)
Listbox& operator = (const Listbox&) = delete;
@ -164,10 +164,6 @@ Listbox::Listbox (FWidget* parent)
);
}
//----------------------------------------------------------------------
Listbox::~Listbox() // destructor
{ }
//----------------------------------------------------------------------
void Listbox::onClose (FCloseEvent* ev)
{

View File

@ -47,7 +47,7 @@ class Listview final : public finalcut::FDialog
Listview (const Listview&) = delete;
// Destructor
~Listview() override;
~Listview() override = default;
// Disable copy assignment operator (=)
Listview& operator = (const Listview&) = delete;
@ -124,10 +124,6 @@ Listview::Listview (finalcut::FWidget* parent)
);
}
//----------------------------------------------------------------------
Listview::~Listview() // destructor
{ }
//----------------------------------------------------------------------
void Listview::populate()
{

View File

@ -38,7 +38,7 @@ class Mandelbrot final : public finalcut::FDialog
explicit Mandelbrot (finalcut::FWidget* = nullptr);
// Destructor
~Mandelbrot() override;
~Mandelbrot() override = default;
// Event handlers
void onKeyPress (finalcut::FKeyEvent*) override;
@ -58,10 +58,6 @@ Mandelbrot::Mandelbrot (finalcut::FWidget* parent)
FDialog::setText ("Mandelbrot set");
}
//----------------------------------------------------------------------
Mandelbrot::~Mandelbrot()
{ }
//----------------------------------------------------------------------
void Mandelbrot::draw()
{

View File

@ -41,7 +41,7 @@ class Menu final : public finalcut::FDialog
Menu (const Menu&) = delete;
// Destructor
~Menu() override;
~Menu() override = default;
// Disable copy assignment operator (=)
Menu& operator = (const Menu&) = delete;
@ -157,10 +157,6 @@ Menu::Menu (finalcut::FWidget* parent)
Info.setGeometry(FPoint{2, 1}, FSize{36, 5});
}
//----------------------------------------------------------------------
Menu::~Menu()
{ }
//----------------------------------------------------------------------
void Menu::configureFileMenuItems()
{

View File

@ -43,7 +43,7 @@ class ColorChooser final : public finalcut::FWidget
ColorChooser (const ColorChooser&) = delete;
// Destructor
~ColorChooser() override;
~ColorChooser() override = default;
// Disable copy assignment operator (=)
ColorChooser& operator = (const ColorChooser&) = delete;
@ -85,10 +85,6 @@ ColorChooser::ColorChooser (finalcut::FWidget* parent)
headline << "Color";
}
//----------------------------------------------------------------------
ColorChooser::~ColorChooser()
{ }
//----------------------------------------------------------------------
inline FColor ColorChooser::getForeground() const
{
@ -186,7 +182,7 @@ class Brushes final : public finalcut::FWidget
Brushes (const Brushes&) = delete;
// Destructor
~Brushes() override;
~Brushes() override = default;
// Disable copy assignment operator (=)
Brushes& operator = (const Brushes&) = delete;
@ -231,10 +227,6 @@ Brushes::Brushes (finalcut::FWidget* parent)
headline << "Brush";
}
//----------------------------------------------------------------------
Brushes::~Brushes()
{ }
//----------------------------------------------------------------------
void Brushes::setSize (const FSize& size, bool adjust)
{
@ -328,7 +320,7 @@ class MouseDraw final : public finalcut::FDialog
MouseDraw (const MouseDraw&) = delete;
// Destructor
~MouseDraw() override;
~MouseDraw() override = default;
// Disable copy assignment operator (=)
MouseDraw& operator = (const MouseDraw&) = delete;
@ -377,10 +369,6 @@ MouseDraw::MouseDraw (finalcut::FWidget* parent)
brush.setPos (FPoint{1, 12});
}
//----------------------------------------------------------------------
MouseDraw::~MouseDraw()
{ }
//----------------------------------------------------------------------
void MouseDraw::setGeometry ( const FPoint& p, const FSize& s, bool adjust)
{

View File

@ -53,7 +53,7 @@ class RotoZoomer final : public finalcut::FDialog
explicit RotoZoomer (finalcut::FWidget* = nullptr, bool = false, int = 314);
// Destructor
~RotoZoomer() override;
~RotoZoomer() override = default;
// Accessors
finalcut::FString getReport() const;
@ -123,10 +123,6 @@ RotoZoomer::RotoZoomer (finalcut::FWidget* parent, bool b, int l)
}
}
//----------------------------------------------------------------------
RotoZoomer::~RotoZoomer()
{ }
//----------------------------------------------------------------------
void RotoZoomer::draw()
{

View File

@ -41,7 +41,7 @@ class Scrollview final : public finalcut::FScrollView
Scrollview (const Scrollview&) = delete;
// Destructor
~Scrollview() override;
~Scrollview() override = default;
// Disable copy assignment operator (=)
Scrollview& operator = (const Scrollview&) = delete;
@ -110,10 +110,6 @@ Scrollview::Scrollview (finalcut::FWidget* parent)
);
}
//----------------------------------------------------------------------
Scrollview::~Scrollview()
{ }
//----------------------------------------------------------------------
void Scrollview::setScrollSize (const FSize& size)
{
@ -197,7 +193,7 @@ class Scrollviewdemo final : public finalcut::FDialog
explicit Scrollviewdemo (finalcut::FWidget* = nullptr);
// Destructor
~Scrollviewdemo() override;
~Scrollviewdemo() override = default;
// Event handler
void onClose (finalcut::FCloseEvent*) override;
@ -240,10 +236,6 @@ Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent)
label << L"Use scrollbars to change the viewport position";
}
//----------------------------------------------------------------------
Scrollviewdemo::~Scrollviewdemo()
{ }
//----------------------------------------------------------------------
void Scrollviewdemo::cb_quit()
{

View File

@ -44,7 +44,7 @@ class AttribDlg final : public finalcut::FDialog
AttribDlg (const AttribDlg&) = delete;
// Destructor
~AttribDlg() override;
~AttribDlg() override = default;
// Disable copy assignment operator (=)
AttribDlg& operator = (const AttribDlg&) = delete;
@ -100,10 +100,6 @@ AttribDlg::AttribDlg (finalcut::FWidget* parent)
);
}
//----------------------------------------------------------------------
AttribDlg::~AttribDlg()
{ }
//----------------------------------------------------------------------
FColor AttribDlg::getBGColor() const
{
@ -226,8 +222,7 @@ class AttribDemo final : public finalcut::FWidget
explicit AttribDemo (FWidget* = nullptr);
// Destructor
~AttribDemo() override
{ }
~AttribDemo() override = default;
// Event handler
void onWheel (finalcut::FWheelEvent* ev) override

View File

@ -36,23 +36,23 @@ using finalcut::FStyle;
class Transparent final : public finalcut::FDialog
{
public:
// Typedef and Enumeration
typedef enum ttype
// Enumeration
enum class Type
{
transparent = 0,
shadow = 1,
inherit_background = 2
} trans_type;
};
// Constructor
explicit Transparent ( finalcut::FWidget* = nullptr
, trans_type = transparent );
, Type = Type::transparent );
// Disable copy constructor
Transparent (const Transparent&) = delete;
// Destructor
~Transparent() override;
~Transparent() override = default;
// Disable copy assignment operator (=)
Transparent& operator = (const Transparent&) = delete;
@ -65,12 +65,12 @@ class Transparent final : public finalcut::FDialog
void onKeyPress (finalcut::FKeyEvent* ev) override;
// Data members
trans_type type;
Type type;
};
//----------------------------------------------------------------------
Transparent::Transparent ( finalcut::FWidget* parent
, Transparent::trans_type tt )
, Transparent::Type tt )
: finalcut::FDialog{parent}
, type{tt}
{
@ -80,10 +80,6 @@ Transparent::Transparent ( finalcut::FWidget* parent
FWidget::setStatusbarMessage("Press Q to quit");
}
//----------------------------------------------------------------------
Transparent::~Transparent()
{ }
//----------------------------------------------------------------------
void Transparent::draw()
{
@ -92,13 +88,13 @@ void Transparent::draw()
if ( finalcut::FTerm::isMonochron() )
setReverse(true);
if ( type == shadow )
if ( type == Type::shadow )
{
const auto& wc = getColorTheme();
print() << FColorPair {wc->shadow_bg, wc->shadow_fg}
<< FStyle {fc::ColorOverlay};
}
else if ( type == inherit_background )
else if ( type == Type::inherit_background )
{
if ( finalcut::FTerm::getMaxColor() > 8 )
print() << FColorPair {fc::Blue, fc::Black};
@ -152,7 +148,7 @@ class MainWindow final : public finalcut::FDialog
MainWindow (const MainWindow&) = delete;
// Destructor
~MainWindow() override;
~MainWindow() override = default;
// Disable copy assignment operator (=)
MainWindow& operator = (const MainWindow&) = delete;
@ -202,12 +198,12 @@ MainWindow::MainWindow (finalcut::FWidget* parent)
transpwin->setGeometry (FPoint{6, 3}, FSize{29, 12});
transpwin->unsetTransparentShadow();
shadowwin = new Transparent(this, Transparent::shadow);
shadowwin = new Transparent(this, Transparent::Type::shadow);
shadowwin->setText("shadow");
shadowwin->setGeometry (FPoint{46, 11}, FSize{29, 12});
shadowwin->unsetTransparentShadow();
ibg = new Transparent(this, Transparent::inherit_background);
ibg = new Transparent(this, Transparent::Type::inherit_background);
ibg->setText("inherit background");
ibg->setGeometry (FPoint{42, 3}, FSize{29, 7});
ibg->unsetTransparentShadow();
@ -219,10 +215,6 @@ MainWindow::MainWindow (finalcut::FWidget* parent)
activateDialog();
}
//----------------------------------------------------------------------
MainWindow::~MainWindow()
{ }
//----------------------------------------------------------------------
void MainWindow::draw()
{

View File

@ -151,7 +151,7 @@ class Treeview final : public finalcut::FDialog
Treeview (const Treeview&) = delete;
// Destructor
~Treeview() override;
~Treeview() override = default;
// Disable copy assignment operator (=)
Treeview& operator = (const Treeview&) = delete;
@ -161,6 +161,12 @@ class Treeview final : public finalcut::FDialog
struct TreeItem; // forward declaration
// Methods
auto initAfrica() -> std::initializer_list<TreeItem>;
auto initAsia() -> std::initializer_list<TreeItem>;
auto initEurope() -> std::initializer_list<TreeItem>;
auto initNorthAmerica() -> std::initializer_list<TreeItem>;
auto initSouthAmerica() -> std::initializer_list<TreeItem>;
auto initOceania() -> std::initializer_list<TreeItem>;
void adjustSize() override;
// Event handler
@ -170,12 +176,12 @@ class Treeview final : public finalcut::FDialog
bool initialized{false};
finalcut::FListView listview{this};
finalcut::FButton quit{this};
static TreeItem africa[];
static TreeItem asia[];
static TreeItem europe[];
static TreeItem north_america[];
static TreeItem south_america[];
static TreeItem oceania[];
std::vector<TreeItem> africa{initAfrica()};
std::vector<TreeItem> asia{initAsia()};
std::vector<TreeItem> europe{initEurope()};
std::vector<TreeItem> north_america{initNorthAmerica()};
std::vector<TreeItem> south_america{initSouthAmerica()};
std::vector<TreeItem> oceania{initOceania()};
};
@ -195,133 +201,9 @@ struct Treeview::TreeItem
const char* name;
const char* population;
const char* density;
TreeItem* child_element;
std::vector<TreeItem> child_element;
};
//----------------------------------------------------------------------
// class Treeview - array data
//----------------------------------------------------------------------
Treeview::TreeItem Treeview::africa[] =
{
{ "Algeria", "40,400,000", "15.9", nullptr },
{ "Angola", "25,789,024", "20.69", nullptr },
{ "Botswana", "2,250,260", "3.7", nullptr },
{ "Cameroon", "22,534,532", "39.7", nullptr },
{ "Chad", "13,670,084", "8.6", nullptr },
{ "Egypt", "94,666,000", "87", nullptr },
{ "Ethiopia", "102,374,044", "92.7", nullptr },
{ "Ivory Coast", "23,740,424", "63.9", nullptr },
{ "Libya", "6,541,948", "3.55", nullptr },
{ "Madagascar", "24,430,325", "35.2", nullptr },
{ "Mali", "14,517,176", "11.7", nullptr },
{ "Mauritania", "4,301,018", "3.4", nullptr },
{ "Mozambique", "24,692,144", "28.7", nullptr },
{ "Namibia", "2,113,077", "2.54", nullptr },
{ "Niger", "20,672,987", "12.1", nullptr },
{ "Nigeria", "185,989,640", "197.2", nullptr },
{ "Somalia", "14,317,996", "19.31", nullptr },
{ "South Africa", "54,956,900", "42.4", nullptr },
{ "South Sudan", "12,340,000", "13.33", nullptr },
{ "Sudan", "39,578,828", "21.3", nullptr },
{ "Tanzania", "51,820,00", "47.5", nullptr },
{ "Zambia", "16,212,000", "17.2", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
Treeview::TreeItem Treeview::asia[] =
{
{ "Afghanistan", "34,656,032", "49.88", nullptr },
{ "China", "1,403,500,365", "145.0", nullptr },
{ "India", "1,324,171,354", "393.9", nullptr },
{ "Indonesia", "261,115,456", "124.66", nullptr },
{ "Iran", "80,829,192", "48.0", nullptr },
{ "Iraq", "37,202,572", "82.7", nullptr },
{ "Japan", "126,740,000", "336.0", nullptr },
{ "Kazakhstan", "17,987,736", "6.49", nullptr },
{ "Mongolia", "3,081,677", "1.97", nullptr },
{ "Myanmar", "51,486,253", "76.0", nullptr },
{ "Pakistan", "207,774,520", "244.4", nullptr },
{ "Russia", "144,463,451", "8.4", nullptr },
{ "Saudi Arabia", "33,000,000", "15.0", nullptr },
{ "Thailand", "68,863,514", "132.1", nullptr },
{ "Turkey", "79,814,871", "102.0", nullptr },
{ "Turkmenistan", "5,662,544", "10.5", nullptr },
{ "Uzbekistan", "32,979,000", "70.5", nullptr },
{ "Vietnam", "94,569,072", "276.03", nullptr },
{ "Yemen", "27,584,213", "44.7", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
Treeview::TreeItem Treeview::europe[] =
{
{ "Austria", "8,794,267", "104.0", nullptr },
{ "Belarus", "9,498,700", "45.8", nullptr },
{ "Bulgaria", "7,101,859", "64.9", nullptr },
{ "Czech Republic", "10,610,947", "134.0", nullptr },
{ "Finland", "5,506,312", "16.0", nullptr },
{ "France", "66,991,000", "103.0", nullptr },
{ "Germany", "82,175,700", "227.0", nullptr },
{ "Greece", "11,183,716", "82.0", nullptr },
{ "Hungary", "9,797,561", "105.3", nullptr },
{ "Iceland", "332,529", "3.2", nullptr },
{ "Italy", "60,589,445", "201.3", nullptr },
{ "Norway", "5,267,146", "15.8", nullptr },
{ "Poland", "38,634,007", "123.0", nullptr },
{ "Portugal", "10,309,573", "115.0", nullptr },
{ "Romania", "19,638,000", "84.4", nullptr },
{ "Serbia", "7,058,322", "91.1", nullptr },
{ "Spain", "46,468,102", "92.0", nullptr },
{ "Sweden", "10,065,389", "22.0", nullptr },
{ "United Kingdom", "65,648,000", "270.7", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
Treeview::TreeItem Treeview::north_america[] =
{
{ "Canada", "35,151,728", "3.92", nullptr },
{ "Cuba", "11,239,224", "102.3", nullptr },
{ "Greenland", "56,483", "0.028", nullptr },
{ "Guatemala", "16,582,469", "129.0", nullptr },
{ "Honduras", "9,112,867", "64.0", nullptr },
{ "Mexico", "119,530,753", "61.0", nullptr },
{ "Nicaragua", "6,167,237", "51.0", nullptr },
{ "USA", "325,365,189", "35.0", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
Treeview::TreeItem Treeview::south_america[] =
{
{ "Argentina", "43,847,430", "14.4", nullptr },
{ "Bolivia", "11,410,651", "10.4", nullptr },
{ "Brazil", "208,064,000", "24.35", nullptr },
{ "Chile", "18,006,407", "24.0", nullptr },
{ "Colombia", "49,364,592", "40.74", nullptr },
{ "Ecuador", "16,385,068", "58.95", nullptr },
{ "Guyana", "773,303", "3.502", nullptr },
{ "Paraguay", "6,725,308", "17.2", nullptr },
{ "Peru", "31,826,018", "23.0", nullptr },
{ "Venezuela", "31,568,179", "33.75", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
Treeview::TreeItem Treeview::oceania[] =
{
{ "Australia", "24,675,900", "3.2", nullptr },
{ "Papua New Guinea", "7,059,653", "15.0", nullptr },
{ "Papua", "3,486,432", "11.0", nullptr },
{ "New Zealand", "4,823,090", "17.5", nullptr },
{ "West Papua", "877,437", "6.3", nullptr },
{ "Solomon Islands", "599,419", "18.1", nullptr },
{ "New Caledonia", "268,767", "14.5", nullptr },
{ "Fiji", "898,76", "46.4", nullptr },
{ "Hawaii", "1,428,557", "82.6", nullptr },
{ "Vanuatu", "270,402", "19.7", nullptr },
{ "French Polynesia", "280,208", "76.0", nullptr },
{ "Samoa", "192,342", "68.0", nullptr },
{ "Kiribati", "110,136", "152.0", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
// constructors and destructor
//----------------------------------------------------------------------
@ -351,30 +233,28 @@ Treeview::Treeview (finalcut::FWidget* parent)
listview.setTreeView();
// Populate FListView with a list of items
static TreeItem continent_list[] =
const std::vector<TreeItem> continent_list
{
{ "Africa", "944,000,000", "31.2", africa },
{ "Asia", "4,010,000,000", "90.3", asia },
{ "Europe", "733,000,000", "69.9", europe },
{ "North America", "523,000,000", "21", north_america },
{ "South America", "381,000,000", "21.4", south_america },
{ "Antarctica", "1000", "0", nullptr },
{ "Antarctica", "1000", "0", {} },
{ "Australia/Oceania", "34,000,000", "4", oceania }
};
for (const auto& continent : continent_list)
{
const TreeItem* country_list = continent.child_element;
finalcut::FStringList continent_line ( continent.begin()
, continent.end() );
auto iter = listview.insert (continent_line);
while ( country_list && country_list->name )
for (const auto& country : continent.child_element)
{
finalcut::FStringList country_line ( country_list->begin()
, country_list->end() );
finalcut::FStringList country_line ( country.begin()
, country.end() );
listview.insert (country_line, iter);
country_list++;
}
}
@ -395,8 +275,149 @@ Treeview::Treeview (finalcut::FWidget* parent)
}
//----------------------------------------------------------------------
Treeview::~Treeview() // destructor
{ }
auto Treeview::initAfrica() -> std::initializer_list<Treeview::TreeItem>
{
static const auto list = std::initializer_list<Treeview::TreeItem>
{
{ "Algeria", "40,400,000", "15.9", {} },
{ "Angola", "25,789,024", "20.69", {} },
{ "Botswana", "2,250,260", "3.7", {} },
{ "Cameroon", "22,534,532", "39.7", {} },
{ "Chad", "13,670,084", "8.6", {} },
{ "Egypt", "94,666,000", "87", {} },
{ "Ethiopia", "102,374,044", "92.7", {} },
{ "Ivory Coast", "23,740,424", "63.9", {} },
{ "Libya", "6,541,948", "3.55", {} },
{ "Madagascar", "24,430,325", "35.2", {} },
{ "Mali", "14,517,176", "11.7", {} },
{ "Mauritania", "4,301,018", "3.4", {} },
{ "Mozambique", "24,692,144", "28.7", {} },
{ "Namibia", "2,113,077", "2.54", {} },
{ "Niger", "20,672,987", "12.1", {} },
{ "Nigeria", "185,989,640", "197.2", {} },
{ "Somalia", "14,317,996", "19.31", {} },
{ "South Africa", "54,956,900", "42.4", {} },
{ "South Sudan", "12,340,000", "13.33", {} },
{ "Sudan", "39,578,828", "21.3", {} },
{ "Tanzania", "51,820,00", "47.5", {} },
{ "Zambia", "16,212,000", "17.2", {} }
};
return list;
}
//----------------------------------------------------------------------
auto Treeview::initAsia() -> std::initializer_list<Treeview::TreeItem>
{
static const auto list = std::initializer_list<Treeview::TreeItem>
{
{ "Afghanistan", "34,656,032", "49.88", {} },
{ "China", "1,403,500,365", "145.0", {} },
{ "India", "1,324,171,354", "393.9", {} },
{ "Indonesia", "261,115,456", "124.66", {} },
{ "Iran", "80,829,192", "48.0", {} },
{ "Iraq", "37,202,572", "82.7", {} },
{ "Japan", "126,740,000", "336.0", {} },
{ "Kazakhstan", "17,987,736", "6.49", {} },
{ "Mongolia", "3,081,677", "1.97", {} },
{ "Myanmar", "51,486,253", "76.0", {} },
{ "Pakistan", "207,774,520", "244.4", {} },
{ "Russia", "144,463,451", "8.4", {} },
{ "Saudi Arabia", "33,000,000", "15.0", {} },
{ "Thailand", "68,863,514", "132.1", {} },
{ "Turkey", "79,814,871", "102.0", {} },
{ "Turkmenistan", "5,662,544", "10.5", {} },
{ "Uzbekistan", "32,979,000", "70.5", {} },
{ "Vietnam", "94,569,072", "276.03", {} },
{ "Yemen", "27,584,213", "44.7", {} }
};
return list;
}
//----------------------------------------------------------------------
auto Treeview::initEurope() -> std::initializer_list<Treeview::TreeItem>
{
static const auto list = std::initializer_list<Treeview::TreeItem>
{
{ "Austria", "8,794,267", "104.0", {} },
{ "Belarus", "9,498,700", "45.8", {} },
{ "Bulgaria", "7,101,859", "64.9", {} },
{ "Czech Republic", "10,610,947", "134.0", {} },
{ "Finland", "5,506,312", "16.0", {} },
{ "France", "66,991,000", "103.0", {} },
{ "Germany", "82,175,700", "227.0", {} },
{ "Greece", "11,183,716", "82.0", {} },
{ "Hungary", "9,797,561", "105.3", {} },
{ "Iceland", "332,529", "3.2", {} },
{ "Italy", "60,589,445", "201.3", {} },
{ "Norway", "5,267,146", "15.8", {} },
{ "Poland", "38,634,007", "123.0", {} },
{ "Portugal", "10,309,573", "115.0", {} },
{ "Romania", "19,638,000", "84.4", {} },
{ "Serbia", "7,058,322", "91.1", {} },
{ "Spain", "46,468,102", "92.0", {} },
{ "Sweden", "10,065,389", "22.0", {} },
{ "United Kingdom", "65,648,000", "270.7", {} }
};
return list;
}
//----------------------------------------------------------------------
auto Treeview::initNorthAmerica() -> std::initializer_list<Treeview::TreeItem>
{
static const auto list = std::initializer_list<Treeview::TreeItem>
{
{ "Canada", "35,151,728", "3.92", {} },
{ "Cuba", "11,239,224", "102.3", {} },
{ "Greenland", "56,483", "0.028", {} },
{ "Guatemala", "16,582,469", "129.0", {} },
{ "Honduras", "9,112,867", "64.0", {} },
{ "Mexico", "119,530,753", "61.0", {} },
{ "Nicaragua", "6,167,237", "51.0", {} },
{ "USA", "325,365,189", "35.0", {} }
};
return list;
}
//----------------------------------------------------------------------
auto Treeview::initSouthAmerica() -> std::initializer_list<Treeview::TreeItem>
{
static const auto list = std::initializer_list<Treeview::TreeItem>
{
{ "Argentina", "43,847,430", "14.4", {} },
{ "Bolivia", "11,410,651", "10.4", {} },
{ "Brazil", "208,064,000", "24.35", {} },
{ "Chile", "18,006,407", "24.0", {} },
{ "Colombia", "49,364,592", "40.74", {} },
{ "Ecuador", "16,385,068", "58.95", {} },
{ "Guyana", "773,303", "3.502", {} },
{ "Paraguay", "6,725,308", "17.2", {} },
{ "Peru", "31,826,018", "23.0", {} },
{ "Venezuela", "31,568,179", "33.75", {} }
};
return list;
}
//----------------------------------------------------------------------
auto Treeview::initOceania() -> std::initializer_list<Treeview::TreeItem>
{
static const auto list = std::initializer_list<Treeview::TreeItem>
{
{ "Australia", "24,675,900", "3.2", {} },
{ "Papua New Guinea", "7,059,653", "15.0", {} },
{ "Papua", "3,486,432", "11.0", {} },
{ "New Zealand", "4,823,090", "17.5", {} },
{ "West Papua", "877,437", "6.3", {} },
{ "Solomon Islands", "599,419", "18.1", {} },
{ "New Caledonia", "268,767", "14.5", {} },
{ "Fiji", "898,76", "46.4", {} },
{ "Hawaii", "1,428,557", "82.6", {} },
{ "Vanuatu", "270,402", "19.7", {} },
{ "French Polynesia", "280,208", "76.0", {} },
{ "Samoa", "192,342", "68.0", {} },
{ "Kiribati", "110,136", "152.0", {} }
};
return list;
}
//----------------------------------------------------------------------
void Treeview::adjustSize()

View File

@ -196,7 +196,7 @@ class TextWindow final : public finalcut::FDialog
TextWindow (const TextWindow&) = delete;
// Destructor
~TextWindow() override;
~TextWindow() override = default;
// Disable copy assignment operator (=)
TextWindow& operator = (const TextWindow&) = delete;
@ -230,10 +230,6 @@ TextWindow::TextWindow (finalcut::FWidget* parent)
scrolltext.deleteRange(3, 4);
}
//----------------------------------------------------------------------
TextWindow::~TextWindow() // destructor
{ }
//----------------------------------------------------------------------
void TextWindow::append (const finalcut::FString& str)
{
@ -262,7 +258,7 @@ class MyDialog final : public finalcut::FDialog
MyDialog (const MyDialog&) = delete;
// Destructor
~MyDialog() override;
~MyDialog() override = default;
// Disable copy assignment operator (=)
MyDialog& operator = (const MyDialog&) = delete;
@ -375,10 +371,6 @@ MyDialog::MyDialog (finalcut::FWidget* parent)
init();
}
//----------------------------------------------------------------------
MyDialog::~MyDialog() // destructor
{ }
//----------------------------------------------------------------------
void MyDialog::init()
{

View File

@ -41,7 +41,7 @@ class Watch final : public finalcut::FDialog
Watch (const Watch&) = delete;
// Destructor
~Watch() override;
~Watch() override = default;
// Disable copy assignment operator (=)
Watch& operator = (const Watch&) = delete;
@ -118,10 +118,6 @@ Watch::Watch (FWidget* parent)
);
}
//----------------------------------------------------------------------
Watch::~Watch()
{ }
//----------------------------------------------------------------------
void Watch::printTime()
{

View File

@ -44,7 +44,7 @@ class SmallWindow final : public finalcut::FDialog
SmallWindow (const SmallWindow&) = delete;
// Destructor
~SmallWindow() override;
~SmallWindow() override = default;
// Disable copy assignment operator (=)
SmallWindow& operator = (const SmallWindow&) = delete;
@ -107,10 +107,6 @@ SmallWindow::SmallWindow (finalcut::FWidget* parent)
bottom_label.setGeometry (FPoint{13, 3}, FSize{6, 3});
}
//----------------------------------------------------------------------
SmallWindow::~SmallWindow()
{ }
//----------------------------------------------------------------------
void SmallWindow::adjustSize()
{
@ -177,15 +173,22 @@ class Window final : public finalcut::FDialog
Window& operator = (const Window&) = delete;
private:
struct win_data
struct WinData
{
// Constructor
win_data() = default;
// Disable copy constructor
win_data (const win_data&) = delete;
WinData() = default;
// Disable copy assignment operator (=)
win_data& operator = (const win_data&) = delete;
// copy constructor
WinData (const WinData&) = default;
// move constructor
WinData (WinData&&) noexcept = default;
// copy assignment operator (=)
WinData& operator = (const WinData&) = default;
// move assignment operator (=)
WinData& operator = (WinData&&) noexcept = default;
// Data members
bool is_open{false};
@ -216,10 +219,10 @@ class Window final : public finalcut::FDialog
void cb_closeWindows();
void cb_next();
void cb_previous();
void cb_destroyWindow (win_data*) const;
void cb_destroyWindow (WinData&) const;
// Data members
std::vector<win_data*> windows{};
std::vector<WinData> windows{};
finalcut::FString drop_down_symbol{fc::BlackDownPointingTriangle};
finalcut::FMenuBar Menubar{this};
finalcut::FMenu File{"&File", &Menubar};
@ -262,9 +265,9 @@ Window::Window (finalcut::FWidget* parent)
// Generate data vector for the windows
for (uInt n{1}; n < 7; n++)
{
auto win_dat = new win_data;
win_dat->title.sprintf("Window %1u", n);
windows.push_back(win_dat);
WinData win_dat;
win_dat.title.sprintf("Window %1u", n);
windows.emplace_back(std::move(win_dat));
}
}
@ -275,13 +278,12 @@ Window::~Window()
while ( iter != windows.end() )
{
auto win_dat = *iter;
auto& win_dat = *iter;
// Remove all callbacks before Window::cb_destroyWindow() will be called
if ( win_dat->is_open && win_dat->dgl )
win_dat->dgl->delCallback();
if ( win_dat.is_open && win_dat.dgl )
win_dat.dgl->delCallback();
delete win_dat;
iter = windows.erase(iter);
}
}
@ -366,12 +368,12 @@ void Window::adjustSize()
while ( iter != windows.end() )
{
if ( (*iter)->is_open )
if ( (*iter).is_open )
{
const auto n = int(std::distance(first, iter));
const int x = dx + 5 + (n % 3) * 25 + int(n / 3) * 3;
const int y = dy + 11 + int(n / 3) * 3;
(*iter)->dgl->setPos (FPoint{x, y});
(*iter).dgl->setPos (FPoint{x, y});
}
++iter;
@ -459,13 +461,13 @@ void Window::cb_createWindows()
while ( iter != windows.end() )
{
if ( ! (*iter)->is_open )
if ( ! (*iter).is_open )
{
auto win_dat = *iter;
auto& win_dat = *iter;
auto win = new SmallWindow(this);
win_dat->dgl = win;
win_dat->is_open = true;
win->setText(win_dat->title);
win_dat.dgl = win;
win_dat.is_open = true;
win->setText(win_dat.title);
const auto n = int(std::distance(first, iter));
const int x = dx + 5 + (n % 3) * 25 + int(n / 3) * 3;
const int y = dy + 11 + int(n / 3) * 3;
@ -478,7 +480,7 @@ void Window::cb_createWindows()
(
"destroy",
this, &Window::cb_destroyWindow,
win_dat
std::ref(win_dat)
);
}
@ -551,13 +553,10 @@ void Window::cb_previous()
}
//----------------------------------------------------------------------
void Window::cb_destroyWindow (win_data* win_dat) const
void Window::cb_destroyWindow (WinData& win_dat) const
{
if ( win_dat )
{
win_dat->is_open = false;
win_dat->dgl = nullptr;
}
win_dat.is_open = false;
win_dat.dgl = nullptr;
}

View File

@ -374,7 +374,7 @@ void FButtonGroup::drawLabel()
else
FWidget::setPrintPos (FPoint{0, 1});
drawText (label_text, hotkeypos);
drawText (std::move(label_text), hotkeypos);
setViewportPrint();
}
@ -397,7 +397,7 @@ void FButtonGroup::init()
}
//----------------------------------------------------------------------
void FButtonGroup::drawText ( const FString& label_text
void FButtonGroup::drawText ( FString&& label_text
, std::size_t hotkeypos )
{
const auto& wc = getColorTheme();

View File

@ -46,9 +46,7 @@ FCheckBox::FCheckBox (const FString& txt, FWidget* parent)
}
//----------------------------------------------------------------------
FCheckBox::~FCheckBox() // destructor
{ }
FCheckBox::~FCheckBox() noexcept = default; // destructor
// private methods of FCheckBox
//----------------------------------------------------------------------

View File

@ -47,8 +47,7 @@ FCheckMenuItem::FCheckMenuItem (const FString& txt, FWidget* parent)
}
//----------------------------------------------------------------------
FCheckMenuItem::~FCheckMenuItem() // destructor
{ }
FCheckMenuItem::~FCheckMenuItem() noexcept = default; // destructor
// private methods of FCheckMenuItem

View File

@ -177,9 +177,7 @@ FComboBox::FComboBox (FWidget* parent)
}
//----------------------------------------------------------------------
FComboBox::~FComboBox() // destructor
{ }
FComboBox::~FComboBox() noexcept = default; // destructor
// public methods of FComboBox
//----------------------------------------------------------------------

View File

@ -46,8 +46,7 @@ FDialogListMenu::FDialogListMenu (const FString& txt, FWidget* parent)
}
//----------------------------------------------------------------------
FDialogListMenu::~FDialogListMenu()
{ }
FDialogListMenu::~FDialogListMenu() noexcept = default; // destructor
// private methods of FMenu

View File

@ -56,10 +56,6 @@ FKeyEvent::FKeyEvent (fc::events ev_type, FKey key_num) // constructor
, k{key_num}
{ }
//----------------------------------------------------------------------
FKeyEvent::~FKeyEvent() // destructor
{ }
//----------------------------------------------------------------------
FKey FKeyEvent::key() const
{ return k; }
@ -98,10 +94,6 @@ FMouseEvent::FMouseEvent ( fc::events ev_type // constructor
: FMouseEvent{ev_type, pos, FPoint{}, button}
{ }
//----------------------------------------------------------------------
FMouseEvent::~FMouseEvent() // destructor
{ }
//----------------------------------------------------------------------
const FPoint& FMouseEvent::getPos() const
{ return p; }
@ -152,10 +144,6 @@ FWheelEvent::FWheelEvent ( fc::events ev_type // constructor
: FWheelEvent{ev_type, pos, FPoint{}, wheel}
{ }
//----------------------------------------------------------------------
FWheelEvent::~FWheelEvent() // destructor
{ }
//----------------------------------------------------------------------
const FPoint& FWheelEvent::getPos() const
{ return p; }
@ -193,10 +181,6 @@ FFocusEvent::FFocusEvent (fc::events ev_type) // constructor
: FEvent{ev_type}
{ }
//----------------------------------------------------------------------
FFocusEvent::~FFocusEvent() // destructor
{ }
//----------------------------------------------------------------------
bool FFocusEvent::gotFocus() const
{
@ -239,10 +223,6 @@ FAccelEvent::FAccelEvent (fc::events ev_type, FWidget* focused) // constructor
, focus_widget{focused}
{ }
//----------------------------------------------------------------------
FAccelEvent::~FAccelEvent() // destructor
{ }
//----------------------------------------------------------------------
FWidget* FAccelEvent::focusedWidget() const
{ return focus_widget; }
@ -268,10 +248,6 @@ FResizeEvent::FResizeEvent (fc::events ev_type) // constructor
: FEvent{ev_type}
{ }
//----------------------------------------------------------------------
FResizeEvent::~FResizeEvent() // destructor
{ }
//----------------------------------------------------------------------
bool FResizeEvent::isAccepted() const
{ return accpt; }
@ -293,10 +269,6 @@ FShowEvent::FShowEvent (fc::events ev_type) // constructor
: FEvent{ev_type}
{ }
//----------------------------------------------------------------------
FShowEvent::~FShowEvent() // destructor
{ }
//----------------------------------------------------------------------
// class FHideEvent
@ -306,10 +278,6 @@ FHideEvent::FHideEvent (fc::events ev_type) // constructor
: FEvent{ev_type}
{ }
//----------------------------------------------------------------------
FHideEvent::~FHideEvent() // destructor
{ }
//----------------------------------------------------------------------
// class FCloseEvent
@ -319,10 +287,6 @@ FCloseEvent::FCloseEvent (fc::events ev_type) // constructor
: FEvent{ev_type}
{ }
//----------------------------------------------------------------------
FCloseEvent::~FCloseEvent() // destructor
{ }
//----------------------------------------------------------------------
bool FCloseEvent::isAccepted() const
{ return accpt; }
@ -345,10 +309,6 @@ FTimerEvent::FTimerEvent (fc::events ev_type, int timer_id) // constructor
, id{timer_id}
{ }
//----------------------------------------------------------------------
FTimerEvent::~FTimerEvent() // destructor
{ }
//----------------------------------------------------------------------
int FTimerEvent::getTimerId() const
{ return id; }
@ -363,10 +323,6 @@ FUserEvent::FUserEvent (fc::events ev_type, int user_event_id) // constructor
, uid{user_event_id}
{ }
//----------------------------------------------------------------------
FUserEvent::~FUserEvent() // destructor
{ }
//----------------------------------------------------------------------
int FUserEvent::getUserId() const
{ return uid; }

View File

@ -81,9 +81,6 @@ FKeyboard::FKeyboard()
term_detection = FTerm::getFTermDetection();
}
//----------------------------------------------------------------------
FKeyboard::~FKeyboard() // destructor
{ }
// public methods of FKeyboard
//----------------------------------------------------------------------

View File

@ -39,10 +39,6 @@ namespace finalcut
//----------------------------------------------------------------------
// constructor and destructor
//----------------------------------------------------------------------
FListBoxItem::FListBoxItem()
{ }
//----------------------------------------------------------------------
FListBoxItem::FListBoxItem (const FListBoxItem& item)
: text{item.text}
@ -52,8 +48,8 @@ FListBoxItem::FListBoxItem (const FListBoxItem& item)
{ }
//----------------------------------------------------------------------
FListBoxItem::~FListBoxItem() // destructor
{ }
FListBoxItem::~FListBoxItem() noexcept = default; // destructor
// public methods of FListBoxItem
//----------------------------------------------------------------------

View File

@ -477,52 +477,12 @@ void FListViewItem::resetVisibleLineCounter()
//----------------------------------------------------------------------
// constructor and destructor
//----------------------------------------------------------------------
FListViewIterator::FListViewIterator()
{ }
//----------------------------------------------------------------------
FListViewIterator::FListViewIterator (iterator iter)
: node{iter}
{ }
//----------------------------------------------------------------------
FListViewIterator::~FListViewIterator() // destructor
{ }
//----------------------------------------------------------------------
FListViewIterator::FListViewIterator (const FListViewIterator& i)
: iter_path{i.iter_path} // copy constructor
, node{i.node}
, position{i.position}
{ }
//----------------------------------------------------------------------
FListViewIterator::FListViewIterator (FListViewIterator&& i) noexcept
: iter_path{std::move(i.iter_path)} // move constructor
, node{std::move(i.node)}
, position{std::move(i.position)}
{ }
// FListViewIterator operators
//----------------------------------------------------------------------
FListViewIterator& FListViewIterator::operator = (const FListViewIterator& i)
{
iter_path = i.iter_path;
node = i.node;
position = i.position;
return *this;
}
//----------------------------------------------------------------------
FListViewIterator& FListViewIterator::operator = (FListViewIterator&& i) noexcept
{
iter_path = std::move(i.iter_path);
node = std::move(i.node);
position = std::move(i.position);
return *this;
}
//----------------------------------------------------------------------
FListViewIterator& FListViewIterator::operator ++ () // prefix
{
@ -554,25 +514,19 @@ FListViewIterator FListViewIterator::operator -- (int) // postfix
}
//----------------------------------------------------------------------
FListViewIterator& FListViewIterator::operator += (volatile int n)
FListViewIterator& FListViewIterator::operator += (int n)
{
while ( n > 0 )
{
for (int i = n; i > 0 ; i--)
nextElement(node);
n--;
}
return *this;
}
//----------------------------------------------------------------------
FListViewIterator& FListViewIterator::operator -= (volatile int n)
FListViewIterator& FListViewIterator::operator -= (int n)
{
while ( n > 0 )
{
for (int i = n; i > 0 ; i--)
prevElement(node);
n--;
}
return *this;
}

View File

@ -92,10 +92,7 @@ FMessageBox::FMessageBox ( const FString& caption
}
//----------------------------------------------------------------------
FMessageBox::~FMessageBox() // destructor
{
deallocation();
}
FMessageBox::~FMessageBox() noexcept = default; // destructor
// public methods of FMessageBox
@ -108,10 +105,6 @@ FMessageBox& FMessageBox::operator = (const FMessageBox& mbox)
}
else
{
for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++)
if ( button[n] )
delete button[n];
if ( mbox.getParentWidget() )
mbox.getParentWidget()->addChild (this);
@ -238,7 +231,7 @@ inline void FMessageBox::allocation()
{
try
{
button[0] = new FButton (this);
button[0].reset(new FButton (this));
button[0]->setText(button_text[button_digit[0]]);
button[0]->setPos(FPoint{3, int(getHeight()) - 4}, false);
button[0]->setWidth(1, false);
@ -247,7 +240,7 @@ inline void FMessageBox::allocation()
if ( button_digit[1] > FMessageBox::Reject )
{
button[1] = new FButton(this);
button[1].reset(new FButton(this));
button[1]->setText(button_text[button_digit[1]]);
button[1]->setPos(FPoint{17, int(getHeight()) - 4}, false);
button[1]->setWidth(0, false);
@ -256,7 +249,7 @@ inline void FMessageBox::allocation()
if ( button_digit[2] > FMessageBox::Reject )
{
button[2] = new FButton(this);
button[2].reset(new FButton(this));
button[2]->setText(button_text[button_digit[2]]);
button[2]->setPos(FPoint{32, int(getHeight()) - 4}, false);
button[2]->setWidth(0, false);
@ -270,14 +263,6 @@ inline void FMessageBox::allocation()
}
}
//----------------------------------------------------------------------
inline void FMessageBox::deallocation()
{
for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++)
if ( button[n] )
delete button[n];
}
//----------------------------------------------------------------------
inline void FMessageBox::initCallbacks()
{
@ -391,7 +376,7 @@ void FMessageBox::draw()
//----------------------------------------------------------------------
void FMessageBox::resizeButtons() const
{
std::array<std::size_t, 3> len{};
std::array<std::size_t, MAX_BUTTONS> len{};
std::size_t max_size{};
for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++)

View File

@ -313,10 +313,6 @@ FMouseGPM::FMouseGPM()
gpm_ev.x = -1;
}
//----------------------------------------------------------------------
FMouseGPM::~FMouseGPM() // destructor
{ }
// public methods of FMouseX11
//----------------------------------------------------------------------
@ -1217,27 +1213,25 @@ void FMouseUrxvt::setButtonState (const int btn, const struct timeval* time)
FMouseControl::FMouseControl()
{
#ifdef F_HAVE_LIBGPM
mouse_protocol[FMouse::gpm] = FMouse::createMouseObject<FMouseGPM>();
if ( FTerm::isLinuxTerm() )
mouse_protocol[FMouse::gpm].reset(FMouse::createMouseObject<FMouseGPM>());
#endif
mouse_protocol[FMouse::x11] = FMouse::createMouseObject<FMouseX11>();
mouse_protocol[FMouse::sgr] = FMouse::createMouseObject<FMouseSGR>();
mouse_protocol[FMouse::urxvt] = FMouse::createMouseObject<FMouseUrxvt>();
mouse_protocol[FMouse::x11].reset(FMouse::createMouseObject<FMouseX11>());
mouse_protocol[FMouse::sgr].reset(FMouse::createMouseObject<FMouseSGR>());
mouse_protocol[FMouse::urxvt].reset(FMouse::createMouseObject<FMouseUrxvt>());
}
//----------------------------------------------------------------------
FMouseControl::~FMouseControl() // destructor
{
for (auto&& m : mouse_protocol)
delete m.second;
}
FMouseControl::~FMouseControl() = default; // destructor
// public methods of FMouseControl
//----------------------------------------------------------------------
const FPoint& FMouseControl::getPos()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
const auto& mouse_object = mouse_protocol[mtype].get();
if ( mouse_object )
return mouse_object->getPos();
@ -1248,17 +1242,23 @@ const FPoint& FMouseControl::getPos()
//----------------------------------------------------------------------
void FMouseControl::clearEvent()
{
FMouse* mouse_object;
FMouse::mouse_type mtype;
while ( (mouse_object = getMouseWithEvent()) != nullptr )
mouse_object->clearEvent();
do
{
mtype = getMouseWithEvent();
if ( mouse_protocol[mtype] )
mouse_protocol[mtype]->clearEvent();
}
while ( mtype != FMouse::none );
}
//----------------------------------------------------------------------
#ifdef F_HAVE_LIBGPM
void FMouseControl::setStdinNo (int file_descriptor)
{
auto mouse = mouse_protocol[FMouse::gpm];
auto mouse = mouse_protocol[FMouse::gpm].get();
auto gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse )
@ -1304,7 +1304,8 @@ void FMouseControl::useXtermMouse (bool enable)
//----------------------------------------------------------------------
bool FMouseControl::hasData()
{
const auto& mouse_object = getMouseWithData();
auto mtype = getMouseWithData();
const auto& mouse_object = mouse_protocol[mtype].get();
if ( mouse_object ) // with data
return true;
@ -1315,9 +1316,9 @@ bool FMouseControl::hasData()
//----------------------------------------------------------------------
bool FMouseControl::hasEvent()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object ) // with event
if ( mouse_protocol[mtype] ) // with event
return true;
return false;
@ -1326,10 +1327,10 @@ bool FMouseControl::hasEvent()
//----------------------------------------------------------------------
bool FMouseControl::isLeftButtonPressed()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isLeftButtonPressed();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isLeftButtonPressed();
return false;
}
@ -1337,10 +1338,10 @@ bool FMouseControl::isLeftButtonPressed()
//----------------------------------------------------------------------
bool FMouseControl::isLeftButtonReleased()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isLeftButtonReleased();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isLeftButtonReleased();
return false;
}
@ -1348,10 +1349,10 @@ bool FMouseControl::isLeftButtonReleased()
//----------------------------------------------------------------------
bool FMouseControl::isLeftButtonDoubleClick()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isLeftButtonDoubleClick();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isLeftButtonDoubleClick();
return false;
}
@ -1359,10 +1360,10 @@ bool FMouseControl::isLeftButtonDoubleClick()
//----------------------------------------------------------------------
bool FMouseControl::isRightButtonPressed()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isRightButtonPressed();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isRightButtonPressed();
return false;
}
@ -1370,10 +1371,10 @@ bool FMouseControl::isRightButtonPressed()
//----------------------------------------------------------------------
bool FMouseControl::isRightButtonReleased()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isRightButtonReleased();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isRightButtonReleased();
return false;
}
@ -1381,10 +1382,10 @@ bool FMouseControl::isRightButtonReleased()
//----------------------------------------------------------------------
bool FMouseControl::isMiddleButtonPressed()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isMiddleButtonPressed();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isMiddleButtonPressed();
return false;
}
@ -1392,10 +1393,10 @@ bool FMouseControl::isMiddleButtonPressed()
//----------------------------------------------------------------------
bool FMouseControl::isMiddleButtonReleased()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isMiddleButtonReleased();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isMiddleButtonReleased();
return false;
}
@ -1403,10 +1404,10 @@ bool FMouseControl::isMiddleButtonReleased()
//----------------------------------------------------------------------
bool FMouseControl::isShiftKeyPressed()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isShiftKeyPressed();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isShiftKeyPressed();
return false;
}
@ -1414,10 +1415,10 @@ bool FMouseControl::isShiftKeyPressed()
//----------------------------------------------------------------------
bool FMouseControl::isControlKeyPressed()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isControlKeyPressed();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isControlKeyPressed();
return false;
}
@ -1425,10 +1426,10 @@ bool FMouseControl::isControlKeyPressed()
//----------------------------------------------------------------------
bool FMouseControl::isMetaKeyPressed()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isMetaKeyPressed();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isMetaKeyPressed();
return false;
}
@ -1436,10 +1437,10 @@ bool FMouseControl::isMetaKeyPressed()
//----------------------------------------------------------------------
bool FMouseControl::isWheelUp()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isWheelUp();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isWheelUp();
return false;
}
@ -1447,10 +1448,10 @@ bool FMouseControl::isWheelUp()
//----------------------------------------------------------------------
bool FMouseControl::isWheelDown()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isWheelDown();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isWheelDown();
return false;
}
@ -1458,10 +1459,10 @@ bool FMouseControl::isWheelDown()
//----------------------------------------------------------------------
bool FMouseControl::isMoved()
{
const auto& mouse_object = getMouseWithEvent();
auto mtype = getMouseWithEvent();
if ( mouse_object )
return mouse_object->isMoved();
if ( mouse_protocol[mtype] )
return mouse_protocol[mtype]->isMoved();
return false;
}
@ -1486,7 +1487,7 @@ bool FMouseControl::isGpmMouseEnabled()
if ( mouse_protocol.empty() )
return false;
const auto& mouse = mouse_protocol[FMouse::gpm];
const auto& mouse = mouse_protocol[FMouse::gpm].get();
const auto& gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse )
@ -1507,7 +1508,7 @@ void FMouseControl::enable()
#ifdef F_HAVE_LIBGPM
if ( use_gpm_mouse )
{
auto mouse = mouse_protocol[FMouse::gpm];
auto mouse = mouse_protocol[FMouse::gpm].get();
auto gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse )
@ -1525,7 +1526,7 @@ void FMouseControl::disable()
#ifdef F_HAVE_LIBGPM
if ( use_gpm_mouse )
{
auto mouse = mouse_protocol[FMouse::gpm];
auto mouse = mouse_protocol[FMouse::gpm].get();
auto gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse )
@ -1541,7 +1542,7 @@ void FMouseControl::disable()
void FMouseControl::setRawData ( FMouse::mouse_type mt
, FKeyboard::keybuffer& fifo_buf)
{
auto mouse = mouse_protocol[mt];
auto mouse = mouse_protocol[mt].get();
if ( mouse )
mouse->setRawData (fifo_buf);
@ -1569,7 +1570,9 @@ void FMouseControl::processQueuedInput()
//----------------------------------------------------------------------
void FMouseControl::processEvent (struct timeval* time)
{
auto mouse_object = getMouseWithData();
auto mtype = getMouseWithData();
auto mouse_object = mouse_protocol[mtype].get();
// Clear all old mouse events
clearEvent();
@ -1588,7 +1591,7 @@ bool FMouseControl::getGpmKeyPressed (bool pending)
if ( mouse_protocol.empty() )
return false;
auto mouse = mouse_protocol[FMouse::gpm];
auto mouse = mouse_protocol[FMouse::gpm].get();
auto gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse )
@ -1610,7 +1613,7 @@ void FMouseControl::drawPointer()
if ( mouse_protocol.empty() )
return;
auto mouse = mouse_protocol[FMouse::gpm];
auto mouse = mouse_protocol[FMouse::gpm].get();
auto gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse )
@ -1624,7 +1627,7 @@ void FMouseControl::drawPointer()
// private methods of FMouseControl
//----------------------------------------------------------------------
FMouse* FMouseControl::getMouseWithData()
FMouse::mouse_type FMouseControl::getMouseWithData()
{
const auto& iter = \
std::find_if ( std::begin(mouse_protocol)
@ -1636,11 +1639,11 @@ FMouse* FMouseControl::getMouseWithData()
}
);
return ( iter != mouse_protocol.end() ) ? iter->second : nullptr;
return ( iter != mouse_protocol.end() ) ? iter->first : FMouse::none;
}
//----------------------------------------------------------------------
FMouse* FMouseControl::getMouseWithEvent()
FMouse::mouse_type FMouseControl::getMouseWithEvent()
{
const auto& iter = \
std::find_if ( std::begin(mouse_protocol)
@ -1652,7 +1655,7 @@ FMouse* FMouseControl::getMouseWithEvent()
}
);
return ( iter != mouse_protocol.end() ) ? iter->second : nullptr;
return ( iter != mouse_protocol.end() ) ? iter->first : FMouse::none;
}
//----------------------------------------------------------------------

View File

@ -32,7 +32,6 @@ namespace finalcut
// static class attributes
bool FObject::timer_modify_lock;
FObject::FTimerList* FObject::timer_list{nullptr};
const FString* fc::emptyFString::empty_string{nullptr};
@ -45,27 +44,10 @@ const FString* fc::emptyFString::empty_string{nullptr};
FObject::FObject (FObject* parent)
: parent_obj{parent}
{
if ( parent ) // add object to parent
{
if ( parent ) // add object to parent
parent->addChild(this);
}
else
{
timer_modify_lock = false;
if ( ! timer_list )
{
try
{
timer_list = new FTimerList;
}
catch (const std::bad_alloc&)
{
badAllocOutput ("FTimerList");
return;
}
}
}
}
//----------------------------------------------------------------------
@ -73,12 +55,6 @@ FObject::~FObject() // destructor
{
delOwnTimers(); // Delete all timers of this object
if ( ! has_parent && timer_list )
{
delete timer_list;
timer_list = nullptr;
}
if ( ! has_parent && ! fc::emptyFString::isNull() )
fc::emptyFString::clear();
@ -268,6 +244,7 @@ int FObject::addTimer (int interval)
timeval currentTime{};
int id{1};
timer_modify_lock = true;
auto& timer_list = globalTimerList();
// find an unused timer id
if ( ! timer_list->empty() )
@ -317,6 +294,7 @@ bool FObject::delTimer (int id) const
return false;
timer_modify_lock = true;
auto& timer_list = globalTimerList();
auto iter = timer_list->begin();
const auto& last = timer_list->end();
@ -339,6 +317,8 @@ bool FObject::delOwnTimers() const
{
// Deletes all timers of this object
auto& timer_list = globalTimerList();
if ( ! timer_list )
return false;
@ -365,6 +345,8 @@ bool FObject::delAllTimers() const
{
// Deletes all timers of all objects
auto& timer_list = globalTimerList();
if ( ! timer_list )
return false;
@ -405,6 +387,8 @@ uInt FObject::processTimerEvent()
if ( isTimerInUpdating() )
return 0;
auto& timer_list = globalTimerList();
if ( ! timer_list )
return 0;
@ -440,4 +424,11 @@ void FObject::performTimerAction (FObject*, FEvent*)
// to process the passed object and timer event
}
//----------------------------------------------------------------------
FObject::FTimerListPtr& FObject::globalTimerList()
{
static const auto& timer_list = make_unique<FTimerList>();
return timer_list;
}
} // namespace finalcut

View File

@ -47,10 +47,6 @@ FOptiAttr::FOptiAttr()
reset_byte_mask.attr.bit.printed = true;
}
//----------------------------------------------------------------------
FOptiAttr::~FOptiAttr() // destructor
{ }
// public methods of FOptiAttr
//----------------------------------------------------------------------

View File

@ -52,10 +52,6 @@ FOptiMove::FOptiMove (int baud)
set_cursor_down ("\n");
}
//----------------------------------------------------------------------
FOptiMove::~FOptiMove() // destructor
{ }
// public methods of FOptiMove
//----------------------------------------------------------------------
@ -608,7 +604,7 @@ int FOptiMove::capDurationToLength (int duration) const
//----------------------------------------------------------------------
int FOptiMove::repeatedAppend ( const Capability& o
, volatile int count
, int count
, char* dst ) const
{
const std::size_t src_len = std::strlen(o.cap);
@ -623,8 +619,9 @@ int FOptiMove::repeatedAppend ( const Capability& o
{
dst += dst_len;
std::size_t free = BUF_SIZE - dst_len - 2;
int cnt = count;
while ( count-- > 0 )
while ( cnt-- > 0 )
{
std::strncpy (dst, o.cap, free);
dst += src_len;

View File

@ -31,26 +31,7 @@ namespace finalcut
// class FPoint
//----------------------------------------------------------------------
FPoint::~FPoint() // destructor
{ }
// public methods of FPoint
//----------------------------------------------------------------------
FPoint& FPoint::operator = (const FPoint& p)
{
xpos = p.xpos;
ypos = p.ypos;
return *this;
}
//----------------------------------------------------------------------
FPoint& FPoint::operator = (FPoint&& p) noexcept
{
xpos = std::move(p.xpos);
ypos = std::move(p.ypos);
return *this;
}
//----------------------------------------------------------------------
FPoint& FPoint::operator += (const FPoint& p)
{

View File

@ -42,8 +42,7 @@ FProgressbar::FProgressbar(FWidget* parent)
}
//----------------------------------------------------------------------
FProgressbar::~FProgressbar() // destructor
{ }
FProgressbar::~FProgressbar() noexcept = default; // destructor
// public methods of FProgressbar

View File

@ -46,8 +46,7 @@ FRadioButton::FRadioButton (const FString& txt, FWidget* parent)
}
//----------------------------------------------------------------------
FRadioButton::~FRadioButton() // destructor
{ }
FRadioButton::~FRadioButton() noexcept = default; // destructor
// private methods of FRadioButton

View File

@ -49,8 +49,7 @@ FRadioMenuItem::FRadioMenuItem (const FString& txt, FWidget* parent)
}
//----------------------------------------------------------------------
FRadioMenuItem::~FRadioMenuItem() // destructor
{ }
FRadioMenuItem::~FRadioMenuItem() noexcept = default; // destructor
// private methods of FRadioMenuItem

View File

@ -51,32 +51,8 @@ FRect::FRect (const FPoint& p1, const FPoint& p2)
, Y2{p2.getY()}
{ }
//----------------------------------------------------------------------
FRect::~FRect() // destructor
{ }
// public methods of FRect
//----------------------------------------------------------------------
FRect& FRect::operator = (const FRect& r)
{
X1 = r.X1;
Y1 = r.Y1;
X2 = r.X2;
Y2 = r.Y2;
return *this;
}
//----------------------------------------------------------------------
FRect& FRect::operator = (FRect&& r) noexcept
{
X1 = std::move(r.X1);
Y1 = std::move(r.Y1);
X2 = std::move(r.X2);
Y2 = std::move(r.Y2);
return *this;
}
//----------------------------------------------------------------------
bool FRect::isEmpty() const
{

View File

@ -33,26 +33,7 @@ namespace finalcut
// class FSize
//----------------------------------------------------------------------
FSize::~FSize() // destructor
{ }
// public methods of FSize
//----------------------------------------------------------------------
FSize& FSize::operator = (const FSize& s)
{
width = s.width;
height = s.height;
return *this;
}
//----------------------------------------------------------------------
FSize& FSize::operator = (FSize&& s) noexcept
{
width = std::move(s.width);
height = std::move(s.height);
return *this;
}
//----------------------------------------------------------------------
FSize& FSize::operator += (const FSize& s)
{

View File

@ -48,8 +48,7 @@ FSpinBox::FSpinBox (FWidget* parent)
}
//----------------------------------------------------------------------
FSpinBox::~FSpinBox() // destructor
{ }
FSpinBox::~FSpinBox() noexcept = default; // destructor
// public methods of FSpinBox

View File

@ -54,35 +54,13 @@ FStartOptions::FStartOptions()
, dark_theme{false}
{ }
//----------------------------------------------------------------------
FStartOptions::~FStartOptions() // destructor
{ }
// public methods of FStartOptions
//----------------------------------------------------------------------
FStartOptions& FStartOptions::getFStartOptions()
{
if ( start_options == nullptr )
{
try
{
start_options = new FStartOptions;
}
catch (const std::bad_alloc&)
{
badAllocOutput ("FStartOptions");
std::abort();
}
}
return *start_options;
}
//----------------------------------------------------------------------
void FStartOptions::destroyObject()
{
if ( start_options )
delete start_options;
static const auto& start_options = make_unique<FStartOptions>();
return *start_options.get();
}
//----------------------------------------------------------------------

View File

@ -143,12 +143,12 @@ FStatusBar::~FStatusBar() // destructor
while ( iter != key_list.end() )
{
(*iter)->setConnectedStatusbar(nullptr);
delAccelerator (*iter);
FWidget::delAccelerator (*iter);
iter = key_list.erase(iter);
}
}
setStatusBar(nullptr);
FWidget::setStatusBar(nullptr);
}

View File

@ -49,8 +49,7 @@ FSwitch::FSwitch (const FString& txt, FWidget* parent)
}
//----------------------------------------------------------------------
FSwitch::~FSwitch() // destructor
{ }
FSwitch::~FSwitch() noexcept = default; // destructor
// public methods of FSwitch

View File

@ -3,7 +3,7 @@
* *
* This file is part of the FINAL CUT widget toolkit *
* *
* Copyright 2019 Markus Gans *
* Copyright 2019-2020 Markus Gans *
* *
* FINAL CUT is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
@ -31,12 +31,7 @@ namespace finalcut
// constructors and destructor
//----------------------------------------------------------------------
FSystem::FSystem()
{ }
//----------------------------------------------------------------------
FSystem::~FSystem() // destructor
{ }
FSystem::~FSystem() noexcept = default; // destructor
} // namespace finalcut

View File

@ -35,12 +35,8 @@ namespace finalcut
// constructors and destructor
//----------------------------------------------------------------------
FSystemImpl::FSystemImpl()
{ }
FSystemImpl::~FSystemImpl() noexcept = default; // destructor
//----------------------------------------------------------------------
FSystemImpl::~FSystemImpl() // destructor
{ }
// public methods of FSystemImpl
//----------------------------------------------------------------------

View File

@ -1419,7 +1419,7 @@ void FTerm::init_alt_charset()
}
}
enum column
enum Column : int
{
vt100_key = 0,
utf8_char = 1
@ -2272,7 +2272,6 @@ inline void FTerm::deallocationValues()
const defaultPutChar* putchar_ptr = &(putchar());
delete putchar_ptr;
destroyColorPaletteTheme();
FStartOptions::destroyObject();
}
//----------------------------------------------------------------------

View File

@ -43,15 +43,15 @@ namespace finalcut
{
// Enumeration
enum fullWidthSupport
enum class FullWidthSupport
{
unknown_fullwidth_support = -1,
supports_fullwidth = 0,
no_fullwidth_support = 1
unknown = -1,
no = 0,
yes = 1
};
// global state
static fullWidthSupport has_fullwidth_support = unknown_fullwidth_support;
static FullWidthSupport has_fullwidth_support = FullWidthSupport::unknown;
// Function prototypes
bool hasAmbiguousWidth (wchar_t);
@ -250,7 +250,7 @@ bool hasFullWidthSupports()
{
// Checks if the terminal has full-width character support
if ( has_fullwidth_support == unknown_fullwidth_support )
if ( has_fullwidth_support == FullWidthSupport::unknown )
{
if ( ! FTerm::isInitialized() )
return true; // Assume that it is a modern terminal with full-width support
@ -262,12 +262,12 @@ bool hasFullWidthSupports()
|| FTerm::isOpenBSDTerm()
|| FTerm::isSunTerminal()
|| FTerm::isAnsiTerminal() )
has_fullwidth_support = no_fullwidth_support;
has_fullwidth_support = FullWidthSupport::no;
else
has_fullwidth_support = supports_fullwidth;
has_fullwidth_support = FullWidthSupport::yes;
}
return ( has_fullwidth_support == supports_fullwidth) ? true : false;
return ( has_fullwidth_support == FullWidthSupport::yes) ? true : false;
}
//----------------------------------------------------------------------
@ -528,7 +528,7 @@ std::size_t getColumnWidth (const FTermBuffer& tb)
, tb.front().attr.bit.char_width
, [] (std::size_t s, const FChar& c)
{
return std::move(s) + c.attr.bit.char_width;
return s + c.attr.bit.char_width;
}
);
}

View File

@ -38,8 +38,8 @@ namespace finalcut
//----------------------------------------------------------------------
// class FTermBuffer
//----------------------------------------------------------------------
FTermBuffer::~FTermBuffer() // destructor
{ }
FTermBuffer::~FTermBuffer() noexcept = default; // destructor
// public methods of FTermBuffer
//----------------------------------------------------------------------
@ -72,7 +72,7 @@ int FTermBuffer::write (const FString& string)
nc.attr.byte[2] = 0;
nc.attr.byte[3] = 0;
getColumnWidth(nc); // add column width
data.push_back(std::move(nc));
data.emplace_back(std::move(nc));
}
return len;
@ -86,8 +86,7 @@ int FTermBuffer::write (wchar_t ch)
getColumnWidth(nc); // add column width
nc.attr.bit.no_changes = false;
nc.attr.bit.printed = false;
data.push_back(nc);
data.emplace_back(std::move(nc));
return 1;
}

View File

@ -43,16 +43,6 @@ FTermDetection* FTermcapQuirks::term_detection {nullptr};
// class FTermcapQuirks
//----------------------------------------------------------------------
// constructors and destructor
//----------------------------------------------------------------------
FTermcapQuirks::FTermcapQuirks()
{ }
//----------------------------------------------------------------------
FTermcapQuirks::~FTermcapQuirks() // destructor
{ }
// public methods of FTermcapQuirks
//----------------------------------------------------------------------
void FTermcapQuirks::terminalFixup()

View File

@ -52,10 +52,6 @@ FTermios::FTermios()
init();
}
//----------------------------------------------------------------------
FTermios::~FTermios() // destructor
{ }
// public methods of FTermios
//----------------------------------------------------------------------
void FTermios::init()

View File

@ -52,11 +52,6 @@ namespace finalcut
// class FTermOpenBSD
//----------------------------------------------------------------------
// constructors and destructor
//----------------------------------------------------------------------
FTermOpenBSD::~FTermOpenBSD() // destructor
{ }
// public methods of FTermOpenBSD
//----------------------------------------------------------------------
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)

View File

@ -70,10 +70,6 @@ FTermXTerminal::FTermXTerminal()
keyboard = FTerm::getFKeyboard();
}
//----------------------------------------------------------------------
FTermXTerminal::~FTermXTerminal() // destructor
{ }
// public methods of FTermXTerminal
//----------------------------------------------------------------------

View File

@ -48,8 +48,7 @@ FTextView::FTextView(FWidget* parent)
}
//----------------------------------------------------------------------
FTextView::~FTextView() // destructor
{ }
FTextView::~FTextView() noexcept = default; // destructor
// public methods of FTextView

View File

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

View File

@ -443,8 +443,7 @@ int FVTerm::print (FTermArea* area, const FTermBuffer& term_buffer)
//----------------------------------------------------------------------
int FVTerm::print (wchar_t c)
{
FChar nc{}; // next character
nc = FVTerm::getAttribute();
FChar nc{FVTerm::getAttribute()}; // next character
nc.ch[0] = c;
nc.attr.byte[2] = 0;
nc.attr.byte[3] = 0;

View File

@ -126,7 +126,7 @@ class FButtonGroup : public FScrollView
// Methods
void init();
void drawText (const FString&, std::size_t);
void drawText (FString&&, std::size_t);
bool directFocusCheckedRadioButton (FToggleButton*) const;
bool directFocusRadioButton() const;
void directFocus();

View File

@ -72,7 +72,7 @@ class FCheckBox : public FToggleButton
FCheckBox (const FCheckBox&) = delete;
// Destructor
~FCheckBox() override;
~FCheckBox() noexcept override;
// Disable copy assignment operator (=)
FCheckBox& operator = (const FCheckBox&) = delete;

View File

@ -72,7 +72,7 @@ class FCheckMenuItem : public FMenuItem
FCheckMenuItem (const FCheckMenuItem&) = delete;
// Destructor
~FCheckMenuItem() override;
~FCheckMenuItem() noexcept override;
// Disable copy assignment operator (=)
FCheckMenuItem& operator = (const FCheckMenuItem&) = delete;

View File

@ -142,7 +142,7 @@ class FComboBox : public FWidget
FComboBox (const FComboBox&) = delete;
// Destructor
~FComboBox() override;
~FComboBox() noexcept override;
// Disable copy assignment operator (=)
FComboBox& operator = (const FComboBox&) = delete;

View File

@ -78,7 +78,7 @@ class FDialogListMenu : public FMenu
FDialogListMenu (const FDialogListMenu&) = delete;
// Destructor
~FDialogListMenu() override;
~FDialogListMenu() noexcept override;
// Disable copy assignment operator (=)
FDialogListMenu& operator = (const FDialogListMenu&) = delete;

View File

@ -127,7 +127,7 @@ class FKeyEvent : public FEvent // keyboard event
public:
FKeyEvent() = default;
FKeyEvent (fc::events, FKey);
~FKeyEvent();
~FKeyEvent() = default;
FKey key() const;
bool isAccepted() const;
@ -150,7 +150,7 @@ class FMouseEvent : public FEvent // mouse event
FMouseEvent() = default;
FMouseEvent (fc::events, const FPoint&, const FPoint&, int);
FMouseEvent (fc::events, const FPoint&, int);
~FMouseEvent();
~FMouseEvent() = default;
const FPoint& getPos() const;
const FPoint& getTermPos() const;
@ -177,7 +177,7 @@ class FWheelEvent : public FEvent // wheel event
FWheelEvent() = default;
FWheelEvent (fc::events, const FPoint&, int);
FWheelEvent (fc::events, const FPoint&, const FPoint&, int);
~FWheelEvent();
~FWheelEvent() = default;
const FPoint& getPos() const;
const FPoint& getTermPos() const;
@ -203,7 +203,7 @@ class FFocusEvent : public FEvent // focus event
public:
FFocusEvent() = default;
explicit FFocusEvent (fc::events);
~FFocusEvent();
~FFocusEvent() = default;
bool gotFocus() const;
bool lostFocus() const;
@ -230,7 +230,7 @@ class FAccelEvent : public FEvent // focus event
FAccelEvent() = default;
FAccelEvent (fc::events, FWidget*);
FAccelEvent (const FAccelEvent&) = delete;
~FAccelEvent();
~FAccelEvent() = default;
FAccelEvent& operator = (const FAccelEvent&) = delete;
FWidget* focusedWidget() const;
@ -253,7 +253,7 @@ class FResizeEvent : public FEvent // resize event
public:
FResizeEvent() = default;
explicit FResizeEvent (fc::events);
~FResizeEvent();
~FResizeEvent() = default;
bool isAccepted() const;
void accept();
@ -273,7 +273,7 @@ class FShowEvent : public FEvent // show event
public:
FShowEvent() = default;
explicit FShowEvent (fc::events);
~FShowEvent();
~FShowEvent() = default;
};
@ -286,7 +286,7 @@ class FHideEvent : public FEvent // hide event
public:
FHideEvent() = default;
explicit FHideEvent (fc::events);
~FHideEvent();
~FHideEvent() = default;
};
@ -299,7 +299,7 @@ class FCloseEvent : public FEvent // close event
public:
FCloseEvent() = default;
explicit FCloseEvent(fc::events);
~FCloseEvent();
~FCloseEvent() = default;
bool isAccepted() const;
void accept();
@ -319,7 +319,7 @@ class FTimerEvent : public FEvent // timer event
public:
FTimerEvent() = default;
FTimerEvent (fc::events, int);
~FTimerEvent();
~FTimerEvent() = default;
int getTimerId() const;
@ -341,7 +341,7 @@ class FUserEvent : public FEvent // user event
FUserEvent (const FUserEvent&) = delete;
FUserEvent (fc::events, int);
~FUserEvent();
~FUserEvent() = default;
// Disable copy assignment operator (=)
FUserEvent& operator = (const FUserEvent&) = delete;

View File

@ -100,7 +100,7 @@ class FKeyboard final
FKeyboard (const FKeyboard&) = delete;
// Destructor
~FKeyboard();
~FKeyboard() = default;
// Disable copy assignment operator (=)
FKeyboard& operator = (const FKeyboard&) = delete;

View File

@ -163,8 +163,8 @@ class FLineEdit : public FWidget
void adjustSize() override;
private:
// Typedef
typedef std::pair<std::size_t, std::size_t> offsetPair;
// Using-declaration
using offsetPair = std::pair<std::size_t, std::size_t>;
// Enumeration
enum dragScroll

View File

@ -73,13 +73,13 @@ class FListBoxItem
{
public:
// Constructors
FListBoxItem ();
FListBoxItem() = default;
FListBoxItem (const FListBoxItem&); // copy constructor
template <typename DT = std::nullptr_t>
explicit FListBoxItem (const FString&, DT&& = DT() );
// Destructor
virtual ~FListBoxItem();
virtual ~FListBoxItem() noexcept;
// copy copy assignment operator (=)
FListBoxItem& operator = (const FListBoxItem&);

View File

@ -219,23 +219,16 @@ class FListViewIterator
using iterator_stack = std::stack<iterator>;
// Constructor
FListViewIterator ();
FListViewIterator () = default;
FListViewIterator (iterator);
FListViewIterator (const FListViewIterator&); // copy constructor
FListViewIterator (FListViewIterator&&) noexcept; // move constructor
// Destructor
~FListViewIterator();
// Overloaded operators
FListViewIterator& operator = (const FListViewIterator&);
FListViewIterator& operator = (FListViewIterator&&) noexcept;
FListViewIterator& operator ++ (); // prefix
FListViewIterator operator ++ (int); // postfix
FListViewIterator& operator -- (); // prefix
FListViewIterator operator -- (int); // postfix
FListViewIterator& operator += (volatile int);
FListViewIterator& operator -= (volatile int);
FListViewIterator& operator += (int);
FListViewIterator& operator -= (int);
FObject*& operator * () const;
FObject* operator -> () const;
bool operator == (const FListViewIterator&) const;
@ -542,8 +535,7 @@ class FListView : public FWidget
struct FListView::Header
{
public:
Header()
{ }
Header () = default;
FString name{};
fc::text_alignment alignment{fc::alignLeft};

View File

@ -102,17 +102,16 @@ class FMenuBar : public FWindow, public FMenuList
void cb_itemDeactivated (const FMenuItem*) const;
private:
// Constants
static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Typedef
typedef struct
struct menuText
{
FString text;
std::size_t startpos;
std::size_t hotkeypos;
bool no_underline;
} menuText;
};
// Constants
static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Inquiry
bool isMenu (const FMenuItem*) const;

View File

@ -59,6 +59,10 @@
#include <cstring>
#include <array>
#include <memory>
#include "final/fbutton.h"
#include "final/fdialog.h"
#include "final/fwidgetcolors.h"
@ -95,7 +99,7 @@ class FMessageBox : public FDialog
, ButtonType, ButtonType, ButtonType
, FWidget* = nullptr );
// Destructor
~FMessageBox() override;
virtual ~FMessageBox() noexcept override;
// copy assignment operator (=)
FMessageBox& operator = (const FMessageBox&);
@ -140,10 +144,12 @@ class FMessageBox : public FDialog
// Constants
static constexpr std::size_t MAX_BUTTONS = 3;
// Using-declaration
using FButtons = std::array<std::unique_ptr<FButton>, MAX_BUTTONS>;
// Methods
void init();
void allocation();
void deallocation();
void initCallbacks();
void calculateDimensions();
void draw() override;
@ -154,7 +160,8 @@ class FMessageBox : public FDialog
FString headline_text{};
FString text{};
FStringList text_components{};
FButton* button[MAX_BUTTONS]{nullptr};
FButtons button;
std::size_t max_line_width{0};
FColor emphasis_color{getColorTheme()->dialog_emphasis_fg};
ButtonType button_digit[MAX_BUTTONS]{FMessageBox::Reject};

View File

@ -257,7 +257,7 @@ class FMouseGPM final : public FMouse
FMouseGPM();
// Destructor
~FMouseGPM() override;
~FMouseGPM() override = default;
// Accessors
FString getClassName() const override;
@ -581,13 +581,14 @@ class FMouseControl
void drawPointer();
private:
// Typedef
typedef std::map<FMouse::mouse_type, FMouse*> FMouseProtocol;
typedef std::unique_ptr<FMouseData> FMouseDataPtr;
// Using-declaration
using FMousePtr = std::unique_ptr<FMouse>;
using FMouseDataPtr = std::unique_ptr<FMouseData>;
using FMouseProtocol = std::map<FMouse::mouse_type, FMousePtr>;
// Accessor
FMouse* getMouseWithData();
FMouse* getMouseWithEvent();
FMouse::mouse_type getMouseWithData();
FMouse::mouse_type getMouseWithEvent();
void xtermMouse (bool) const;
void enableXTermMouse() const;
void disableXTermMouse() const;

View File

@ -150,8 +150,9 @@ class FObject
FObject* object;
};
// Typedefs
typedef std::vector<FTimerData> FTimerList;
// Using-declaration
using FTimerList = std::vector<FTimerData>;
using FTimerListPtr = const std::unique_ptr<FTimerList>;
// Accessor
FTimerList* getTimerList() const;
@ -169,6 +170,7 @@ class FObject
private:
// Method
virtual void performTimerAction (FObject*, FEvent*);
static FTimerListPtr& globalTimerList();
// Data members
FObject* parent_obj{nullptr};
@ -177,7 +179,6 @@ class FObject
bool has_parent{false};
bool widget_object{false};
static bool timer_modify_lock;
static FTimerList* timer_list;
};
@ -267,7 +268,7 @@ inline bool FObject::isTimerInUpdating() const
//----------------------------------------------------------------------
inline FObject::FTimerList* FObject::getTimerList() const
{ return timer_list; }
{ return globalTimerList().get(); }
//----------------------------------------------------------------------
inline void FObject::setWidgetProperty (bool property)

View File

@ -51,8 +51,7 @@ namespace finalcut
class FOptiAttr final
{
public:
// Typedef
typedef struct
struct TermEnv
{
const char* t_enter_bold_mode;
const char* t_exit_bold_mode;
@ -92,7 +91,7 @@ class FOptiAttr final
int max_color;
int attr_without_color;
bool ansi_default_color;
} TermEnv;
};
// Constructor
FOptiAttr();
@ -101,7 +100,7 @@ class FOptiAttr final
FOptiAttr (const FOptiAttr&) = delete;
// Destructor
~FOptiAttr();
~FOptiAttr() noexcept = default;
// Disable copy assignment operator (=)
FOptiAttr& operator = (const FOptiAttr&) = delete;

View File

@ -89,7 +89,7 @@ class FOptiMove final
explicit FOptiMove (int = 0);
// Destructor
~FOptiMove();
~FOptiMove() noexcept = default;
// Accessors
FString getClassName() const;
@ -168,7 +168,7 @@ class FOptiMove final
void calculateCharDuration();
int capDuration (const char[], int) const;
int capDurationToLength (int) const;
int repeatedAppend (const Capability&, volatile int, char*) const;
int repeatedAppend (const Capability&, int, char*) const;
int relativeMove (char[], int, int, int, int) const;
int verticalMove (char[], int, int) const;
void downMove (char[], int&, int, int) const;

View File

@ -52,21 +52,14 @@ class FPoint
public:
// Constructors
FPoint () = default;
FPoint (const FPoint&); // copy constructor
FPoint (FPoint&&) noexcept; // move constructor
FPoint (int, int);
// Destructor
virtual ~FPoint();
// Overloaded operators
FPoint& operator = (const FPoint&);
FPoint& operator = (FPoint&&) noexcept;
FPoint& operator += (const FPoint&);
FPoint& operator -= (const FPoint&);
// Accessors
virtual FString getClassName();
FString getClassName();
int getX() const;
int getY() const;
void setX (int);
@ -102,18 +95,6 @@ class FPoint
// FPoint inline functions
//----------------------------------------------------------------------
inline FPoint::FPoint (const FPoint& p) // copy constructor
: xpos{p.xpos}
, ypos{p.ypos}
{ }
//----------------------------------------------------------------------
inline FPoint::FPoint (FPoint&& p) noexcept // move constructor
: xpos{std::move(p.xpos)}
, ypos{std::move(p.ypos)}
{ }
//----------------------------------------------------------------------
inline FPoint::FPoint (int x, int y)
: xpos{x}

View File

@ -66,7 +66,7 @@ class FProgressbar : public FWidget
explicit FProgressbar(FWidget* = nullptr);
// Destructor
~FProgressbar() override;
~FProgressbar() noexcept override;
// Accessors
FString getClassName() const override;

View File

@ -72,7 +72,7 @@ class FRadioButton : public FToggleButton
FRadioButton (const FRadioButton&) = delete;
// Destructor
~FRadioButton() override;
~FRadioButton() noexcept override;
// Disable copy assignment operator (=)
FRadioButton& operator = (const FRadioButton&) = delete;

View File

@ -72,7 +72,7 @@ class FRadioMenuItem : public FMenuItem
FRadioMenuItem (const FRadioMenuItem&) = delete;
// Destructor
~FRadioMenuItem() override;
~FRadioMenuItem() noexcept override;
// Disable copy assignment operator (=)
FRadioMenuItem& operator = (const FRadioMenuItem&) = delete;

View File

@ -60,21 +60,12 @@ class FRect
public:
// Constructors
FRect () = default;
FRect (const FRect&); // copy constructor
FRect (FRect&&) noexcept; // move constructor
FRect (int, int, std::size_t, std::size_t);
FRect (const FPoint&, const FSize&);
FRect (const FPoint&, const FPoint&);
// Destructor
virtual ~FRect();
// Overloaded operators
FRect& operator = (const FRect&);
FRect& operator = (FRect&&) noexcept;
// Accessors
virtual FString getClassName();
FString getClassName();
int getX1() const;
int getY1() const;
int getX2() const;
@ -147,22 +138,6 @@ class FRect
};
// FRect inline functions
//----------------------------------------------------------------------
inline FRect::FRect (const FRect& r) // copy constructor
: X1{r.X1}
, Y1{r.Y1}
, X2{r.X2}
, Y2{r.Y2}
{ }
//----------------------------------------------------------------------
inline FRect::FRect (FRect&& r) noexcept // move constructor
: 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)
: X1{x}

View File

@ -60,8 +60,8 @@ namespace finalcut
// class forward declaration
class FScrollbar;
// Global typedef
typedef std::shared_ptr<FScrollbar> FScrollbarPtr;
// Global using-declaration
using FScrollbarPtr = std::shared_ptr<FScrollbar>;
//----------------------------------------------------------------------
// class FScrollbar
@ -70,7 +70,7 @@ typedef std::shared_ptr<FScrollbar> FScrollbarPtr;
class FScrollbar : public FWidget
{
public:
// Using-declarations
// Using-declaration
using FWidget::setGeometry;
// Enumeration

View File

@ -57,21 +57,14 @@ class FSize
public:
// Constructors
FSize () = default;
FSize (const FSize&); // copy constructor
FSize (FSize&&) noexcept; // move constructor
FSize (std::size_t, std::size_t);
// Destructor
virtual ~FSize();
// Overloaded operators
FSize& operator = (const FSize&);
FSize& operator = (FSize&&) noexcept;
FSize& operator += (const FSize&);
FSize& operator -= (const FSize&);
// Accessors
virtual FString getClassName();
FString getClassName();
std::size_t getWidth() const;
std::size_t getHeight() const;
std::size_t getArea() const;
@ -111,18 +104,6 @@ class FSize
};
// FSize inline functions
//----------------------------------------------------------------------
inline FSize::FSize (const FSize& s) // copy constructor
: width{s.width}
, height{s.height}
{ }
//----------------------------------------------------------------------
inline FSize::FSize (FSize&& s) noexcept // move constructor
: width{std::move(s.width)}
, height{std::move(s.height)}
{ }
//----------------------------------------------------------------------
inline FSize::FSize (std::size_t w, std::size_t h)
: width{w}

View File

@ -74,7 +74,7 @@ class FSpinBox : public FWidget
FSpinBox (const FSpinBox&) = delete;
// Destructor
~FSpinBox() override;
~FSpinBox() noexcept override;
// Disable copy assignment operator (=)
FSpinBox& operator = (const FSpinBox&) = delete;

View File

@ -59,7 +59,7 @@ class FStartOptions final
FStartOptions (const FStartOptions&) = delete;
// Destructor
~FStartOptions();
~FStartOptions() = default;
// Disable copy assignment operator (=)
FStartOptions& operator = (const FStartOptions&) = delete;
@ -71,9 +71,6 @@ class FStartOptions final
// Mutator
void setDefault();
// Method
static void destroyObject();
// Data members
uInt8 cursor_optimisation : 1;
uInt8 mouse_support : 1;

View File

@ -68,8 +68,8 @@ namespace finalcut
// class forward declaration
class FString;
// Global typedef
typedef std::vector<FString> FStringList;
// Global using-declaration
using FStringList = std::vector<FString>;
//----------------------------------------------------------------------

View File

@ -54,21 +54,6 @@ class FStyle
: attribute{attr}
{ }
// Copy constructor
FStyle (const FStyle& style)
: attribute{style.attribute}
{ }
// Destructor
~FStyle() = default;
// copy assignment operator (=)
FStyle& operator = (const FStyle& style)
{
attribute = style.attribute;
return *this;
}
// Accessor
FString getClassName() const
{ return "FStyle"; }

View File

@ -72,7 +72,7 @@ class FSwitch : public FToggleButton
FSwitch (const FSwitch&) = delete;
// Destructor
~FSwitch() override;
~FSwitch() noexcept override;
// Disable copy assignment operator (=)
FSwitch& operator = (const FSwitch&) = delete;

View File

@ -52,10 +52,10 @@ class FSystem
using fn_putc = int (*)(int);
// Constructor
FSystem();
FSystem () = default;
// Destructor
virtual ~FSystem();
virtual ~FSystem() noexcept;
// Methods
virtual uChar inPortByte (uShort) = 0;

View File

@ -97,10 +97,10 @@ class FSystemImpl : public FSystem
{
public:
// Constructor
FSystemImpl();
FSystemImpl() = default;
// Destructor
~FSystemImpl() override;
~FSystemImpl() noexcept override;
// Methods
#if defined(ISA_SYSCTL_SUPPORT)

View File

@ -161,10 +161,10 @@ class FTermXTerminal;
class FTerm final
{
public:
// Typedef
typedef std::function<int(int)> defaultPutChar;
typedef std::shared_ptr<FColorPalette> FColorPalettePtr;
typedef FColorPalette::FSetPalette FSetPalette;
// Using-declarations
using defaultPutChar = std::function<int(int)>;
using FColorPalettePtr = std::shared_ptr<FColorPalette>;
using FSetPalette = FColorPalette::FSetPalette;
// Constructor
FTerm();

View File

@ -69,7 +69,7 @@ class FTermBuffer
FTermBuffer (Iterator, Iterator);
// Destructor
virtual ~FTermBuffer();
virtual ~FTermBuffer() noexcept;
// Overloaded operators
template <typename typeT>

View File

@ -50,10 +50,10 @@ class FTermcapQuirks final
{
public:
// Constructors
FTermcapQuirks();
FTermcapQuirks() = default;
// Destructor
~FTermcapQuirks();
~FTermcapQuirks() noexcept = default;
// Accessor
FString getClassName() const;

View File

@ -57,15 +57,13 @@ class FTermData final
typedef std::unordered_map<std::string, fc::encoding> EncodingMap;
// Constructors
FTermData()
{ }
FTermData () = default;
// Disable copy constructor
FTermData (const FTermData&) = delete;
// Destructor
~FTermData()
{ }
~FTermData() noexcept = default;
// Disable copy assignment operator (=)
FTermData& operator = (const FTermData&) = delete;

View File

@ -50,8 +50,7 @@ namespace finalcut
class FTermDetection final
{
public:
// Typedefs
typedef struct
struct FTerminalType
{
// byte #0
uInt8 ansi : 1;
@ -77,7 +76,7 @@ class FTermDetection final
uInt8 kterm : 1;
uInt8 mlterm : 1;
uInt8 : 4; // padding bits
} FTerminalType;
};
// Constructors
FTermDetection();

View File

@ -79,8 +79,8 @@ class FTermData;
class FTermFreeBSD final
{
public:
// Typedef
typedef fc::freebsdConsoleCursorStyle CursorStyle;
// Using-declaration
using CursorStyle = fc::freebsdConsoleCursorStyle;
// Constructors
FTermFreeBSD() = default;

View File

@ -55,7 +55,7 @@ class FTermios final
FTermios();
// Destructor
~FTermios();
~FTermios() noexcept = default;
// Accessors
FString getClassName() const;

View File

@ -77,8 +77,8 @@ class FTermDetection;
class FTermLinux final
{
public:
// Typedef
typedef fc::linuxConsoleCursorStyle CursorStyle;
// Using-declaration
using CursorStyle = fc::linuxConsoleCursorStyle;
// Constructors
FTermLinux() = default;
@ -123,7 +123,6 @@ class FTermLinux final
FKey modifierKeyCorrection (const FKey&);
private:
// Typedef
struct ModifierKey // bit field
{
uChar shift : 1; // 0..1
@ -133,17 +132,17 @@ class FTermLinux final
uChar : 4; // padding bits
};
typedef struct
struct RGB
{
uChar red;
uChar green;
uChar blue;
} RGB;
};
typedef struct
struct ColorMap
{
RGB color[16];
} ColorMap;
};
// Accessors
int getFramebuffer_bpp();

View File

@ -81,7 +81,7 @@ class FTermOpenBSD final
FTermOpenBSD (const FTermOpenBSD&) = delete;
// Destructor
~FTermOpenBSD();
~FTermOpenBSD() noexcept = default;
// Disable copy assignment operator (=)
FTermOpenBSD& operator = (const FTermOpenBSD&) = delete;

View File

@ -58,7 +58,7 @@ class FTermXTerminal final
FTermXTerminal (const FTermXTerminal&) = delete;
// Destructor
~FTermXTerminal();
~FTermXTerminal() noexcept = default;
// Disable copy assignment operator (=)
FTermXTerminal& operator = (const FTermXTerminal&) = delete;

View File

@ -77,7 +77,7 @@ class FTextView : public FWidget
FTextView (const FTextView&) = delete;
// Destructor
~FTextView() override;
~FTextView() noexcept override;
// Disable copy assignment operator (=)
FTextView& operator = (const FTextView&) = delete;

View File

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

View File

@ -36,6 +36,7 @@
#include <array>
#include <functional>
#include <limits>
#include <memory>
#include <unordered_map>
#include <string>
@ -49,29 +50,28 @@
<< " in " \
<< __func__ << std::endl;
typedef unsigned char uChar;
typedef unsigned short uShort;
typedef unsigned int uInt;
typedef unsigned long uLong;
typedef std::uint8_t uInt8;
typedef std::uint16_t uInt16;
typedef std::uint32_t uInt32;
typedef std::uint64_t uInt64;
using uChar = unsigned char;
using uShort = unsigned short;
using uInt = unsigned int;
using uLong = unsigned long;
using uInt8 = std::uint8_t;
using uInt16 = std::uint16_t;
using uInt32 = std::uint32_t;
using uInt64 = std::uint64_t;
typedef signed int sInt;
typedef signed long sLong;
typedef std::int8_t sInt8;
typedef std::int16_t sInt16;
typedef std::int32_t sInt32;
typedef std::int64_t sInt64;
using sInt = signed int;
using sLong = signed long;
using sInt8 = std::int8_t;
using sInt16 = std::int16_t;
using sInt32 = std::int32_t;
using sInt64 = std::int64_t;
typedef long double lDouble;
using lDouble = long double;
typedef uInt16 FColor;
typedef uInt16 FAttribute;
typedef uInt32 FKey;
typedef void* FDataPtr;
typedef std::function<void()> FCall;
using FColor = uInt16;
using FAttribute = uInt16;
using FKey = uInt32;
using FCall = std::function<void()>;
namespace finalcut
{
@ -115,7 +115,13 @@ struct getPrecision
}
};
typedef std::unordered_map<wchar_t, wchar_t> charSubstitution;
template <typename T, typename... Args>
std::unique_ptr<T> make_unique (Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
using charSubstitution = std::unordered_map<wchar_t, wchar_t>;
struct FCharAttribute
{
@ -155,42 +161,39 @@ union attribute
static constexpr uInt UNICODE_MAX = 5;
typedef std::array<wchar_t, UNICODE_MAX> FUnicode;
using FUnicode = std::array<wchar_t, UNICODE_MAX>;
typedef struct
struct FChar
{
FUnicode ch; // Character code
FUnicode encoded_char; // Encoded output character
FColor fg_color; // Foreground color
FColor bg_color; // Background color
attribute attr; // Attributes
} FChar;
FUnicode ch{}; // Character code
FUnicode encoded_char{}; // Encoded output character
FColor fg_color{}; // Foreground color
FColor bg_color{}; // Background color
attribute attr{}; // Attributes
};
namespace fc
{
typedef struct
struct FKeyMap
{
FKey num;
const char* string;
char tname[4];
}
FKeyMap;
};
typedef struct
struct FMetakeyMap
{
FKey num;
char string[8];
}
FMetakeyMap;
};
typedef struct
struct FKeyName
{
FKey num;
char string[25];
}
FKeyName;
};
} // namespace fc
@ -198,7 +201,7 @@ FKeyName;
//----------------------------------------------------------------------
inline bool operator == (const FChar& lhs, const FChar& rhs)
{
return operator == (lhs.ch, rhs.ch)
return operator == (lhs.ch, rhs.ch) // Compare FUnicode
&& lhs.fg_color == rhs.fg_color
&& lhs.bg_color == rhs.bg_color
&& lhs.attr.byte[0] == rhs.attr.byte[0]

View File

@ -87,22 +87,22 @@ class FWidget;
class FVTerm
{
public:
// Typedefs and Enumeration
typedef struct
struct FTermArea; // forward declaration
struct FVTermPreprocessing; // forward declaration
struct FLineChanges
{
uInt xmin; // X-position with the first change
uInt xmax; // X-position with the last change
uInt trans_count; // Number of transparent characters
} FLineChanges;
};
typedef void (FVTerm::*FPreprocessingHandler)();
typedef std::function<void()> FPreprocessingFunction;
struct FTermArea; // forward declaration
struct FVTermPreprocessing; // forward declaration
typedef std::vector<FVTermPreprocessing> FPreprocessing;
// Using-declarations
using FPreprocessingHandler = void (FVTerm::*)();
using FPreprocessingFunction = std::function<void()> ;
using FPreprocessing = std::vector<FVTermPreprocessing>;
// Enumerations
enum covered_state
{
non_covered,
@ -500,50 +500,16 @@ struct FVTerm::FTermArea // define virtual terminal character properties
struct FVTerm::FVTermPreprocessing
{
// Constructor
FVTermPreprocessing()
: instance(nullptr)
, function(nullptr)
{ }
FVTermPreprocessing() = default;
FVTermPreprocessing (const FVTerm* i, const FPreprocessingFunction& f)
: instance(i)
, function(f)
{ }
FVTermPreprocessing (const FVTermPreprocessing& p) // copy constructor
: instance(p.instance)
, function(p.function)
{ }
FVTermPreprocessing (FVTermPreprocessing&& p) noexcept // move constructor
: instance(std::move(p.instance))
, function(std::move(p.function))
{ }
// Overloaded operators
FVTermPreprocessing& operator = (const FVTermPreprocessing& p)
{
instance = p.instance;
function = p.function;
return *this;
}
FVTermPreprocessing& operator = (FVTermPreprocessing&& p) noexcept
{
instance = p.instance;
function = p.function;
p.instance = nullptr;
p.function = nullptr;
return *this;
}
// Destructor
~FVTermPreprocessing()
{ }
// Data members
const FVTerm* instance{};
FPreprocessingFunction function{};
const FVTerm* instance{nullptr};
FPreprocessingFunction function{nullptr};
};

View File

@ -125,20 +125,18 @@ class FWidgetColors;
class FWidget : public FVTerm, public FObject
{
public:
// Using-declaration
using FVTerm::setColor;
using FVTerm::print;
struct FAccelerator
{
alignas(8) FKey key;
FWidget* object;
};
// Typedefs
typedef std::vector<FWidget*> FWidgetList;
typedef std::vector<FAccelerator> FAcceleratorList;
typedef std::shared_ptr<FWidgetColors> FWidgetColorsPtr;
// Using-declarations
using FVTerm::setColor;
using FVTerm::print;
using FWidgetList = std::vector<FWidget*>;
using FAcceleratorList = std::vector<FAccelerator>;
using FWidgetColorsPtr = std::shared_ptr<FWidgetColors>;
struct FWidgetFlags // Properties of a widget ⚑
{

View File

@ -61,7 +61,7 @@ class SGRoptimizer final
SGRoptimizer (const SGRoptimizer&) = delete;
// Destructor
~SGRoptimizer();
~SGRoptimizer() noexcept = default;
// Disable copy assignment operator (=)
SGRoptimizer& operator = (const SGRoptimizer&) = delete;

Some files were not shown because too many files have changed in this diff Show More