Improvement of the move semantics in FVTermPreprocessing
This commit is contained in:
parent
4517038521
commit
226663889b
|
@ -478,7 +478,7 @@ void FListViewItem::resetVisibleLineCounter()
|
|||
|
||||
// constructor and destructor
|
||||
//----------------------------------------------------------------------
|
||||
FListViewIterator::FListViewIterator (iterator iter)
|
||||
FListViewIterator::FListViewIterator (Iterator iter)
|
||||
: node{iter}
|
||||
{ }
|
||||
|
||||
|
@ -533,7 +533,7 @@ FListViewIterator& FListViewIterator::operator -= (int n)
|
|||
|
||||
// private methods of FListViewIterator
|
||||
//----------------------------------------------------------------------
|
||||
void FListViewIterator::nextElement (iterator& iter)
|
||||
void FListViewIterator::nextElement (Iterator& iter)
|
||||
{
|
||||
const auto& item = static_cast<FListViewItem*>(*iter);
|
||||
|
||||
|
@ -570,7 +570,7 @@ void FListViewIterator::nextElement (iterator& iter)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FListViewIterator::prevElement (iterator& iter)
|
||||
void FListViewIterator::prevElement (Iterator& iter)
|
||||
{
|
||||
auto start_iter = iter;
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ bool FTermLinux::setPalette (FColor, int, int, int)
|
|||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FTermLinux::isLinuxConsole()
|
||||
bool FTermLinux::isLinuxConsole() const
|
||||
{
|
||||
// Check if it's a Linux console
|
||||
|
||||
|
@ -484,7 +484,7 @@ FKey FTermLinux::modifierKeyCorrection (const FKey& key_id)
|
|||
|
||||
// private methods of FTermLinux
|
||||
//----------------------------------------------------------------------
|
||||
int FTermLinux::getFramebuffer_bpp()
|
||||
int FTermLinux::getFramebuffer_bpp() const
|
||||
{
|
||||
int fd{-1};
|
||||
const char* fb = "/dev/fb/0";
|
||||
|
@ -707,7 +707,7 @@ int FTermLinux::setScreenFont ( const uChar fontdata[], uInt count
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int FTermLinux::setUnicodeMap (struct unimapdesc* unimap)
|
||||
int FTermLinux::setUnicodeMap (struct unimapdesc* unimap) const
|
||||
{
|
||||
struct unimapinit advice;
|
||||
const int fd_tty = FTerm::getTTYFileDescriptor();
|
||||
|
@ -751,7 +751,7 @@ void FTermLinux::setLinuxCursorStyle (CursorStyle style) const
|
|||
|
||||
#if defined(ISA_SYSCTL_SUPPORT)
|
||||
//----------------------------------------------------------------------
|
||||
inline uInt16 FTermLinux::getInputStatusRegisterOne()
|
||||
inline uInt16 FTermLinux::getInputStatusRegisterOne() const
|
||||
{
|
||||
// Gets the VGA input-status-register-1
|
||||
|
||||
|
@ -1271,7 +1271,7 @@ FKey FTermLinux::shiftCtrlAltKeyCorrection (const FKey& key_id) const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTermLinux::initSpecialCharacter()
|
||||
inline void FTermLinux::initSpecialCharacter() const
|
||||
{
|
||||
const auto& fterm_data = FTerm::getFTermData();
|
||||
const wchar_t c1 = fc::UpperHalfBlock;
|
||||
|
@ -1311,7 +1311,7 @@ sInt16 FTermLinux::getFontPos (wchar_t ucs) const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FTermLinux::characterFallback ( wchar_t ucs
|
||||
, std::vector<wchar_t> fallback )
|
||||
, std::vector<wchar_t> fallback ) const
|
||||
{
|
||||
constexpr sInt16 NOT_FOUND = -1;
|
||||
const auto& fterm_data = FTerm::getFTermData();
|
||||
|
|
|
@ -298,14 +298,14 @@ bool FVTerm::updateTerminal() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::addPreprocessingHandler ( const FVTerm* instance
|
||||
, const FPreprocessingFunction& function )
|
||||
, FPreprocessingFunction&& function )
|
||||
{
|
||||
if ( ! print_area )
|
||||
FVTerm::getPrintArea();
|
||||
|
||||
if ( print_area )
|
||||
{
|
||||
FVTermPreprocessing obj{ instance, function };
|
||||
FVTermPreprocessing obj{ instance, std::move(function) };
|
||||
delPreprocessingHandler (instance);
|
||||
print_area->preproc_list.emplace_back(std::move(obj));
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ void FVTerm::delPreprocessingHandler (const FVTerm* instance)
|
|||
while ( iter != print_area->preproc_list.end() )
|
||||
{
|
||||
if ( iter->instance.get() == instance )
|
||||
iter = std::move(print_area->preproc_list.erase(iter));
|
||||
iter = print_area->preproc_list.erase(iter);
|
||||
else
|
||||
++iter;
|
||||
}
|
||||
|
|
|
@ -1149,12 +1149,12 @@ FVTerm::FTermArea* FWidget::getPrintArea()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::addPreprocessingHandler ( const FVTerm* instance
|
||||
, const FPreprocessingFunction& function )
|
||||
, FPreprocessingFunction&& function )
|
||||
{
|
||||
if ( ! getCurrentPrintArea() )
|
||||
FWidget::getPrintArea();
|
||||
|
||||
FVTerm::addPreprocessingHandler (instance, function);
|
||||
FVTerm::addPreprocessingHandler (instance, std::move(function));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -1781,8 +1781,6 @@ void FWidget::finish()
|
|||
delete window_list;
|
||||
window_list = nullptr;
|
||||
}
|
||||
|
||||
destroyColorTheme();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -2061,13 +2059,6 @@ void FWidget::initColorTheme()
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::destroyColorTheme()
|
||||
{
|
||||
const FWidgetColorsPtr* theme = &(getColorTheme());
|
||||
delete theme;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::removeQueuedEvent() const
|
||||
{
|
||||
|
|
|
@ -162,7 +162,7 @@ class FApplication : public FWidget
|
|||
using CmdOption = struct option;
|
||||
#endif
|
||||
|
||||
// Typedefs
|
||||
// Using-declaration
|
||||
using EventPair = std::pair<FObject*, FEvent*>;
|
||||
using FEventQueue = std::deque<EventPair>;
|
||||
using CmdMap = std::unordered_map<int, std::function<void(char*)>>;
|
||||
|
|
|
@ -211,8 +211,8 @@ class FCallback
|
|||
void emitCallback (const FString& emit_signal) const;
|
||||
|
||||
private:
|
||||
// Typedefs
|
||||
typedef std::vector<FCallbackData> FCallbackObjects;
|
||||
// Using-declaration
|
||||
using FCallbackObjects = std::vector<FCallbackData>;
|
||||
|
||||
// Data members
|
||||
FCallbackObjects callback_objects{};
|
||||
|
|
|
@ -49,8 +49,8 @@ namespace finalcut
|
|||
class FColorPalette
|
||||
{
|
||||
public:
|
||||
// Typedef
|
||||
typedef std::function<void(FColor, int, int, int)> FSetPalette;
|
||||
// Using-declaration
|
||||
using FSetPalette = std::function<void(FColor, int, int, int)>;
|
||||
|
||||
// Constructor
|
||||
explicit FColorPalette (const FSetPalette&);
|
||||
|
|
|
@ -155,15 +155,14 @@ class FDialog : public FWindow
|
|||
void onClose (FCloseEvent*) override;
|
||||
|
||||
private:
|
||||
// Typedef
|
||||
typedef struct
|
||||
struct MouseStates
|
||||
{
|
||||
int mouse_x;
|
||||
int mouse_y;
|
||||
FPoint termPos;
|
||||
std::size_t zoom_btn;
|
||||
bool mouse_over_menu;
|
||||
} MouseStates;
|
||||
};
|
||||
|
||||
// Constant
|
||||
static constexpr std::size_t MENU_BTN = 3;
|
||||
|
|
|
@ -138,7 +138,6 @@ class FFileDialog : public FDialog
|
|||
void adjustSize() override;
|
||||
|
||||
private:
|
||||
// Typedef
|
||||
struct FDirEntry
|
||||
{
|
||||
// Constructor
|
||||
|
@ -183,7 +182,7 @@ class FFileDialog : public FDialog
|
|||
uChar : 1; // padding bits
|
||||
};
|
||||
|
||||
typedef std::vector<FDirEntry> DirEntries;
|
||||
using DirEntries = std::vector<FDirEntry>;
|
||||
|
||||
// Methods
|
||||
void init();
|
||||
|
|
|
@ -88,8 +88,8 @@ class FKeyboard final
|
|||
// Constants
|
||||
static constexpr std::size_t FIFO_BUF_SIZE{512};
|
||||
|
||||
// Typedef
|
||||
typedef char keybuffer[FIFO_BUF_SIZE];
|
||||
// Using-declaration
|
||||
using keybuffer = char[FIFO_BUF_SIZE];
|
||||
|
||||
// Constructor
|
||||
FKeyboard();
|
||||
|
|
|
@ -169,9 +169,7 @@ class FListBox : public FWidget
|
|||
public:
|
||||
// Using-declaration
|
||||
using FWidget::setGeometry;
|
||||
|
||||
// Typedef
|
||||
typedef std::vector<FListBoxItem> FListBoxItems;
|
||||
using FListBoxItems = std::vector<FListBoxItem>;
|
||||
|
||||
// Constructor
|
||||
explicit FListBox (FWidget* = nullptr);
|
||||
|
@ -276,10 +274,10 @@ class FListBox : public FWidget
|
|||
void adjustSize() override;
|
||||
|
||||
private:
|
||||
// Typedefs
|
||||
typedef std::unordered_map<int, std::function<void()>> KeyMap;
|
||||
typedef std::unordered_map<int, std::function<bool()>> KeyMapResult;
|
||||
typedef std::function<void(FListBoxItem&, FDataAccess*, std::size_t)> LazyInsert;
|
||||
// Using-declaration
|
||||
using KeyMap = std::unordered_map<int, std::function<void()>>;
|
||||
using KeyMapResult = std::unordered_map<int, std::function<bool()>>;
|
||||
using LazyInsert = std::function<void(FListBoxItem&, FDataAccess*, std::size_t)>;
|
||||
|
||||
// Enumeration
|
||||
enum convert_type
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#endif
|
||||
|
||||
#include <list>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <stack>
|
||||
#include <unordered_map>
|
||||
|
@ -215,16 +216,19 @@ class FListViewIterator
|
|||
public:
|
||||
// Using-declarations
|
||||
using FObjectList = std::list<FObject*>;
|
||||
using iterator = FObjectList::iterator;
|
||||
using iterator_stack = std::stack<iterator>;
|
||||
using Iterator = FObjectList::iterator;
|
||||
using IteratorStack = std::stack<Iterator>;
|
||||
|
||||
// Constructor
|
||||
FListViewIterator () = default;
|
||||
FListViewIterator (iterator);
|
||||
FListViewIterator (Iterator);
|
||||
FListViewIterator (const FListViewIterator&) = default;
|
||||
FListViewIterator (FListViewIterator&& )
|
||||
noexcept (std::is_nothrow_move_constructible<FListViewIterator>::value)
|
||||
= default;
|
||||
FListViewIterator (FListViewIterator&& i) noexcept
|
||||
: iter_path{std::move(i.iter_path)}
|
||||
, node{i.node}
|
||||
, position{i.position}
|
||||
{ }
|
||||
|
||||
// Overloaded operators
|
||||
FListViewIterator& operator = (const FListViewIterator&) = default;
|
||||
FListViewIterator& operator = (FListViewIterator&&) noexcept = default;
|
||||
|
@ -248,12 +252,12 @@ class FListViewIterator
|
|||
|
||||
private:
|
||||
// Methods
|
||||
void nextElement (iterator&);
|
||||
void prevElement (iterator&);
|
||||
void nextElement (Iterator&);
|
||||
void prevElement (Iterator&);
|
||||
|
||||
// Data members
|
||||
iterator_stack iter_path{};
|
||||
iterator node{};
|
||||
IteratorStack iter_path{};
|
||||
Iterator node{};
|
||||
int position{0};
|
||||
};
|
||||
|
||||
|
@ -293,9 +297,7 @@ class FListView : public FWidget
|
|||
public:
|
||||
// Using-declaration
|
||||
using FWidget::setGeometry;
|
||||
|
||||
// Typedef
|
||||
typedef std::list<FListViewItem*> FListViewItems;
|
||||
using FListViewItems = std::list<FListViewItem*>;
|
||||
|
||||
// Constructor
|
||||
explicit FListView (FWidget* = nullptr);
|
||||
|
@ -401,18 +403,17 @@ class FListView : public FWidget
|
|||
void adjustSize() override;
|
||||
|
||||
private:
|
||||
// Typedefs
|
||||
typedef std::unordered_map<int, std::function<void()>> KeyMap;
|
||||
typedef std::unordered_map<int, std::function<bool()>> KeyMapResult;
|
||||
struct Header; // forward declaration
|
||||
|
||||
// Using-declaration
|
||||
using KeyMap = std::unordered_map<int, std::function<void()>>;
|
||||
using KeyMapResult = std::unordered_map<int, std::function<bool()>>;
|
||||
using HeaderItems = std::vector<Header>;
|
||||
using SortTypes = std::vector<fc::sorting_type>;
|
||||
|
||||
// Constants
|
||||
static constexpr std::size_t checkbox_space = 4;
|
||||
|
||||
// Typedef
|
||||
struct Header; // forward declaration
|
||||
typedef std::vector<Header> HeaderItems;
|
||||
typedef std::vector<fc::sorting_type> SortTypes;
|
||||
|
||||
// Constants
|
||||
static constexpr int USE_MAX_SIZE = -1;
|
||||
|
||||
|
|
|
@ -132,12 +132,7 @@ class FMenu : public FWindow, public FMenuList
|
|||
void cb_menuitemToggled (const FMenuItem*) const;
|
||||
|
||||
private:
|
||||
// Constants
|
||||
static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
|
||||
static constexpr bool SELECT_ITEM = true;
|
||||
|
||||
// Typedef
|
||||
typedef struct
|
||||
struct MouseStates
|
||||
{
|
||||
uChar focus_changed : 1;
|
||||
uChar hide_sub_menu : 1;
|
||||
|
@ -146,14 +141,18 @@ class FMenu : public FWindow, public FMenuList
|
|||
uChar mouse_over_supermenu : 1;
|
||||
uChar mouse_over_menubar : 1;
|
||||
uChar : 2; // padding bits
|
||||
} MouseStates;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
struct MenuText
|
||||
{
|
||||
FString text;
|
||||
std::size_t hotkeypos;
|
||||
bool no_underline;
|
||||
} MenuText;
|
||||
};
|
||||
|
||||
// Constants
|
||||
static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
|
||||
static constexpr bool SELECT_ITEM = true;
|
||||
|
||||
// Accessors
|
||||
FWidget* getSuperMenu() const;
|
||||
|
|
|
@ -122,8 +122,7 @@ class FMouseData
|
|||
void clearButtonState();
|
||||
|
||||
protected:
|
||||
// Typedef and Enumerations
|
||||
typedef struct
|
||||
struct FMouseButton // bit field
|
||||
{
|
||||
uChar left_button : 2; // 0..3
|
||||
uChar right_button : 2; // 0..3
|
||||
|
@ -135,8 +134,9 @@ class FMouseData
|
|||
uChar wheel_down : 1; // 0..1
|
||||
uChar mouse_moved : 1; // 0..1
|
||||
uChar : 4; // padding bits
|
||||
} FMouseButton; // bit field
|
||||
};
|
||||
|
||||
// Enumerations
|
||||
enum states
|
||||
{
|
||||
Undefined = 0,
|
||||
|
|
|
@ -159,15 +159,16 @@ class FOptiAttr final
|
|||
const char* changeAttribute (FChar&, FChar&);
|
||||
|
||||
private:
|
||||
// Typedefs and Enumerations
|
||||
typedef SGRoptimizer::AttributeBuffer AttributeBuffer;
|
||||
|
||||
typedef struct
|
||||
struct Capability
|
||||
{
|
||||
const char* cap;
|
||||
bool caused_reset;
|
||||
} Capability;
|
||||
};
|
||||
|
||||
// Using-declaration
|
||||
using AttributeBuffer = SGRoptimizer::AttributeBuffer;
|
||||
|
||||
// Enumerations
|
||||
enum init_reset_tests
|
||||
{
|
||||
no_test = 0x00,
|
||||
|
|
|
@ -57,8 +57,7 @@ namespace finalcut
|
|||
class FOptiMove final
|
||||
{
|
||||
public:
|
||||
// Typedef
|
||||
typedef struct
|
||||
struct TermEnv
|
||||
{
|
||||
const char* t_cursor_home;
|
||||
const char* t_carriage_return;
|
||||
|
@ -83,7 +82,7 @@ class FOptiMove final
|
|||
int tabstop;
|
||||
bool automatic_left_margin;
|
||||
bool eat_nl_glitch;
|
||||
} TermEnv;
|
||||
};
|
||||
|
||||
// Constructor
|
||||
explicit FOptiMove (int = 0);
|
||||
|
@ -147,16 +146,15 @@ class FOptiMove final
|
|||
const char* moveCursor (int, int, int, int);
|
||||
|
||||
private:
|
||||
// Constant
|
||||
static constexpr std::size_t BUF_SIZE{512};
|
||||
|
||||
// Typedef
|
||||
typedef struct
|
||||
struct Capability
|
||||
{
|
||||
const char* cap;
|
||||
int duration;
|
||||
int length;
|
||||
} Capability;
|
||||
};
|
||||
|
||||
// Constant
|
||||
static constexpr std::size_t BUF_SIZE{512};
|
||||
|
||||
// Constants
|
||||
static constexpr int LONG_DURATION{INT_MAX};
|
||||
|
|
|
@ -149,8 +149,8 @@ class FScrollView : public FWidget
|
|||
void copy2area();
|
||||
|
||||
private:
|
||||
// Typedefs
|
||||
typedef std::unordered_map<int, std::function<void()>> KeyMap;
|
||||
// Using-declaration
|
||||
using KeyMap = std::unordered_map<int, std::function<void()>>;
|
||||
|
||||
// Constants
|
||||
static constexpr int vertical_border_spacing = 2;
|
||||
|
|
|
@ -230,8 +230,8 @@ class FStatusBar : public FWindow
|
|||
void cb_statuskey_activated (const FStatusKey*);
|
||||
|
||||
private:
|
||||
// Typedef
|
||||
typedef std::vector<FStatusKey*> FKeyList;
|
||||
// Using-declaration
|
||||
using FKeyList = std::vector<FStatusKey*>;
|
||||
|
||||
// Methods
|
||||
void init();
|
||||
|
|
|
@ -72,7 +72,7 @@ class FStringStream : public std::wiostream
|
|||
FStringStream (FStringStream&&) noexcept;
|
||||
|
||||
// Destructor
|
||||
~FStringStream() noexcept;
|
||||
~FStringStream() noexcept override;
|
||||
|
||||
// Disable copy assignment operator (=)
|
||||
FStringStream& operator = (const FStringStream&) = delete;
|
||||
|
|
|
@ -251,7 +251,7 @@ class FTerm final
|
|||
static bool canChangeColorPalette();
|
||||
|
||||
// Mutators
|
||||
static void setFSystem (std::unique_ptr<FSystem>&&);
|
||||
static void setFSystem (std::unique_ptr<FSystem>&);
|
||||
static void setTermType (const char[]);
|
||||
static void setInsertCursor (bool);
|
||||
static void setInsertCursor();
|
||||
|
@ -391,7 +391,7 @@ inline FString FTerm::getClassName()
|
|||
{ return "FTerm"; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTerm::setFSystem (std::unique_ptr<FSystem>&& fsystem)
|
||||
inline void FTerm::setFSystem (std::unique_ptr<FSystem>& fsystem)
|
||||
{
|
||||
getFSystem().swap(fsystem);
|
||||
}
|
||||
|
|
|
@ -75,13 +75,11 @@ namespace finalcut
|
|||
class FTermcap final
|
||||
{
|
||||
public:
|
||||
// Typedef
|
||||
typedef struct
|
||||
struct TCapMap
|
||||
{
|
||||
const char* string;
|
||||
char tname[alignof(char*)];
|
||||
}
|
||||
TCapMap;
|
||||
};
|
||||
|
||||
// Using-declaration
|
||||
using fn_putc = int (*)(int);
|
||||
|
|
|
@ -53,8 +53,8 @@ namespace finalcut
|
|||
class FTermData final
|
||||
{
|
||||
public:
|
||||
// Typedefs
|
||||
typedef std::unordered_map<std::string, fc::encoding> EncodingMap;
|
||||
// Using-declaration
|
||||
using EncodingMap = std::unordered_map<std::string, fc::encoding>;
|
||||
|
||||
// Constructors
|
||||
FTermData () = default;
|
||||
|
|
|
@ -99,7 +99,7 @@ class FTermLinux final
|
|||
void setUTF8 (bool) const;
|
||||
|
||||
// Inquiries
|
||||
bool isLinuxConsole();
|
||||
bool isLinuxConsole() const;
|
||||
bool isVGAFontUsed() const;
|
||||
bool isNewFontUsed() const;
|
||||
|
||||
|
@ -140,7 +140,7 @@ class FTermLinux final
|
|||
};
|
||||
|
||||
// Accessors
|
||||
int getFramebuffer_bpp();
|
||||
int getFramebuffer_bpp() const;
|
||||
bool getScreenFont();
|
||||
bool getUnicodeMap ();
|
||||
ModifierKey& getModifierKey();
|
||||
|
@ -148,12 +148,12 @@ class FTermLinux final
|
|||
// Mutators
|
||||
int setScreenFont ( const uChar[], uInt, uInt, uInt
|
||||
, bool = false );
|
||||
int setUnicodeMap (struct unimapdesc*);
|
||||
int setUnicodeMap (struct unimapdesc*) const;
|
||||
void setLinuxCursorStyle (fc::linuxConsoleCursorStyle) const;
|
||||
|
||||
// Methods
|
||||
#if defined(ISA_SYSCTL_SUPPORT)
|
||||
uInt16 getInputStatusRegisterOne();
|
||||
uInt16 getInputStatusRegisterOne() const;
|
||||
uChar readAttributeController (uChar);
|
||||
void writeAttributeController (uChar, uChar);
|
||||
uChar getAttributeMode();
|
||||
|
@ -174,8 +174,8 @@ class FTermLinux final
|
|||
FKey ctrlAltKeyCorrection (const FKey&) const;
|
||||
FKey shiftCtrlAltKeyCorrection (const FKey&) const;
|
||||
sInt16 getFontPos (wchar_t ucs) const;
|
||||
void initSpecialCharacter();
|
||||
void characterFallback (wchar_t, std::vector<wchar_t>);
|
||||
void initSpecialCharacter() const;
|
||||
void characterFallback (wchar_t, std::vector<wchar_t>) const;
|
||||
|
||||
// Data members
|
||||
#if defined(__linux__)
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#define WSKBD_BELL_DOVOLUME 0x4 // get/set volume
|
||||
#define WSKBD_BELL_DOALL 0x7 // all of the above
|
||||
|
||||
typedef uInt32 kbd_t;
|
||||
using kbd_t = uInt32;
|
||||
|
||||
struct wskbd_bell_data
|
||||
{
|
||||
|
|
|
@ -137,8 +137,8 @@ class FTextView : public FWidget
|
|||
void adjustSize() override;
|
||||
|
||||
private:
|
||||
// Typedefs
|
||||
typedef std::unordered_map<int, std::function<void()>> KeyMap;
|
||||
// Using-declaration
|
||||
using KeyMap = std::unordered_map<int, std::function<void()>>;
|
||||
|
||||
// Accessors
|
||||
std::size_t getTextHeight() const;
|
||||
|
|
|
@ -97,7 +97,7 @@ class FVTerm
|
|||
|
||||
// Using-declarations
|
||||
using FPreprocessingHandler = void (FVTerm::*)();
|
||||
using FPreprocessingFunction = std::function<void()> ;
|
||||
using FPreprocessingFunction = std::function<void()>;
|
||||
using FPreprocessing = std::vector<FVTermPreprocessing>;
|
||||
|
||||
// Enumerations
|
||||
|
@ -253,7 +253,7 @@ class FVTerm
|
|||
void putVTerm() const;
|
||||
bool updateTerminal() const;
|
||||
virtual void addPreprocessingHandler ( const FVTerm*
|
||||
, const FPreprocessingFunction& );
|
||||
, FPreprocessingFunction&& );
|
||||
virtual void delPreprocessingHandler (const FVTerm*);
|
||||
template <typename... Args>
|
||||
int printf (const FString&, Args&&...);
|
||||
|
@ -491,7 +491,9 @@ struct FVTerm::FTermArea // define virtual terminal character properties
|
|||
struct D
|
||||
{
|
||||
void operator () (const FVTerm*) const
|
||||
{ }
|
||||
{
|
||||
// No deleting of pointer objects when exiting the std::unique_ptr
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -501,9 +503,9 @@ struct D
|
|||
struct FVTerm::FVTermPreprocessing
|
||||
{
|
||||
// Constructor
|
||||
FVTermPreprocessing (const FVTerm* i, const FPreprocessingFunction& f)
|
||||
FVTermPreprocessing (const FVTerm* i, FPreprocessingFunction&& f)
|
||||
: instance(std::unique_ptr<const FVTerm, D>(i))
|
||||
, function(f)
|
||||
, function(std::move(f))
|
||||
{ }
|
||||
|
||||
FVTermPreprocessing (const FVTermPreprocessing&) = delete;
|
||||
|
|
|
@ -136,7 +136,6 @@ class FWidget : public FVTerm, public FObject
|
|||
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 ⚑
|
||||
{
|
||||
|
@ -187,7 +186,7 @@ class FWidget : public FVTerm, public FObject
|
|||
static FWidgetList*& getWindowList();
|
||||
static FMenuBar* getMenuBar();
|
||||
static FStatusBar* getStatusBar();
|
||||
static FWidgetColorsPtr& getColorTheme();
|
||||
static auto getColorTheme() -> std::shared_ptr<FWidgetColors>&;
|
||||
virtual FWidget* getFirstFocusableWidget (FObjectList);
|
||||
virtual FWidget* getLastFocusableWidget (FObjectList);
|
||||
const FAcceleratorList& getAcceleratorList() const;
|
||||
|
@ -338,7 +337,7 @@ class FWidget : public FVTerm, public FObject
|
|||
static FWidgetList*& getAlwaysOnTopList();
|
||||
static FWidgetList*& getWidgetCloseList();
|
||||
void addPreprocessingHandler ( const FVTerm*
|
||||
, const FPreprocessingFunction& ) override;
|
||||
, FPreprocessingFunction&& ) override;
|
||||
void delPreprocessingHandler (const FVTerm*) override;
|
||||
|
||||
// Inquiry
|
||||
|
@ -443,7 +442,6 @@ class FWidget : public FVTerm, public FObject
|
|||
void drawChildren();
|
||||
static bool isDefaultTheme();
|
||||
static void initColorTheme();
|
||||
void destroyColorTheme();
|
||||
void removeQueuedEvent() const;
|
||||
void setStatusbarText (bool) const;
|
||||
|
||||
|
@ -573,9 +571,9 @@ inline FStatusBar* FWidget::getStatusBar()
|
|||
{ return statusbar; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget::FWidgetColorsPtr& FWidget::getColorTheme()
|
||||
inline auto FWidget::getColorTheme() -> std::shared_ptr<FWidgetColors>&
|
||||
{
|
||||
static auto color_theme = new FWidgetColorsPtr();
|
||||
static const auto& color_theme = make_unique<std::shared_ptr<FWidgetColors>>();
|
||||
return *color_theme;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ class SGRoptimizer final
|
|||
// Constants
|
||||
static constexpr std::size_t ATTR_BUF_SIZE{8192};
|
||||
|
||||
// Typedefs
|
||||
typedef std::array<char, ATTR_BUF_SIZE> AttributeBuffer;
|
||||
// Using-declaration
|
||||
using AttributeBuffer = std::array<char, ATTR_BUF_SIZE>;
|
||||
|
||||
// Constructors
|
||||
explicit SGRoptimizer (AttributeBuffer&);
|
||||
|
|
|
@ -623,8 +623,8 @@ void ftermfreebsdTest::freebsdConsoleTest()
|
|||
setenv ("COLUMNS", "80", 1);
|
||||
setenv ("LINES", "25", 1);
|
||||
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
|
|
@ -1559,8 +1559,8 @@ void FTermLinuxTest::classNameTest()
|
|||
//----------------------------------------------------------------------
|
||||
void FTermLinuxTest::linuxConsoleTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
@ -1681,8 +1681,8 @@ void FTermLinuxTest::linuxConsoleTest()
|
|||
//----------------------------------------------------------------------
|
||||
void FTermLinuxTest::linuxCursorStyleTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
@ -1870,8 +1870,8 @@ void FTermLinuxTest::linuxCursorStyleTest()
|
|||
//----------------------------------------------------------------------
|
||||
void FTermLinuxTest::linuxColorPaletteTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
@ -2145,8 +2145,8 @@ void FTermLinuxTest::linuxColorPaletteTest()
|
|||
//----------------------------------------------------------------------
|
||||
void FTermLinuxTest::linuxFontTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
@ -2288,8 +2288,8 @@ void FTermLinuxTest::linuxFontTest()
|
|||
//----------------------------------------------------------------------
|
||||
void FTermLinuxTest::modifierKeyTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
|
||||
const auto& fsystem = finalcut::FTerm::getFSystem();
|
||||
auto fsystest = static_cast<test::FSystemTest*>(fsystem.get());
|
||||
|
|
|
@ -345,8 +345,8 @@ void ftermopenbsdTest::classNameTest()
|
|||
//----------------------------------------------------------------------
|
||||
void ftermopenbsdTest::netbsdConsoleTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
@ -449,8 +449,8 @@ void ftermopenbsdTest::netbsdConsoleTest()
|
|||
//----------------------------------------------------------------------
|
||||
void ftermopenbsdTest::openbsdConsoleTest()
|
||||
{
|
||||
auto fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(std::move(fsys));
|
||||
std::unique_ptr<finalcut::FSystem> fsys = finalcut::make_unique<test::FSystemTest>();
|
||||
finalcut::FTerm::setFSystem(fsys);
|
||||
std::cout << "\n";
|
||||
const auto& data = finalcut::FTerm::getFTermData();
|
||||
|
||||
|
|
Loading…
Reference in New Issue