More function declared as const

This commit is contained in:
Markus Gans 2020-07-12 15:25:21 +02:00
parent 53ba96504f
commit 361f0e6a14
79 changed files with 431 additions and 418 deletions

View File

@ -207,15 +207,15 @@ class Calc final : public finalcut::FDialog
void sine (lDouble&); void sine (lDouble&);
void cosine (lDouble&); void cosine (lDouble&);
void tangent (lDouble&); void tangent (lDouble&);
bool isDataEntryKey (int); bool isDataEntryKey (int) const;
bool isOperatorKey (int); bool isOperatorKey (int) const;
lDouble& getValue(); lDouble& getValue();
void setDisplay (lDouble); void setDisplay (lDouble);
void setInfixOperator (char); void setInfixOperator (char);
void clearInfixOperator(); void clearInfixOperator();
void calcInfixOperator(); void calcInfixOperator();
void adjustSize() override; void adjustSize() override;
const wchar_t* getButtonText (const std::size_t); const wchar_t* getButtonText (const std::size_t) const;
void mapKeyFunctions(); void mapKeyFunctions();
// Data members // Data members
@ -941,7 +941,7 @@ void Calc::draw()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool Calc::isDataEntryKey (int key) bool Calc::isDataEntryKey (int key) const
{ {
// Test if key is in {'.', '0'..'9'} // Test if key is in {'.', '0'..'9'}
const int data_entry_keys[] = const int data_entry_keys[] =
@ -968,7 +968,7 @@ bool Calc::isDataEntryKey (int key)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool Calc::isOperatorKey(int key) bool Calc::isOperatorKey(int key) const
{ {
// Test if key is in {'*', '/', '+', '-', '^', '='} // Test if key is in {'*', '/', '+', '-', '^', '='}
const int operators[] = const int operators[] =
@ -1091,7 +1091,7 @@ void Calc::adjustSize()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const wchar_t* Calc::getButtonText (const std::size_t key) const wchar_t* Calc::getButtonText (const std::size_t key) const
{ {
static const wchar_t* const button_text[Calc::NUM_OF_BUTTONS] = static const wchar_t* const button_text[Calc::NUM_OF_BUTTONS] =
{ {

View File

@ -58,7 +58,7 @@ class EventDialog final : public finalcut::FDialog
private: private:
// Methods // Methods
finalcut::FString getMouseButtonName (int); finalcut::FString getMouseButtonName (int) const;
void logMouseEvent ( const finalcut::FString& void logMouseEvent ( const finalcut::FString&
, const finalcut::FMouseEvent& ); , const finalcut::FMouseEvent& );
@ -103,7 +103,7 @@ EventDialog::~EventDialog() // destructor
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
finalcut::FString EventDialog::getMouseButtonName (int btn_state) finalcut::FString EventDialog::getMouseButtonName (int btn_state) const
{ {
switch ( btn_state ) switch ( btn_state )
{ {

View File

@ -49,8 +49,8 @@ class ColorChooser final : public finalcut::FWidget
ColorChooser& operator = (const ColorChooser&) = delete; ColorChooser& operator = (const ColorChooser&) = delete;
// Accessors // Accessors
FColor getForeground(); FColor getForeground() const;
FColor getBackground(); FColor getBackground() const;
private: private:
// Mutator // Mutator
@ -90,13 +90,13 @@ ColorChooser::~ColorChooser()
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FColor ColorChooser::getForeground() inline FColor ColorChooser::getForeground() const
{ {
return fg_color; return fg_color;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FColor ColorChooser::getBackground() inline FColor ColorChooser::getBackground() const
{ {
return bg_color; return bg_color;
} }
@ -192,7 +192,7 @@ class Brushes final : public finalcut::FWidget
Brushes& operator = (const Brushes&) = delete; Brushes& operator = (const Brushes&) = delete;
// Accessor // Accessor
wchar_t getBrush(); wchar_t getBrush() const;
// Mutators // Mutators
void setForeground (FColor); void setForeground (FColor);
@ -293,7 +293,7 @@ void Brushes::onMouseDown (finalcut::FMouseEvent* ev)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline wchar_t Brushes::getBrush() inline wchar_t Brushes::getBrush() const
{ {
return brush; return brush;
} }

View File

@ -52,7 +52,7 @@ class RotoZoomer final : public finalcut::FDialog
~RotoZoomer() override; ~RotoZoomer() override;
// Accessors // Accessors
finalcut::FString getReport(); finalcut::FString getReport() const;
// Event handlers // Event handlers
void onShow (finalcut::FShowEvent*) override; void onShow (finalcut::FShowEvent*) override;
@ -202,7 +202,7 @@ void RotoZoomer::generateReport()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline finalcut::FString RotoZoomer::getReport() inline finalcut::FString RotoZoomer::getReport() const
{ {
return report; return report;
} }

View File

@ -50,7 +50,7 @@ class AttribDlg final : public finalcut::FDialog
AttribDlg& operator = (const AttribDlg&) = delete; AttribDlg& operator = (const AttribDlg&) = delete;
// Methods // Methods
FColor getBGColor(); FColor getBGColor() const;
// Event handlers // Event handlers
void onKeyPress (finalcut::FKeyEvent*) override; void onKeyPress (finalcut::FKeyEvent*) override;
@ -105,7 +105,7 @@ AttribDlg::~AttribDlg()
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FColor AttribDlg::getBGColor() FColor AttribDlg::getBGColor() const
{ {
return bgcolor; return bgcolor;
} }

View File

@ -301,14 +301,14 @@ class MyDialog final : public finalcut::FDialog
void cb_copyClipboard (const finalcut::FWidget*, const FDataPtr); void cb_copyClipboard (const finalcut::FWidget*, const FDataPtr);
void cb_pasteClipboard (const finalcut::FWidget*, const FDataPtr); void cb_pasteClipboard (const finalcut::FWidget*, const FDataPtr);
void cb_clearInput (const finalcut::FWidget*, const FDataPtr); void cb_clearInput (const finalcut::FWidget*, const FDataPtr);
void cb_switchTheme (const finalcut::FWidget*, const FDataPtr); void cb_switchTheme (const finalcut::FWidget*, const FDataPtr) const;
void cb_input2buttonText (finalcut::FWidget*, FDataPtr); void cb_input2buttonText (finalcut::FWidget*, FDataPtr) const;
void cb_setTitlebar (finalcut::FWidget*, const FDataPtr); void cb_setTitlebar (finalcut::FWidget*, const FDataPtr);
void cb_showProgressBar (const finalcut::FWidget*, const FDataPtr); void cb_showProgressBar (const finalcut::FWidget*, const FDataPtr);
void cb_updateNumber (finalcut::FWidget*, FDataPtr); void cb_updateNumber (finalcut::FWidget*, FDataPtr) const;
void cb_activateButton (finalcut::FWidget*, FDataPtr); void cb_activateButton (finalcut::FWidget*, FDataPtr) const;
void cb_view (const finalcut::FWidget*, FDataPtr); void cb_view (const finalcut::FWidget*, FDataPtr);
void cb_setInput (finalcut::FWidget*, FDataPtr); void cb_setInput (finalcut::FWidget*, FDataPtr) const;
// Data members // Data members
bool initialized{false}; bool initialized{false};
@ -916,7 +916,7 @@ void MyDialog::cb_clearInput (const finalcut::FWidget*, const FDataPtr)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_switchTheme (const finalcut::FWidget* widget, const FDataPtr) void MyDialog::cb_switchTheme (const finalcut::FWidget* widget, const FDataPtr) const
{ {
const auto& check_menu = *(static_cast<const finalcut::FCheckMenuItem*>(widget)); const auto& check_menu = *(static_cast<const finalcut::FCheckMenuItem*>(widget));
@ -931,7 +931,7 @@ void MyDialog::cb_switchTheme (const finalcut::FWidget* widget, const FDataPtr)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) const
{ {
auto& button = *(static_cast<finalcut::FButton*>(widget)); auto& button = *(static_cast<finalcut::FButton*>(widget));
const auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data)); const auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data));
@ -958,7 +958,7 @@ void MyDialog::cb_showProgressBar (const finalcut::FWidget*, const FDataPtr)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data) void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data) const
{ {
const auto& list = *(static_cast<finalcut::FListBox*>(widget)); const auto& list = *(static_cast<finalcut::FListBox*>(widget));
auto& num = *(static_cast<finalcut::FLabel*>(data)); auto& num = *(static_cast<finalcut::FLabel*>(data));
@ -975,7 +975,7 @@ void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_activateButton (finalcut::FWidget* widget, FDataPtr data) void MyDialog::cb_activateButton (finalcut::FWidget* widget, FDataPtr data) const
{ {
const auto& rb = *(static_cast<finalcut::FRadioButton*>(widget)); const auto& rb = *(static_cast<finalcut::FRadioButton*>(widget));
auto& button = *(static_cast<finalcut::FButton*>(data)); auto& button = *(static_cast<finalcut::FButton*>(data));
@ -1026,7 +1026,7 @@ void MyDialog::cb_view (const finalcut::FWidget*, FDataPtr data)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) const
{ {
auto& ListBox = *(static_cast<finalcut::FListBox*>(widget)); auto& ListBox = *(static_cast<finalcut::FListBox*>(widget));
auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data)); auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data));

View File

@ -216,7 +216,7 @@ class Window final : public finalcut::FDialog
void cb_closeWindows (const finalcut::FWidget*, const FDataPtr); void cb_closeWindows (const finalcut::FWidget*, const FDataPtr);
void cb_next (const finalcut::FWidget*, const FDataPtr); void cb_next (const finalcut::FWidget*, const FDataPtr);
void cb_previous (const finalcut::FWidget*, const FDataPtr); void cb_previous (const finalcut::FWidget*, const FDataPtr);
void cb_destroyWindow (const finalcut::FWidget*, FDataPtr); void cb_destroyWindow (const finalcut::FWidget*, FDataPtr) const;
// Data members // Data members
std::vector<win_data*> windows{}; std::vector<win_data*> windows{};
@ -542,7 +542,7 @@ void Window::cb_previous (const finalcut::FWidget*, const FDataPtr)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Window::cb_destroyWindow (const finalcut::FWidget*, FDataPtr data) void Window::cb_destroyWindow (const finalcut::FWidget*, FDataPtr data) const
{ {
auto win_dat = static_cast<win_data*>(data); auto win_dat = static_cast<win_data*>(data);

View File

@ -174,7 +174,7 @@ int FApplication::enterLoop() // event loop
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::exitLoop() void FApplication::exitLoop() const
{ {
app_exit_loop = true; app_exit_loop = true;
} }
@ -187,7 +187,7 @@ void FApplication::exit (int retcode)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::quit() void FApplication::quit() const
{ {
FApplication::exit(0); FApplication::exit(0);
} }
@ -231,7 +231,7 @@ void FApplication::sendQueuedEvents()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FApplication::eventInQueue() bool FApplication::eventInQueue() const
{ {
if ( app_object ) if ( app_object )
return ( ! event_queue.empty() ); return ( ! event_queue.empty() );
@ -571,7 +571,7 @@ inline void FApplication::destroyLog()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FApplication::findKeyboardWidget() inline void FApplication::findKeyboardWidget() const
{ {
// Find the widget that has the keyboard focus // Find the widget that has the keyboard focus
@ -675,7 +675,7 @@ inline void FApplication::performKeyboardAction()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FApplication::sendEscapeKeyPressEvent() inline void FApplication::sendEscapeKeyPressEvent() const
{ {
// Send an escape key press event // Send an escape key press event
FKeyEvent k_press_ev (fc::KeyPress_Event, fc::Fkey_escape); FKeyEvent k_press_ev (fc::KeyPress_Event, fc::Fkey_escape);
@ -683,7 +683,7 @@ inline void FApplication::sendEscapeKeyPressEvent()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FApplication::sendKeyDownEvent (FWidget* widget) inline bool FApplication::sendKeyDownEvent (FWidget* widget) const
{ {
// Send key down event // Send key down event
FKeyEvent k_down_ev (fc::KeyDown_Event, keyboard->getKey()); FKeyEvent k_down_ev (fc::KeyDown_Event, keyboard->getKey());
@ -692,7 +692,7 @@ inline bool FApplication::sendKeyDownEvent (FWidget* widget)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FApplication::sendKeyPressEvent (FWidget* widget) inline bool FApplication::sendKeyPressEvent (FWidget* widget) const
{ {
// Send key press event // Send key press event
FKeyEvent k_press_ev (fc::KeyPress_Event, keyboard->getKey()); FKeyEvent k_press_ev (fc::KeyPress_Event, keyboard->getKey());
@ -701,7 +701,7 @@ inline bool FApplication::sendKeyPressEvent (FWidget* widget)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FApplication::sendKeyUpEvent (FWidget* widget) inline bool FApplication::sendKeyUpEvent (FWidget* widget) const
{ {
// Send key up event // Send key up event
FKeyEvent k_up_ev (fc::KeyUp_Event, keyboard->getKey()); FKeyEvent k_up_ev (fc::KeyUp_Event, keyboard->getKey());
@ -753,7 +753,7 @@ void FApplication::processKeyboardEvent()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FApplication::processDialogSwitchAccelerator() bool FApplication::processDialogSwitchAccelerator() const
{ {
if ( keyboard->getKey() >= fc::Fmkey_1 if ( keyboard->getKey() >= fc::Fmkey_1
&& keyboard->getKey() <= fc::Fmkey_9 ) && keyboard->getKey() <= fc::Fmkey_9 )
@ -784,7 +784,7 @@ bool FApplication::processDialogSwitchAccelerator()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FApplication::processAccelerator (const FWidget* const& widget) bool FApplication::processAccelerator (const FWidget* const& widget) const
{ {
bool accpt{false}; bool accpt{false};
@ -822,7 +822,7 @@ bool FApplication::processAccelerator (const FWidget* const& widget)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FApplication::getMouseEvent() bool FApplication::getMouseEvent() const
{ {
bool mouse_event_occurred{false}; bool mouse_event_occurred{false};
@ -870,7 +870,7 @@ FWidget*& FApplication::determineClickedWidget()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::unsetMoveSizeMode() void FApplication::unsetMoveSizeMode() const
{ {
// Unset the move/size mode // Unset the move/size mode
@ -972,7 +972,7 @@ void FApplication::sendMouseEvent()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::sendMouseMoveEvent ( const FPoint& widgetMousePos void FApplication::sendMouseMoveEvent ( const FPoint& widgetMousePos
, const FPoint& mouse_position , const FPoint& mouse_position
, int key_state ) , int key_state ) const
{ {
if ( ! mouse ) if ( ! mouse )
return; return;
@ -1010,7 +1010,7 @@ void FApplication::sendMouseMoveEvent ( const FPoint& widgetMousePos
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos
, const FPoint& mouse_position , const FPoint& mouse_position
, int key_state ) , int key_state ) const
{ {
if ( ! mouse ) if ( ! mouse )
return; return;
@ -1052,7 +1052,7 @@ void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos
, const FPoint& mouse_position , const FPoint& mouse_position
, int key_state ) , int key_state ) const
{ {
if ( ! mouse ) if ( ! mouse )
return; return;
@ -1086,7 +1086,7 @@ void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos
, const FPoint& mouse_position , const FPoint& mouse_position
, int key_state ) , int key_state ) const
{ {
if ( ! mouse ) if ( ! mouse )
return; return;
@ -1125,7 +1125,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::sendWheelEvent ( const FPoint& widgetMousePos void FApplication::sendWheelEvent ( const FPoint& widgetMousePos
, const FPoint& mouse_position ) , const FPoint& mouse_position ) const
{ {
if ( ! mouse ) if ( ! mouse )
return; return;
@ -1226,7 +1226,7 @@ void FApplication::processCloseWidget()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::processLogger() void FApplication::processLogger() const
{ {
// Synchronizing the stream buffer with the logging output // Synchronizing the stream buffer with the logging output

View File

@ -670,7 +670,7 @@ void FButton::draw()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FButton::updateStatusBar() void FButton::updateStatusBar() const
{ {
if ( ! getFlags().focus || ! getStatusBar() ) if ( ! getFlags().focus || ! getStatusBar() )
return; return;

View File

@ -542,7 +542,7 @@ void FButtonGroup::directFocus()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FButtonGroup::cb_buttonToggled (FWidget* widget, const FDataPtr) void FButtonGroup::cb_buttonToggled (FWidget* widget, const FDataPtr) const
{ {
const auto& button = static_cast<FToggleButton*>(widget); const auto& button = static_cast<FToggleButton*>(widget);

View File

@ -42,7 +42,7 @@ FColorPalette::~FColorPalette() // destructor
// protected methods of FColorPalette // protected methods of FColorPalette
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FColorPalette::setPalette (FColor index, int r, int g, int b) void FColorPalette::setPalette (FColor index, int r, int g, int b) const
{ {
set_palette (index, r, g, b); set_palette (index, r, g, b);
} }

View File

@ -1270,7 +1270,7 @@ void FDialog::setZoomItem()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FDialog::getZoomButtonWidth() inline std::size_t FDialog::getZoomButtonWidth() const
{ {
if ( ! isResizeable() ) if ( ! isResizeable() )
return 0; return 0;

View File

@ -415,8 +415,8 @@ void FFileDialog::initCallbacks()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FFileDialog::pattern_match ( const char* const pattern inline bool FFileDialog::patternMatch ( const char* const pattern
, const char fname[] ) , const char fname[] ) const
{ {
char search[128]{}; char search[128]{};
@ -583,14 +583,14 @@ void FFileDialog::getEntry (const char* const dir, const struct dirent* d_entry)
if ( entry.directory ) if ( entry.directory )
dir_entries.push_back (entry); dir_entries.push_back (entry);
else if ( pattern_match(filter, entry.name.c_str()) ) else if ( patternMatch(filter, entry.name.c_str()) )
dir_entries.push_back (entry); dir_entries.push_back (entry);
else else
entry.name.clear(); entry.name.clear();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FFileDialog::followSymLink (const char* const dir, FDirEntry& entry) void FFileDialog::followSymLink (const char* const dir, FDirEntry& entry) const
{ {
if ( ! entry.symbolic_link ) if ( ! entry.symbolic_link )
return; // No symbolic link return; // No symbolic link

View File

@ -82,7 +82,7 @@ void FKeyboard::fetchKeyCode()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FKeyboard::getKeyName (const FKey keynum) const FString FKeyboard::getKeyName (const FKey keynum) const
{ {
for (std::size_t i{0}; fc::fkeyname[i].string[0] != 0; i++) for (std::size_t i{0}; fc::fkeyname[i].string[0] != 0; i++)
if ( fc::fkeyname[i].num && fc::fkeyname[i].num == keynum ) if ( fc::fkeyname[i].num && fc::fkeyname[i].num == keynum )
@ -179,7 +179,7 @@ void FKeyboard::escapeKeyHandling()
// private methods of FKeyboard // private methods of FKeyboard
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FKey FKeyboard::getMouseProtocolKey() inline FKey FKeyboard::getMouseProtocolKey() const
{ {
// Looking for mouse string in the key buffer // Looking for mouse string in the key buffer
@ -357,7 +357,7 @@ bool FKeyboard::isKeypressTimeout()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FKeyboard::UTF8decode (const char utf8[]) FKey FKeyboard::UTF8decode (const char utf8[]) const
{ {
FKey ucs{0}; // Universal coded character FKey ucs{0}; // Universal coded character
constexpr std::size_t max = 4; constexpr std::size_t max = 4;
@ -488,7 +488,7 @@ FKey FKeyboard::parseKeyString()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FKeyboard::keyCorrection (const FKey& keycode) FKey FKeyboard::keyCorrection (const FKey& keycode) const
{ {
FKey key_correction; FKey key_correction;

View File

@ -83,7 +83,7 @@ FLabel& FLabel::operator << (const wchar_t c)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FLabel& FLabel::operator >> (FString& s) const FLabel& FLabel::operator >> (FString& s) const
{ {
s += text; s += text;
return *this; return *this;
@ -266,7 +266,7 @@ void FLabel::setHotkeyAccelerator()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::size_t FLabel::getAlignOffset (const std::size_t length) std::size_t FLabel::getAlignOffset (const std::size_t length) const
{ {
const std::size_t width(getWidth()); const std::size_t width(getWidth());
assert ( alignment == fc::alignLeft assert ( alignment == fc::alignLeft

View File

@ -88,7 +88,7 @@ FLineEdit& FLineEdit::operator << (const wchar_t c)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FLineEdit& FLineEdit::operator >> (FString& s) const FLineEdit& FLineEdit::operator >> (FString& s) const
{ {
s += text; s += text;
return *this; return *this;
@ -661,7 +661,7 @@ void FLineEdit::init()
bool FLineEdit::hasHotkey() const bool FLineEdit::hasHotkey() const
{ {
if ( label_text.isEmpty() ) if ( label_text.isEmpty() )
return 0; return false;
return label_text.includes('&'); return label_text.includes('&');
} }
@ -787,7 +787,7 @@ inline std::size_t FLineEdit::printPassword()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FLineEdit::getCursorColumnPos() inline std::size_t FLineEdit::getCursorColumnPos() const
{ {
if ( input_type == FLineEdit::textfield ) if ( input_type == FLineEdit::textfield )
{ {
@ -1104,7 +1104,7 @@ inline bool FLineEdit::keyInput (FKey key)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline wchar_t FLineEdit::characterFilter (const wchar_t c) inline wchar_t FLineEdit::characterFilter (const wchar_t c) const
{ {
if ( input_filter.empty() ) if ( input_filter.empty() )
return c; return c;

View File

@ -766,7 +766,7 @@ void FListBox::drawBorder()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListBox::drawScrollbars() void FListBox::drawScrollbars() const
{ {
if ( ! hbar->isShown() && isHorizontallyScrollable() ) if ( ! hbar->isShown() && isHorizontallyScrollable() )
hbar->show(); hbar->show();
@ -1061,7 +1061,7 @@ inline void FListBox::setLineAttributes ( int y
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListBox::unsetAttributes() inline void FListBox::unsetAttributes() const
{ {
if ( FTerm::isMonochron() ) // unset for the last element if ( FTerm::isMonochron() ) // unset for the last element
setReverse(false); setReverse(false);
@ -1120,7 +1120,7 @@ void FListBox::recalculateHorizontalBar (std::size_t len, bool has_brackets)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListBox::recalculateVerticalBar (std::size_t element_count) void FListBox::recalculateVerticalBar (std::size_t element_count) const
{ {
const int vmax = ( element_count + 2 > getHeight() ) const int vmax = ( element_count + 2 > getHeight() )
? int(element_count - getHeight() + 2) ? int(element_count - getHeight() + 2)
@ -1714,7 +1714,7 @@ void FListBox::processChanged()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListBox::changeOnResize() void FListBox::changeOnResize() const
{ {
if ( FTerm::isNewFont() ) if ( FTerm::isNewFont() )
{ {

View File

@ -310,7 +310,7 @@ FObject::iterator FListViewItem::insert (FListViewItem* child)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FObject::iterator FListViewItem::insert ( FListViewItem* child FObject::iterator FListViewItem::insert ( FListViewItem* child
, iterator parent_iter ) , iterator parent_iter ) const
{ {
if ( parent_iter == FListView::getNullIterator() ) if ( parent_iter == FListView::getNullIterator() )
return FListView::getNullIterator(); return FListView::getNullIterator();
@ -335,7 +335,7 @@ FObject::iterator FListViewItem::insert ( FListViewItem* child
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListViewItem::remove (FListViewItem* item) void FListViewItem::remove (FListViewItem* item) const
{ {
if ( item == nullptr || item == *FListView::getNullIterator() ) if ( item == nullptr || item == *FListView::getNullIterator() )
return; return;
@ -696,7 +696,7 @@ FListView::~FListView() // destructor
// public methods of FListView // public methods of FListView
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::size_t FListView::getCount() std::size_t FListView::getCount() const
{ {
int n{0}; int n{0};
@ -1585,7 +1585,7 @@ void FListView::sort (Compare cmp)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::size_t FListView::getAlignOffset ( const fc::text_alignment align std::size_t FListView::getAlignOffset ( const fc::text_alignment align
, const std::size_t column_width , const std::size_t column_width
, const std::size_t width ) , const std::size_t width ) const
{ {
assert ( align == fc::alignLeft assert ( align == fc::alignLeft
|| align == fc::alignCenter || align == fc::alignCenter
@ -1892,7 +1892,7 @@ void FListView::clearList()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListView::setLineAttributes ( bool is_current inline void FListView::setLineAttributes ( bool is_current
, bool is_focus ) , bool is_focus ) const
{ {
const auto& wc = getColorTheme(); const auto& wc = getColorTheme();
setColor (wc->list_fg, wc->list_bg); setColor (wc->list_fg, wc->list_bg);
@ -1927,7 +1927,7 @@ inline void FListView::setLineAttributes ( bool is_current
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FString FListView::getCheckBox (const FListViewItem* item) inline FString FListView::getCheckBox (const FListViewItem* item) const
{ {
FString checkbox{""}; FString checkbox{""};
@ -2511,7 +2511,7 @@ void FListView::processChanged()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListView::changeOnResize() void FListView::changeOnResize() const
{ {
if ( FTerm::isNewFont() ) if ( FTerm::isNewFont() )
{ {

View File

@ -42,7 +42,7 @@ FLogger::~FLogger() // destructor
// private methods of FLogger // private methods of FLogger
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FLogger::newlineReplace ( std::string& str void FLogger::newlineReplace ( std::string& str
, const std::string& replace_str ) , const std::string& replace_str ) const
{ {
std::size_t pos{0}; std::size_t pos{0};
std::size_t npos{std::string::npos}; std::size_t npos{std::string::npos};
@ -56,7 +56,7 @@ void FLogger::newlineReplace ( std::string& str
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const std::string FLogger::getTimeString() const std::string FLogger::getTimeString() const
{ {
char str[100]; char str[100];
const auto& now = std::chrono::system_clock::now(); const auto& now = std::chrono::system_clock::now();

View File

@ -339,7 +339,7 @@ void FMenu::cb_menuitemDisabled (const FWidget*, const FDataPtr)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr) void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr) const
{ {
const auto& m_item = static_cast<FMenuItem*>(widget); const auto& m_item = static_cast<FMenuItem*>(widget);
@ -444,7 +444,7 @@ bool FMenu::isMouseOverSuperMenu (const FPoint& termpos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FMenu::isMouseOverMenuBar (const FPoint& termpos) bool FMenu::isMouseOverMenuBar (const FPoint& termpos) const
{ {
if ( getMenuBar() if ( getMenuBar()
&& isMenuBar(getMenuBar()) && isMenuBar(getMenuBar())
@ -563,7 +563,7 @@ void FMenu::calculateDimensions()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenu::adjustItems() void FMenu::adjustItems() const
{ {
for (auto&& item : getItemList()) for (auto&& item : getItemList())
{ {
@ -980,7 +980,7 @@ void FMenu::passEventToSuperMenu (FMouseEvent* const& ev)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenu::passEventToMenuBar (FMouseEvent* const& ev) void FMenu::passEventToMenuBar (FMouseEvent* const& ev) const
{ {
// Mouse event handover to the menu bar // Mouse event handover to the menu bar
@ -1145,7 +1145,7 @@ bool FMenu::selectPrevItem()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenu::keypressMenuBar (FKeyEvent* ev) void FMenu::keypressMenuBar (FKeyEvent* ev) const
{ {
auto mbar = getMenuBar(); auto mbar = getMenuBar();
@ -1491,7 +1491,7 @@ inline void FMenu::setLineAttributes (const FMenuItem* m_item, int y)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FMenu::setCursorToHotkeyPosition (FMenuItem* m_item) inline void FMenu::setCursorToHotkeyPosition (FMenuItem* m_item) const
{ {
const bool is_checkable = m_item->checkable; const bool is_checkable = m_item->checkable;
const bool is_selected = m_item->isSelected(); const bool is_selected = m_item->isSelected();

View File

@ -228,7 +228,7 @@ void FMenuBar::onAccel (FAccelEvent* ev)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenuBar::cb_itemDeactivated (FWidget* widget, const FDataPtr) void FMenuBar::cb_itemDeactivated (FWidget* widget, const FDataPtr) const
{ {
auto menuitem = static_cast<FMenuItem*>(widget); auto menuitem = static_cast<FMenuItem*>(widget);
@ -263,7 +263,7 @@ void FMenuBar::init()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenuBar::calculateDimensions() void FMenuBar::calculateDimensions() const
{ {
FPoint item_pos{1, 1}; FPoint item_pos{1, 1};
@ -577,7 +577,7 @@ inline void FMenuBar::setLineAttributes (const FMenuItem* menuitem)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FMenuBar::setCursorToHotkeyPosition ( FMenuItem* menuitem inline void FMenuBar::setCursorToHotkeyPosition ( FMenuItem* menuitem
, std::size_t hotkeypos ) , std::size_t hotkeypos ) const
{ {
if ( ! menuitem->isSelected() ) if ( ! menuitem->isSelected() )
return; return;
@ -675,7 +675,7 @@ inline void FMenuBar::drawTrailingSpace (std::size_t& x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenuBar::adjustItems() void FMenuBar::adjustItems() const
{ {
int item_X = 1; int item_X = 1;
int item_Y = 1; int item_Y = 1;
@ -928,7 +928,7 @@ void FMenuBar::mouseMoveOverList (const FMouseEvent* ev)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenuBar::passEventToMenu (const FMouseEvent* const& ev) void FMenuBar::passEventToMenu (const FMouseEvent* const& ev) const
{ {
if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() ) if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() )
return; return;

View File

@ -591,7 +591,7 @@ void FMenuItem::processDeactivate()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenuItem::createDialogList (FMenu* winmenu) void FMenuItem::createDialogList (FMenu* winmenu) const
{ {
winmenu->clear(); winmenu->clear();
@ -651,7 +651,7 @@ void FMenuItem::createDialogList (FMenu* winmenu)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template <typename T> template <typename T>
void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev
, fc::events ev_type ) , fc::events ev_type ) const
{ {
if ( ! widget ) if ( ! widget )
return; return;
@ -695,7 +695,7 @@ void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMenuItem::cb_switchToDialog (const FWidget*, FDataPtr data) void FMenuItem::cb_switchToDialog (const FWidget*, FDataPtr data) const
{ {
auto win = static_cast<FDialog*>(data); auto win = static_cast<FDialog*>(data);

View File

@ -384,7 +384,7 @@ void FMessageBox::draw()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMessageBox::resizeButtons() void FMessageBox::resizeButtons() const
{ {
std::size_t len[3]{}; std::size_t len[3]{};
std::size_t max_size{}; std::size_t max_size{};

View File

@ -59,7 +59,7 @@ const FString FMouse::getClassName() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint& FMouse::getPos() inline const FPoint& FMouse::getPos() const
{ {
return mouse; return mouse;
} }
@ -89,7 +89,7 @@ inline void FMouse::setDblclickInterval (const uInt64 timeout)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FMouse::hasEvent() inline bool FMouse::hasEvent() const
{ {
return mouse_event_occurred; return mouse_event_occurred;
} }
@ -172,7 +172,7 @@ inline bool FMouse::isMoved()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FMouse::isInputDataPending() inline bool FMouse::isInputDataPending() const
{ {
return input_data_pending; return input_data_pending;
} }
@ -193,25 +193,25 @@ inline FMouse::FMouseButton& FMouse::getButtonState()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint& FMouse::getNewPos() inline const FPoint& FMouse::getNewPos() const
{ {
return new_mouse_position; return new_mouse_position;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uInt16 FMouse::getMaxWidth() uInt16 FMouse::getMaxWidth() const
{ {
return max_width; return max_width;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uInt16 FMouse::getMaxHeight() uInt16 FMouse::getMaxHeight() const
{ {
return max_height; return max_height;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uInt64 FMouse::getDblclickInterval() uInt64 FMouse::getDblclickInterval() const
{ {
return dblclick_interval; return dblclick_interval;
} }
@ -260,7 +260,7 @@ void FMouse::setEvent()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FMouse::isDblclickTimeout (const timeval* time) bool FMouse::isDblclickTimeout (const timeval* time) const
{ {
return FObject::isTimeout (time, dblclick_interval); return FObject::isTimeout (time, dblclick_interval);
} }
@ -397,7 +397,7 @@ bool FMouseGPM::gpmMouse (bool enable)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FMouseGPM::hasSignificantEvents() bool FMouseGPM::hasSignificantEvents() const
{ {
return ! (gpm_ev.type & GPM_MOVE) return ! (gpm_ev.type & GPM_MOVE)
|| gpm_ev.wdy != 0 || gpm_ev.wdy != 0
@ -483,7 +483,7 @@ void FMouseGPM::drawGpmPointer()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FMouseGPM::gpmEvent (bool clear) int FMouseGPM::gpmEvent (bool clear) const
{ {
const int max = ( gpm_fd > stdin_no ) ? gpm_fd : stdin_no; const int max = ( gpm_fd > stdin_no ) ? gpm_fd : stdin_no;
fd_set ifds{}; fd_set ifds{};
@ -1598,7 +1598,7 @@ FMouse* FMouseControl::getMouseWithEvent()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMouseControl::xtermMouse (bool enable) void FMouseControl::xtermMouse (bool enable) const
{ {
// activate/deactivate the xterm mouse support // activate/deactivate the xterm mouse support

View File

@ -307,7 +307,7 @@ int FObject::addTimer (int interval)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FObject::delTimer (int id) bool FObject::delTimer (int id) const
{ {
// Deletes a timer by using the timer identifier number // Deletes a timer by using the timer identifier number
@ -333,7 +333,7 @@ bool FObject::delTimer (int id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FObject::delOwnTimer() bool FObject::delOwnTimer() const
{ {
// Deletes all timers of this object // Deletes all timers of this object
@ -359,7 +359,7 @@ bool FObject::delOwnTimer()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FObject::delAllTimer() bool FObject::delAllTimer() const
{ {
// Deletes all timers of all objects // Deletes all timers of all objects

View File

@ -1239,7 +1239,7 @@ inline bool FOptiAttr::hasColorChanged ( const FChar* const& term
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FOptiAttr::resetColor (FChar*& attr) inline void FOptiAttr::resetColor (FChar*& attr) const
{ {
if ( attr ) if ( attr )
{ {
@ -1535,7 +1535,7 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FOptiAttr::resetAttribute (FChar*& attr) inline void FOptiAttr::resetAttribute (FChar*& attr) const
{ {
if ( attr ) if ( attr )
{ {
@ -1555,7 +1555,7 @@ inline void FOptiAttr::reset (FChar*& attr)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FOptiAttr::caused_reset_attributes (const char cap[], uChar test) bool FOptiAttr::caused_reset_attributes (const char cap[], uChar test) const
{ {
// test if "cap" reset all attributes // test if "cap" reset all attributes
@ -1648,14 +1648,14 @@ inline void FOptiAttr::detectSwitchOff (const FChar* const& term, const FChar* c
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FOptiAttr::switchOn() inline bool FOptiAttr::switchOn() const
{ {
auto on_ptr = &on; auto on_ptr = &on;
return hasAttribute(on_ptr); return hasAttribute(on_ptr);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FOptiAttr::switchOff() inline bool FOptiAttr::switchOff() const
{ {
auto off_ptr = &off; auto off_ptr = &off;
return hasAttribute(off_ptr); return hasAttribute(off_ptr);

View File

@ -463,7 +463,7 @@ void FOptiMove::set_clr_eol (const char cap[])
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::check_boundaries ( int& xold, int& yold void FOptiMove::check_boundaries ( int& xold, int& yold
, int& xnew, int& ynew ) , int& xnew, int& ynew ) const
{ {
if ( xold < 0 || xold >= int(screen_width) ) if ( xold < 0 || xold >= int(screen_width) )
xold = -1; xold = -1;
@ -549,7 +549,7 @@ void FOptiMove::calculateCharDuration()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FOptiMove::capDuration (const char cap[], int affcnt) int FOptiMove::capDuration (const char cap[], int affcnt) const
{ {
// calculate the duration in milliseconds of a given operation // calculate the duration in milliseconds of a given operation
// cap - the term capability // cap - the term capability
@ -598,7 +598,7 @@ int FOptiMove::capDuration (const char cap[], int affcnt)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FOptiMove::capDurationToLength (int duration) int FOptiMove::capDurationToLength (int duration) const
{ {
if ( duration != LONG_DURATION ) if ( duration != LONG_DURATION )
return (duration + char_duration - 1) / char_duration; return (duration + char_duration - 1) / char_duration;
@ -609,7 +609,7 @@ int FOptiMove::capDurationToLength (int duration)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FOptiMove::repeatedAppend ( const capability& o int FOptiMove::repeatedAppend ( const capability& o
, volatile int count , volatile int count
, char* dst ) , char* dst ) const
{ {
const std::size_t src_len = std::strlen(o.cap); const std::size_t src_len = std::strlen(o.cap);
const std::size_t dst_len = ( dst != nullptr ) ? std::strlen(dst) : 0; const std::size_t dst_len = ( dst != nullptr ) ? std::strlen(dst) : 0;

View File

@ -626,7 +626,7 @@ FScrollbar::sType FScrollbar::getClickedScrollType (int x, int y)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y) FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y) const
{ {
if ( y == 1 ) if ( y == 1 )
{ {
@ -649,7 +649,7 @@ FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x) FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x) const
{ {
if ( FTerm::isNewFont() ) if ( FTerm::isNewFont() )
{ {
@ -696,7 +696,7 @@ FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FScrollbar::getSliderClickPos (int mouse_x, int mouse_y) int FScrollbar::getSliderClickPos (int mouse_x, int mouse_y) const
{ {
// Get the clicked position on the slider // Get the clicked position on the slider

View File

@ -694,7 +694,7 @@ void FScrollView::copy2area()
// private methods of FScrollView // private methods of FScrollView
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint FScrollView::getViewportCursorPos() inline const FPoint FScrollView::getViewportCursorPos() const
{ {
const auto& window = FWindow::getWindowWidget(this); const auto& window = FWindow::getWindowWidget(this);
@ -773,7 +773,7 @@ inline void FScrollView::mapKeyFunctions()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollView::calculateScrollbarPos() void FScrollView::calculateScrollbarPos() const
{ {
const std::size_t width = getWidth(); const std::size_t width = getWidth();
const std::size_t height = getHeight(); const std::size_t height = getHeight();
@ -794,7 +794,7 @@ void FScrollView::calculateScrollbarPos()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollView::setHorizontalScrollBarVisibility() void FScrollView::setHorizontalScrollBarVisibility() const
{ {
assert ( v_mode == fc::Auto assert ( v_mode == fc::Auto
|| v_mode == fc::Hidden || v_mode == fc::Hidden
@ -820,7 +820,7 @@ void FScrollView::setHorizontalScrollBarVisibility()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollView::setVerticalScrollBarVisibility() void FScrollView::setVerticalScrollBarVisibility() const
{ {
assert ( v_mode == fc::Auto assert ( v_mode == fc::Auto
|| v_mode == fc::Hidden || v_mode == fc::Hidden

View File

@ -528,14 +528,14 @@ void FStatusBar::init()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FStatusBar::getKeyNameWidth (const FStatusKey* key) int FStatusBar::getKeyNameWidth (const FStatusKey* key) const
{ {
const FString& key_name = FTerm::getKeyName(key->getKey()); const FString& key_name = FTerm::getKeyName(key->getKey());
return int(getColumnWidth(key_name)); return int(getColumnWidth(key_name));
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FStatusBar::getKeyTextWidth (const FStatusKey* key) int FStatusBar::getKeyTextWidth (const FStatusKey* key) const
{ {
const FString& key_text = key->getText(); const FString& key_text = key->getText();
return int(getColumnWidth(key_text)); return int(getColumnWidth(key_text));

View File

@ -273,99 +273,104 @@ FString& FString::operator << (const char c)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (FString& s) const FString& FString::operator >> (FString& s) const
{ {
s._insert (s.length, length, string); s._insert (s.length, length, string);
_assign(s.string);
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (std::wstring& s) const FString& FString::operator >> (std::wstring& s) const
{ {
s += std::wstring(string); s += std::wstring(string);
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (std::string& s) const FString& FString::operator >> (std::string& s) const
{ {
s += toString(); s += toString();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (wchar_t& c) const FString& FString::operator >> (wchar_t& c) const
{ {
c = ( length > 0 ) ? string[0] : L'\0'; c = ( length > 0 ) ? string[0] : L'\0';
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (char& c) const FString& FString::operator >> (char& c) const
{ {
c = ( length > 0 ) ? char(string[0] & 0xff) : '\0'; c = ( length > 0 ) ? char(string[0] & 0xff) : '\0';
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (sInt16& num) const FString& FString::operator >> (sInt16& num) const
{ {
num = toShort(); num = toShort();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (uInt16& num) const FString& FString::operator >> (uInt16& num) const
{ {
num = toUShort(); num = toUShort();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (sInt32& num) const FString& FString::operator >> (sInt32& num) const
{ {
num = toInt(); num = toInt();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (uInt32& num) const FString& FString::operator >> (uInt32& num) const
{ {
num = toUInt(); num = toUInt();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (sInt64& num) const FString& FString::operator >> (sInt64& num) const
{ {
num = toLong(); num = toLong();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (uInt64& num) const FString& FString::operator >> (uInt64& num) const
{ {
num = toULong(); num = toULong();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (double& num) const FString& FString::operator >> (double& num) const
{ {
num = toDouble(); num = toDouble();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator >> (float& num) const FString& FString::operator >> (float& num) const
{ {
num = toFloat(); num = toFloat();
return *this; return *this;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator () () FString::operator bool () const
{
return bool(string);
}
//----------------------------------------------------------------------
const FString& FString::operator () () const
{ {
return *this; return *this;
} }
@ -1034,7 +1039,7 @@ const FString& FString::insert (const FString& s, std::size_t pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FString const FString::replace (const FString& from, const FString& to) FString const FString::replace (const FString& from, const FString& to) const
{ {
FString s{*this}; FString s{*this};
@ -1544,7 +1549,7 @@ inline const wchar_t* FString::_to_wcstring (const char s[]) const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const wchar_t* FString::_extractToken ( wchar_t* rest[] inline const wchar_t* FString::_extractToken ( wchar_t* rest[]
, const wchar_t s[] , const wchar_t s[]
, const wchar_t delim[] ) , const wchar_t delim[] ) const
{ {
wchar_t* token = ( s ) ? const_cast<wchar_t*>(s) : *rest; wchar_t* token = ( s ) ? const_cast<wchar_t*>(s) : *rest;

View File

@ -2190,7 +2190,7 @@ void FTerm::useNormalScreenBuffer()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FTerm::allocationValues() inline void FTerm::allocationValues() const
{ {
FStartOptions::getFStartOptions(); FStartOptions::getFStartOptions();
getFTermData(); getFTermData();
@ -2401,7 +2401,7 @@ bool FTerm::init_terminal()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::initOSspecifics() void FTerm::initOSspecifics() const
{ {
#if defined(__linux__) #if defined(__linux__)
linux->init(); // Initialize Linux console linux->init(); // Initialize Linux console
@ -2435,7 +2435,7 @@ void FTerm::initOSspecifics()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::initTermspecifics() void FTerm::initTermspecifics() const
{ {
if ( isKdeTerminal() ) if ( isKdeTerminal() )
setKDECursor(fc::UnderlineCursor); setKDECursor(fc::UnderlineCursor);
@ -2448,7 +2448,7 @@ void FTerm::initTermspecifics()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::initBaudRate() void FTerm::initBaudRate() const
{ {
const int stdout_no = FTermios::getStdOut(); const int stdout_no = FTermios::getStdOut();
const uInt baud = FTermios::getBaudRate(); const uInt baud = FTermios::getBaudRate();
@ -2529,7 +2529,7 @@ void FTerm::finish()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::finishOSspecifics() void FTerm::finishOSspecifics() const
{ {
#if defined(__linux__) #if defined(__linux__)
linux->finish(); linux->finish();
@ -2541,7 +2541,7 @@ void FTerm::finishOSspecifics()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::finish_encoding() void FTerm::finish_encoding() const
{ {
#if defined(__linux__) #if defined(__linux__)
if ( isLinuxTerm() && data->hasUTF8Console() ) if ( isLinuxTerm() && data->hasUTF8Console() )

View File

@ -92,7 +92,7 @@ int FTermBuffer::write (wchar_t ch)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermBuffer::write (const FStyle& style) void FTermBuffer::write (const FStyle& style) const
{ {
FAttribute attr = style.getStyle(); FAttribute attr = style.getStyle();
@ -129,7 +129,7 @@ void FTermBuffer::write (const FStyle& style)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermBuffer::write (const FColorPair& pair) void FTermBuffer::write (const FColorPair& pair) const
{ {
FVTerm::setColor(pair.getForegroundColor(), pair.getBackgroundColor()); FVTerm::setColor(pair.getForegroundColor(), pair.getBackgroundColor());
} }

View File

@ -63,7 +63,7 @@ FTermLinux::~FTermLinux() // destructor
// public methods of FTermLinux // public methods of FTermLinux
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#if defined(__linux__) #if defined(__linux__)
fc::linuxConsoleCursorStyle FTermLinux::getCursorStyle() fc::linuxConsoleCursorStyle FTermLinux::getCursorStyle() const
{ {
// Get the current set cursor style // Get the current set cursor style
@ -102,7 +102,7 @@ bool FTermLinux::setCursorStyle (fc::linuxConsoleCursorStyle style)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermLinux::setUTF8 (bool enable) void FTermLinux::setUTF8 (bool enable) const
{ {
if ( ! FTerm::isLinuxTerm() ) if ( ! FTerm::isLinuxTerm() )
return; return;
@ -420,7 +420,7 @@ bool FTermLinux::resetColorMap()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermLinux::setBeep (int Hz, int ms) void FTermLinux::setBeep (int Hz, int ms) const
{ {
if ( ! FTerm::isLinuxTerm() ) if ( ! FTerm::isLinuxTerm() )
return; return;
@ -440,7 +440,7 @@ void FTermLinux::setBeep (int Hz, int ms)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermLinux::resetBeep() void FTermLinux::resetBeep() const
{ {
if ( ! FTerm::isLinuxTerm() ) if ( ! FTerm::isLinuxTerm() )
return; return;
@ -763,7 +763,7 @@ int FTermLinux::setUnicodeMap (struct unimapdesc* unimap)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermLinux::setLinuxCursorStyle (CursorStyle style) void FTermLinux::setLinuxCursorStyle (CursorStyle style) const
{ {
FTerm::putstringf (CSI "?%dc", style); FTerm::putstringf (CSI "?%dc", style);
} }
@ -1008,7 +1008,7 @@ bool FTermLinux::resetVGAPalette()
#endif // defined(ISA_SYSCTL_SUPPORT) #endif // defined(ISA_SYSCTL_SUPPORT)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::shiftKeyCorrection (const FKey& key_id) FKey FTermLinux::shiftKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1048,7 +1048,7 @@ FKey FTermLinux::shiftKeyCorrection (const FKey& key_id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id) FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1088,7 +1088,7 @@ FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::altKeyCorrection (const FKey& key_id) FKey FTermLinux::altKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1128,7 +1128,7 @@ FKey FTermLinux::altKeyCorrection (const FKey& key_id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id) FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1168,7 +1168,7 @@ FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id) FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1208,7 +1208,7 @@ FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id) FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1248,7 +1248,7 @@ FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FKey FTermLinux::shiftCtrlAltKeyCorrection (const FKey& key_id) FKey FTermLinux::shiftCtrlAltKeyCorrection (const FKey& key_id) const
{ {
switch ( key_id ) switch ( key_id )
{ {
@ -1315,7 +1315,7 @@ inline void FTermLinux::initSpecialCharacter()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
sInt16 FTermLinux::getFontPos (wchar_t ucs) sInt16 FTermLinux::getFontPos (wchar_t ucs) const
{ {
constexpr sInt16 NOT_FOUND = -1; constexpr sInt16 NOT_FOUND = -1;

View File

@ -308,7 +308,7 @@ void FTermXTerminal::captureFontAndTitle()
// private methods of FTermXTerminal // private methods of FTermXTerminal
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::warnNotInitialized() void FTermXTerminal::warnNotInitialized() const
{ {
*FApplication::getLog() << FLog::Warn *FApplication::getLog() << FLog::Warn
<< "The FTermXTerminal object has " << "The FTermXTerminal object has "

View File

@ -562,13 +562,13 @@ void FTextView::adjustSize()
// private methods of FTextView // private methods of FTextView
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::size_t FTextView::getTextHeight() std::size_t FTextView::getTextHeight() const
{ {
return getHeight() - 2 + std::size_t(nf_offset); return getHeight() - 2 + std::size_t(nf_offset);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::size_t FTextView::getTextWidth() std::size_t FTextView::getTextWidth() const
{ {
return getWidth() - 2 - std::size_t(nf_offset); return getWidth() - 2 - std::size_t(nf_offset);
} }
@ -702,7 +702,7 @@ void FTextView::drawText()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FTextView::useFDialogBorder() inline bool FTextView::useFDialogBorder() const
{ {
const auto& parent = getParentWidget(); const auto& parent = getParentWidget();
bool use_fdialog_border{false}; bool use_fdialog_border{false};
@ -722,7 +722,7 @@ inline bool FTextView::useFDialogBorder()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FTextView::isPrintable (wchar_t ch) inline bool FTextView::isPrintable (wchar_t ch) const
{ {
// Check for printable characters // Check for printable characters
@ -742,7 +742,7 @@ void FTextView::processChanged()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTextView::changeOnResize() void FTextView::changeOnResize() const
{ {
const std::size_t width = getWidth(); const std::size_t width = getWidth();
const std::size_t height = getHeight(); const std::size_t height = getHeight();

View File

@ -533,7 +533,7 @@ void FToggleButton::drawText (const FString& label_text, std::size_t hotkeypos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FToggleButton::correctSize (FSize& size) void FToggleButton::correctSize (FSize& size) const
{ {
const std::size_t hotkey_mark = ( getHotkey(text) ) ? 1 : 0; const std::size_t hotkey_mark = ( getHotkey(text) ) ? 1 : 0;
const std::size_t column_width = getColumnWidth(text); const std::size_t column_width = getColumnWidth(text);

View File

@ -117,7 +117,7 @@ const FPoint FVTerm::getPrintCursor()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FVTerm::setTermXY (int x, int y) void FVTerm::setTermXY (int x, int y) const
{ {
// Sets the hardware cursor to the given (x,y) position // Sets the hardware cursor to the given (x,y) position
@ -168,7 +168,7 @@ void FVTerm::setTerminalUpdates (terminal_update refresh_state)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FVTerm::hideCursor (bool enable) void FVTerm::hideCursor (bool enable) const
{ {
// Hides or shows the input cursor on the terminal // Hides or shows the input cursor on the terminal
@ -194,7 +194,7 @@ void FVTerm::setPrintCursor (const FPoint& pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FColor FVTerm::rgb2ColorIndex (uInt8 r, uInt8 g, uInt8 b) FColor FVTerm::rgb2ColorIndex (uInt8 r, uInt8 g, uInt8 b) const
{ {
// Converts a 24-bit RGB color to a 256-color compatible approximation // Converts a 24-bit RGB color to a 256-color compatible approximation
@ -775,7 +775,7 @@ void FVTerm::resizeArea ( const FRect& box
area->has_changes = false; area->has_changes = false;
const FSize size{full_width, full_height}; const FSize size{full_width, full_height};
setTextToDefault (area, size); resetTextAreaToDefault (area, size);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1369,8 +1369,8 @@ void FVTerm::initTerminal()
// private methods of FVTerm // private methods of FVTerm
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::setTextToDefault ( const FTermArea* area inline void FVTerm::resetTextAreaToDefault ( const FTermArea* area
, const FSize& size ) , const FSize& size ) const
{ {
FChar default_char; FChar default_char;
FLineChanges unchanged; FLineChanges unchanged;
@ -1751,7 +1751,7 @@ bool FVTerm::hasChildAreaChanges (FTermArea* area) const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FVTerm::clearChildAreaChanges (const FTermArea* area) void FVTerm::clearChildAreaChanges (const FTermArea* area) const
{ {
if ( ! area ) if ( ! area )
return; return;
@ -2397,7 +2397,7 @@ void FVTerm::printRange ( uInt xmin, uInt xmax, uInt y
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::replaceNonPrintableFullwidth ( uInt x inline void FVTerm::replaceNonPrintableFullwidth ( uInt x
, FChar*& print_char ) , FChar*& print_char ) const
{ {
// Replace non-printable full-width characters that are truncated // Replace non-printable full-width characters that are truncated
// from the right or left terminal side // from the right or left terminal side
@ -2564,7 +2564,7 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y
, const FChar* const& print_char ) , const FChar* const& print_char ) const
{ {
if ( isFullWidthChar(print_char) ) // full-width character if ( isFullWidthChar(print_char) ) // full-width character
{ {
@ -2740,7 +2740,7 @@ void FVTerm::cursorWrap()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FVTerm::printWrap (FTermArea* area) bool FVTerm::printWrap (FTermArea* area) const
{ {
bool end_of_area{false}; bool end_of_area{false};
const int width = area->width; const int width = area->width;
@ -2882,7 +2882,7 @@ bool FVTerm::updateTerminalCursor()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FVTerm::isInsideTerminal (const FPoint& pos) bool FVTerm::isInsideTerminal (const FPoint& pos) const
{ {
// Check whether the coordinates are within the virtual terminal // Check whether the coordinates are within the virtual terminal
@ -2895,7 +2895,7 @@ bool FVTerm::isInsideTerminal (const FPoint& pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isTermSizeChanged() inline bool FVTerm::isTermSizeChanged() const
{ {
const auto& data = FTerm::getFTermData(); const auto& data = FTerm::getFTermData();
@ -3016,7 +3016,7 @@ inline void FVTerm::appendChar (FChar*& next_char)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::appendAttributes (FChar*& next_attr) inline void FVTerm::appendAttributes (FChar*& next_attr) const
{ {
auto term_attr = &term_attribute; auto term_attr = &term_attribute;

View File

@ -338,7 +338,7 @@ void FWidget::useParentWidgetColor()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::setColor() void FWidget::setColor() const
{ {
// Changes colors to the widget default colors // Changes colors to the widget default colors
setColor (foreground_color, background_color); setColor (foreground_color, background_color);
@ -566,7 +566,7 @@ void FWidget::setRightPadding (int right, bool adjust)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::setTermSize (const FSize& size) void FWidget::setTermSize (const FSize& size) const
{ {
// Set xterm size to width x height // Set xterm size to width x height
@ -1407,7 +1407,7 @@ void FWidget::adjustSize()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::adjustSizeGlobal() void FWidget::adjustSizeGlobal() const
{ {
if ( ! isRootWidget() ) if ( ! isRootWidget() )
{ {
@ -2013,7 +2013,7 @@ void FWidget::draw()
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::drawWindows() void FWidget::drawWindows() const
{ {
// redraw windows // redraw windows
FChar default_char{}; FChar default_char{};
@ -2111,7 +2111,7 @@ void FWidget::destroyColorTheme()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::setStatusbarText (bool enable) void FWidget::setStatusbarText (bool enable) const
{ {
if ( ! isEnabled() || ! getStatusBar() ) if ( ! isEnabled() || ! getStatusBar() )
return; return;

View File

@ -156,7 +156,7 @@ bool FWindow::activateWindow (bool enable)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWindow::unsetActiveWindow() void FWindow::unsetActiveWindow() const
{ {
// unset the active FWindow object // unset the active FWindow object
FWidget::setActiveWindow (nullptr); FWidget::setActiveWindow (nullptr);

View File

@ -125,13 +125,13 @@ class FApplication : public FWidget
// Methods // Methods
int exec(); // run int exec(); // run
int enterLoop(); int enterLoop();
void exitLoop(); void exitLoop() const;
static void exit (int = EXIT_SUCCESS); static void exit (int = EXIT_SUCCESS);
void quit(); void quit() const;
static bool sendEvent (FObject*, FEvent*); static bool sendEvent (FObject*, FEvent*);
void queueEvent (FObject*, FEvent*); void queueEvent (FObject*, FEvent*);
void sendQueuedEvents(); void sendQueuedEvents();
bool eventInQueue(); bool eventInQueue() const;
bool removeQueuedEvent (const FObject*); bool removeQueuedEvent (const FObject*);
void initTerminal() override; void initTerminal() override;
static void setDefaultTheme(); static void setDefaultTheme();
@ -157,44 +157,44 @@ class FApplication : public FWidget
static FStartOptions& getStartOptions(); static FStartOptions& getStartOptions();
static void showParameterUsage(); static void showParameterUsage();
void destroyLog(); void destroyLog();
void findKeyboardWidget(); void findKeyboardWidget() const;
bool isKeyPressed() const; bool isKeyPressed() const;
void keyPressed(); void keyPressed();
void keyReleased(); void keyReleased();
void escapeKeyPressed(); void escapeKeyPressed();
void performKeyboardAction(); void performKeyboardAction();
void sendEscapeKeyPressEvent(); void sendEscapeKeyPressEvent() const;
bool sendKeyDownEvent (FWidget*); bool sendKeyDownEvent (FWidget*) const;
bool sendKeyPressEvent (FWidget*); bool sendKeyPressEvent (FWidget*) const;
bool sendKeyUpEvent (FWidget*); bool sendKeyUpEvent (FWidget*) const;
void sendKeyboardAccelerator(); void sendKeyboardAccelerator();
void processKeyboardEvent(); void processKeyboardEvent();
bool processDialogSwitchAccelerator(); bool processDialogSwitchAccelerator() const;
bool processAccelerator (const FWidget* const&); bool processAccelerator (const FWidget* const&) const;
bool getMouseEvent(); bool getMouseEvent() const;
FWidget*& determineClickedWidget(); FWidget*& determineClickedWidget();
void unsetMoveSizeMode(); void unsetMoveSizeMode() const;
void closeDropDown(); void closeDropDown();
void unselectMenubarItems(); void unselectMenubarItems();
void sendMouseEvent(); void sendMouseEvent();
void sendMouseMoveEvent ( const FPoint& void sendMouseMoveEvent ( const FPoint&
, const FPoint& , const FPoint&
, int ); , int ) const;
void sendMouseLeftClickEvent ( const FPoint& void sendMouseLeftClickEvent ( const FPoint&
, const FPoint& , const FPoint&
, int ); , int ) const;
void sendMouseRightClickEvent ( const FPoint& void sendMouseRightClickEvent ( const FPoint&
, const FPoint& , const FPoint&
, int ); , int ) const;
void sendMouseMiddleClickEvent ( const FPoint& void sendMouseMiddleClickEvent ( const FPoint&
, const FPoint& , const FPoint&
, int ); , int ) const;
void sendWheelEvent (const FPoint&, const FPoint&); void sendWheelEvent (const FPoint&, const FPoint&) const;
static FWidget* processParameters (const int&, char*[]); static FWidget* processParameters (const int&, char*[]);
void processMouseEvent(); void processMouseEvent();
void processResizeEvent(); void processResizeEvent();
void processCloseWidget(); void processCloseWidget();
void processLogger(); void processLogger() const;
bool processNextEvent(); bool processNextEvent();
void performTimerAction (FObject*, FEvent*) override; void performTimerAction (FObject*, FEvent*) override;
static bool isEventProcessable (const FObject*, const FEvent*); static bool isEventProcessable (const FObject*, const FEvent*);

View File

@ -147,7 +147,7 @@ class FButton : public FWidget
void drawTopBottomBackground(); void drawTopBottomBackground();
void drawButtonTextLine (const FString&); void drawButtonTextLine (const FString&);
void draw() override; void draw() override;
void updateStatusBar(); void updateStatusBar() const;
void updateButtonColor(); void updateButtonColor();
void processClick(); void processClick();

View File

@ -130,7 +130,7 @@ class FButtonGroup : public FScrollView
void directFocus(); void directFocus();
// Callback method // Callback method
void cb_buttonToggled (FWidget*, const FDataPtr); void cb_buttonToggled (FWidget*, const FDataPtr) const;
// Data members // Data members
FString text{}; FString text{};

View File

@ -66,7 +66,7 @@ class FColorPalette
virtual void resetColorPalette() = 0; virtual void resetColorPalette() = 0;
protected: protected:
void setPalette (FColor, int, int, int); void setPalette (FColor, int, int, int) const;
void setVGAdefaultPalette(); void setVGAdefaultPalette();
private: private:

View File

@ -27,13 +27,10 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
namespace
{
template<typename T> template<typename T>
struct FData struct FData
{ {
FData (T v) explicit FData (T v)
: value(v) : value(v)
{ } { }
@ -48,15 +45,35 @@ struct FData
return value(args...); return value(args...);
} }
operator T () const explicit operator T () const
{ {
return value; return value;
} }
T& get()
{
return value;
}
void set (const T& v)
{
value = v;
}
FData& operator << (const T& v)
{
value = v;
return *this;
}
friend std::ostream& operator << (std::ostream &os, const FData& data)
{
os << data.value;
return os;
}
T value; T value;
}; };
} // namespace
#endif // FDATA_H #endif // FDATA_H

View File

@ -188,7 +188,7 @@ class FDialog : public FWindow
void openMenu(); void openMenu();
void selectFirstMenuItem(); void selectFirstMenuItem();
void setZoomItem(); void setZoomItem();
std::size_t getZoomButtonWidth(); std::size_t getZoomButtonWidth() const;
void activateZoomButton (const mouseStates&); void activateZoomButton (const mouseStates&);
void deactivateZoomButton(); void deactivateZoomButton();
void leaveZoomButton (const mouseStates&); void leaveZoomButton (const mouseStates&);

View File

@ -116,7 +116,7 @@ class FFileDialog : public FDialog
const FString getPath() const; const FString getPath() const;
const FString getFilter() const; const FString getFilter() const;
const FString getSelectedFile() const; const FString getSelectedFile() const;
bool getShowHiddenFiles(); bool getShowHiddenFiles() const;
// Mutators // Mutators
void setPath (const FString&); void setPath (const FString&);
@ -192,13 +192,13 @@ class FFileDialog : public FDialog
void init(); void init();
void widgetSettings (const FPoint&); void widgetSettings (const FPoint&);
void initCallbacks(); void initCallbacks();
bool pattern_match (const char* const, const char[]); bool patternMatch (const char* const, const char[]) const;
void clear(); void clear();
sInt64 numOfDirs(); sInt64 numOfDirs();
void sortDir(); void sortDir();
int readDir(); int readDir();
void getEntry (const char* const, const struct dirent*); void getEntry (const char* const, const struct dirent*);
void followSymLink (const char* const, FDirEntry&); void followSymLink (const char* const, FDirEntry&) const;
void dirEntriesToList(); void dirEntriesToList();
void selectDirectoryEntry (const char* const); void selectDirectoryEntry (const char* const);
int changeDir (const FString&); int changeDir (const FString&);
@ -260,7 +260,7 @@ inline bool FFileDialog::unsetShowHiddenFiles()
{ return setShowHiddenFiles(false); } { return setShowHiddenFiles(false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FFileDialog::getShowHiddenFiles() inline bool FFileDialog::getShowHiddenFiles() const
{ return show_hidden; } { return show_hidden; }
} // namespace finalcut } // namespace finalcut

View File

@ -62,7 +62,7 @@ class FKeyboardCommand final
{ } { }
// Method // Method
void execute() void execute() const
{ {
handler(); handler();
} }
@ -100,8 +100,8 @@ class FKeyboard final
// Accessors // Accessors
const FString getClassName() const; const FString getClassName() const;
FKey getKey(); FKey getKey() const;
const FString getKeyName (const FKey); const FString getKeyName (const FKey) const;
keybuffer& getKeyBuffer(); keybuffer& getKeyBuffer();
timeval* getKeyPressedTime(); timeval* getKeyPressedTime();
static uInt64 getKeypressTimeout(); static uInt64 getKeypressTimeout();
@ -136,7 +136,7 @@ class FKeyboard final
static constexpr FKey NOT_SET = static_cast<FKey>(-1); static constexpr FKey NOT_SET = static_cast<FKey>(-1);
// Accessors // Accessors
FKey getMouseProtocolKey(); FKey getMouseProtocolKey() const;
FKey getTermcapKey(); FKey getTermcapKey();
FKey getMetaKey(); FKey getMetaKey();
FKey getSingleKey(); FKey getSingleKey();
@ -150,11 +150,11 @@ class FKeyboard final
static bool isKeypressTimeout(); static bool isKeypressTimeout();
// Methods // Methods
FKey UTF8decode (const char[]); FKey UTF8decode (const char[]) const;
ssize_t readKey(); ssize_t readKey();
void parseKeyBuffer(); void parseKeyBuffer();
FKey parseKeyString(); FKey parseKeyString();
FKey keyCorrection (const FKey&); FKey keyCorrection (const FKey&) const;
void substringKeyHandling(); void substringKeyHandling();
void keyPressed(); void keyPressed();
void keyReleased(); void keyReleased();
@ -192,7 +192,7 @@ inline const FString FKeyboard::getClassName() const
{ return "FKeyboard"; } { return "FKeyboard"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FKey FKeyboard::getKey() inline FKey FKeyboard::getKey() const
{ return key; } { return key; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -84,12 +84,12 @@ class FLabel : public FWidget
FLabel& operator << (const typeT&); FLabel& operator << (const typeT&);
FLabel& operator << (fc::SpecialCharacter); FLabel& operator << (fc::SpecialCharacter);
FLabel& operator << (const wchar_t); FLabel& operator << (const wchar_t);
const FLabel& operator >> (FString&); const FLabel& operator >> (FString&) const;
// Accessors // Accessors
const FString getClassName() const override; const FString getClassName() const override;
FWidget* getAccelWidget(); FWidget* getAccelWidget();
fc::text_alignment getAlignment(); fc::text_alignment getAlignment() const;
FString& getText(); FString& getText();
// Mutators // Mutators
@ -132,7 +132,7 @@ class FLabel : public FWidget
// Methods // Methods
void init(); void init();
void setHotkeyAccelerator(); void setHotkeyAccelerator();
std::size_t getAlignOffset (const std::size_t); std::size_t getAlignOffset (const std::size_t) const;
void draw() override; void draw() override;
void drawMultiLine(); void drawMultiLine();
void drawSingleLine(); void drawSingleLine();
@ -173,7 +173,7 @@ inline FWidget* FLabel::getAccelWidget ()
{ return accel_widget; } { return accel_widget; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline fc::text_alignment FLabel::getAlignment() inline fc::text_alignment FLabel::getAlignment() const
{ return alignment; } { return alignment; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -100,7 +100,7 @@ class FLineEdit : public FWidget
FLineEdit& operator << (const typeT&); FLineEdit& operator << (const typeT&);
FLineEdit& operator << (fc::SpecialCharacter); FLineEdit& operator << (fc::SpecialCharacter);
FLineEdit& operator << (const wchar_t); FLineEdit& operator << (const wchar_t);
const FLineEdit& operator >> (FString&); const FLineEdit& operator >> (FString&) const;
// Accessors // Accessors
const FString getClassName() const override; const FString getClassName() const override;
@ -108,7 +108,7 @@ class FLineEdit : public FWidget
std::size_t getMaxLength() const; std::size_t getMaxLength() const;
std::size_t getCursorPosition() const; std::size_t getCursorPosition() const;
FLabel* getLabelObject() const; FLabel* getLabelObject() const;
label_o getLabelOrientation(); label_o getLabelOrientation() const;
// Mutators // Mutators
void setText (const FString&); void setText (const FString&);
@ -184,7 +184,7 @@ class FLineEdit : public FWidget
void drawInputField(); void drawInputField();
std::size_t printTextField(); std::size_t printTextField();
std::size_t printPassword(); std::size_t printPassword();
std::size_t getCursorColumnPos(); std::size_t getCursorColumnPos() const;
const FString getPasswordText() const; const FString getPasswordText() const;
bool isPasswordField() const; bool isPasswordField() const;
offsetPair endPosToOffset (std::size_t); offsetPair endPosToOffset (std::size_t);
@ -199,7 +199,7 @@ class FLineEdit : public FWidget
void switchInsertMode(); void switchInsertMode();
void acceptInput(); void acceptInput();
bool keyInput (FKey); bool keyInput (FKey);
wchar_t characterFilter (const wchar_t); wchar_t characterFilter (const wchar_t) const;
void processActivate(); void processActivate();
void processChanged(); void processChanged();
@ -257,7 +257,7 @@ inline FLabel* FLineEdit::getLabelObject() const
{ return label; } { return label; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FLineEdit::label_o FLineEdit::getLabelOrientation() inline FLineEdit::label_o FLineEdit::getLabelOrientation() const
{ return label_orientation; } { return label_orientation; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -173,12 +173,12 @@ class FListBox : public FWidget
void setCurrentItem (std::size_t); void setCurrentItem (std::size_t);
void setCurrentItem (listBoxItems::iterator); void setCurrentItem (listBoxItems::iterator);
void selectItem (std::size_t); void selectItem (std::size_t);
void selectItem (listBoxItems::iterator); void selectItem (listBoxItems::iterator) const;
void unselectItem (std::size_t); void unselectItem (std::size_t);
void unselectItem (listBoxItems::iterator); void unselectItem (listBoxItems::iterator) const;
void showInsideBrackets (const std::size_t, fc::brackets_type); void showInsideBrackets (const std::size_t, fc::brackets_type);
void showNoBrackets (std::size_t); void showNoBrackets (std::size_t);
void showNoBrackets (listBoxItems::iterator); void showNoBrackets (listBoxItems::iterator) const;
void setSize (const FSize&, bool = true) override; void setSize (const FSize&, bool = true) override;
void setGeometry ( const FPoint&, const FSize& void setGeometry ( const FPoint&, const FSize&
, bool = true ) override; , bool = true ) override;
@ -259,7 +259,7 @@ class FListBox : public FWidget
void processKeyAction (FKeyEvent*); void processKeyAction (FKeyEvent*);
void draw() override; void draw() override;
void drawBorder() override; void drawBorder() override;
void drawScrollbars(); void drawScrollbars() const;
void drawHeadline(); void drawHeadline();
void drawList(); void drawList();
void drawListLine (int, listBoxItems::iterator, bool); void drawListLine (int, listBoxItems::iterator, bool);
@ -267,10 +267,10 @@ class FListBox : public FWidget
void printRightBracket (fc::brackets_type); void printRightBracket (fc::brackets_type);
void drawListBracketsLine (int, listBoxItems::iterator, bool); void drawListBracketsLine (int, listBoxItems::iterator, bool);
void setLineAttributes (int, bool, bool, bool&); void setLineAttributes (int, bool, bool, bool&);
void unsetAttributes(); void unsetAttributes() const;
void updateDrawing (bool, bool); void updateDrawing (bool, bool);
void recalculateHorizontalBar (std::size_t, bool); void recalculateHorizontalBar (std::size_t, bool);
void recalculateVerticalBar (std::size_t); void recalculateVerticalBar (std::size_t) const;
void getWidgetFocus(); void getWidgetFocus();
void multiSelection (std::size_t); void multiSelection (std::size_t);
void multiSelectionUpTo (std::size_t); void multiSelectionUpTo (std::size_t);
@ -304,7 +304,7 @@ class FListBox : public FWidget
void processClick(); void processClick();
void processSelect(); void processSelect();
void processChanged(); void processChanged();
void changeOnResize(); void changeOnResize() const;
void lazyConvert (listBoxItems::iterator, int); void lazyConvert (listBoxItems::iterator, int);
listBoxItems::iterator index2iterator (std::size_t); listBoxItems::iterator index2iterator (std::size_t);
listBoxItems::const_iterator index2iterator (std::size_t index) const; listBoxItems::const_iterator index2iterator (std::size_t index) const;
@ -415,7 +415,7 @@ inline void FListBox::selectItem (std::size_t index)
{ index2iterator(index - 1)->selected = true; } { index2iterator(index - 1)->selected = true; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListBox::selectItem (listBoxItems::iterator iter) inline void FListBox::selectItem (listBoxItems::iterator iter) const
{ iter->selected = true; } { iter->selected = true; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -423,7 +423,7 @@ inline void FListBox::unselectItem (std::size_t index)
{ index2iterator(index - 1)->selected = false; } { index2iterator(index - 1)->selected = false; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListBox::unselectItem (listBoxItems::iterator iter) inline void FListBox::unselectItem (listBoxItems::iterator iter) const
{ iter->selected = false; } { iter->selected = false; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -431,7 +431,7 @@ inline void FListBox::showNoBrackets (std::size_t index)
{ index2iterator(index - 1)->brackets = fc::NoBrackets; } { index2iterator(index - 1)->brackets = fc::NoBrackets; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListBox::showNoBrackets (listBoxItems::iterator iter) inline void FListBox::showNoBrackets (listBoxItems::iterator iter) const
{ iter->brackets = fc::NoBrackets; } { iter->brackets = fc::NoBrackets; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -103,8 +103,8 @@ class FListViewItem : public FObject
// Methods // Methods
iterator insert (FListViewItem*); iterator insert (FListViewItem*);
iterator insert (FListViewItem*, iterator); iterator insert (FListViewItem*, iterator) const;
void remove (FListViewItem*); void remove (FListViewItem*) const;
void expand(); void expand();
void collapse(); void collapse();
@ -279,7 +279,7 @@ class FListView : public FWidget
// Accessors // Accessors
const FString getClassName() const override; const FString getClassName() const override;
std::size_t getCount(); std::size_t getCount() const;
fc::text_alignment getColumnAlignment (int) const; fc::text_alignment getColumnAlignment (int) const;
FString getColumnText (int) const; FString getColumnText (int) const;
fc::sorting_type getColumnSortType (int) const; fc::sorting_type getColumnSortType (int) const;
@ -384,8 +384,8 @@ class FListView : public FWidget
static void setNullIterator (const iterator&); static void setNullIterator (const iterator&);
// Inquiry // Inquiry
bool isHorizontallyScrollable(); bool isHorizontallyScrollable() const;
bool isVerticallyScrollable(); bool isVerticallyScrollable() const;
// Methods // Methods
void init(); void init();
@ -395,7 +395,7 @@ class FListView : public FWidget
void sort (Compare); void sort (Compare);
std::size_t getAlignOffset ( const fc::text_alignment std::size_t getAlignOffset ( const fc::text_alignment
, const std::size_t , const std::size_t
, const std::size_t ); , const std::size_t ) const;
iterator getListEnd (const FListViewItem*); iterator getListEnd (const FListViewItem*);
void draw() override; void draw() override;
void drawBorder() override; void drawBorder() override;
@ -404,8 +404,8 @@ class FListView : public FWidget
void drawList(); void drawList();
void drawListLine (const FListViewItem*, bool, bool); void drawListLine (const FListViewItem*, bool, bool);
void clearList(); void clearList();
void setLineAttributes (bool, bool); void setLineAttributes (bool, bool) const;
FString getCheckBox (const FListViewItem* item); FString getCheckBox (const FListViewItem* item) const;
FString getLinePrefix (const FListViewItem*, std::size_t); FString getLinePrefix (const FListViewItem*, std::size_t);
void drawSortIndicator (std::size_t&, std::size_t); void drawSortIndicator (std::size_t&, std::size_t);
void drawHeadlineLabel (const headerItems::const_iterator&); void drawHeadlineLabel (const headerItems::const_iterator&);
@ -430,7 +430,7 @@ class FListView : public FWidget
iterator appendItem (FListViewItem*); iterator appendItem (FListViewItem*);
void processClick(); void processClick();
void processChanged(); void processChanged();
void changeOnResize(); void changeOnResize() const;
void toggleCheckbox(); void toggleCheckbox();
void collapseAndScrollLeft(); void collapseAndScrollLeft();
void expandAndScrollRight(); void expandAndScrollRight();
@ -650,11 +650,11 @@ inline FObject::iterator FListView::endOfList()
{ return itemlist.end(); } { return itemlist.end(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FListView::isHorizontallyScrollable() inline bool FListView::isHorizontallyScrollable() const
{ return bool( max_line_width > getClientWidth() ); } { return bool( max_line_width > getClientWidth() ); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FListView::isVerticallyScrollable() inline bool FListView::isVerticallyScrollable() const
{ return bool( getCount() > getClientHeight() ); } { return bool( getCount() > getClientHeight() ); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -97,9 +97,9 @@ class FLog : public std::stringbuf
protected: protected:
int sync() override; int sync() override;
const LogLevel& getLevel(); const LogLevel& getLevel() const;
LogLevel& setLevel(); LogLevel& setLevel();
const LineEnding& getEnding(); const LineEnding& getEnding() const;
LineEnding& setEnding(); LineEnding& setEnding();
private: private:
@ -131,7 +131,7 @@ inline const FString FLog::getClassName() const
{ return "FLog"; } { return "FLog"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FLog::LogLevel& FLog::getLevel() inline const FLog::LogLevel& FLog::getLevel() const
{ return level; } { return level; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -139,7 +139,7 @@ inline FLog::LogLevel& FLog::setLevel()
{ return level; } { return level; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FLog::LineEnding& FLog::getEnding() inline const FLog::LineEnding& FLog::getEnding() const
{ return end_of_line; } { return end_of_line; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -85,8 +85,8 @@ class FLogger : public FLog
private: private:
// Methods // Methods
void newlineReplace (std::string&, const std::string&); void newlineReplace (std::string&, const std::string&) const;
const std::string getTimeString(); const std::string getTimeString() const;
const std::string getEOL(); const std::string getEOL();
void printLogLine (const std::string&); void printLogLine (const std::string&);

View File

@ -127,7 +127,7 @@ class FMenu : public FWindow, public FMenuList
// Callback method // Callback method
void cb_menuitemEnabled (const FWidget*, const FDataPtr); void cb_menuitemEnabled (const FWidget*, const FDataPtr);
void cb_menuitemDisabled (const FWidget*, const FDataPtr); void cb_menuitemDisabled (const FWidget*, const FDataPtr);
void cb_menuitemToggled (FWidget*, const FDataPtr); void cb_menuitemToggled (FWidget*, const FDataPtr) const;
private: private:
// Constants // Constants
@ -169,13 +169,13 @@ class FMenu : public FWindow, public FMenuList
bool isMouseOverMenu (const FPoint&); bool isMouseOverMenu (const FPoint&);
bool isMouseOverSubMenu (const FPoint&); bool isMouseOverSubMenu (const FPoint&);
bool isMouseOverSuperMenu (const FPoint&); bool isMouseOverSuperMenu (const FPoint&);
bool isMouseOverMenuBar (const FPoint&); bool isMouseOverMenuBar (const FPoint&) const;
// Methods // Methods
void init(); void init();
void initCallbacks(); void initCallbacks();
void calculateDimensions(); void calculateDimensions();
void adjustItems(); void adjustItems() const;
int adjustX(int); int adjustX(int);
void openSubMenu (FMenu*, bool = false); void openSubMenu (FMenu*, bool = false);
void closeOpenedSubMenu(); void closeOpenedSubMenu();
@ -192,14 +192,14 @@ class FMenu : public FWindow, public FMenuList
void mouseMoveOverBorder (mouseStates&); void mouseMoveOverBorder (mouseStates&);
void passEventToSubMenu (FMouseEvent* const&); void passEventToSubMenu (FMouseEvent* const&);
void passEventToSuperMenu (FMouseEvent* const&); void passEventToSuperMenu (FMouseEvent* const&);
void passEventToMenuBar (FMouseEvent* const&); void passEventToMenuBar (FMouseEvent* const&) const;
bool containsMenuStructure (const FPoint&); bool containsMenuStructure (const FPoint&);
bool containsMenuStructure (int, int); bool containsMenuStructure (int, int);
FMenu* superMenuAt (const FPoint&); FMenu* superMenuAt (const FPoint&);
FMenu* superMenuAt (int, int); FMenu* superMenuAt (int, int);
bool selectNextItem(); bool selectNextItem();
bool selectPrevItem(); bool selectPrevItem();
void keypressMenuBar (FKeyEvent*); void keypressMenuBar (FKeyEvent*) const;
bool hotkeyMenu (FKeyEvent*); bool hotkeyMenu (FKeyEvent*);
void draw() override; void draw() override;
void drawItems(); void drawItems();
@ -211,7 +211,7 @@ class FMenu : public FWindow, public FMenuList
void drawAcceleratorKey (std::size_t&, FKey); void drawAcceleratorKey (std::size_t&, FKey);
void drawTrailingSpaces (std::size_t); void drawTrailingSpaces (std::size_t);
void setLineAttributes (const FMenuItem*, int); void setLineAttributes (const FMenuItem*, int);
void setCursorToHotkeyPosition (FMenuItem*); void setCursorToHotkeyPosition (FMenuItem*) const;
void selectPrevMenu (FKeyEvent*); void selectPrevMenu (FKeyEvent*);
void selectNextMenu (FKeyEvent*); void selectNextMenu (FKeyEvent*);
void acceptSelection(); void acceptSelection();

View File

@ -99,7 +99,7 @@ class FMenuBar : public FWindow, public FMenuList
void onAccel (FAccelEvent*) override; void onAccel (FAccelEvent*) override;
// Callback methods // Callback methods
void cb_itemDeactivated (FWidget*, const FDataPtr); void cb_itemDeactivated (FWidget*, const FDataPtr) const;
private: private:
// Constants // Constants
@ -119,7 +119,7 @@ class FMenuBar : public FWindow, public FMenuList
// Methods // Methods
void init(); void init();
void calculateDimensions(); void calculateDimensions() const;
bool selectNextItem(); bool selectNextItem();
bool selectPrevItem(); bool selectPrevItem();
bool hotkeyMenu (FKeyEvent*&); bool hotkeyMenu (FKeyEvent*&);
@ -127,12 +127,12 @@ class FMenuBar : public FWindow, public FMenuList
void drawItems(); void drawItems();
void drawItem (FMenuItem*, std::size_t&); void drawItem (FMenuItem*, std::size_t&);
void setLineAttributes (const FMenuItem*); void setLineAttributes (const FMenuItem*);
void setCursorToHotkeyPosition (FMenuItem*, std::size_t); void setCursorToHotkeyPosition (FMenuItem*, std::size_t) const;
void drawMenuText (menuText&); void drawMenuText (menuText&);
void drawEllipsis (const menuText&, std::size_t); void drawEllipsis (const menuText&, std::size_t);
void drawLeadingSpace (std::size_t&); void drawLeadingSpace (std::size_t&);
void drawTrailingSpace (std::size_t&); void drawTrailingSpace (std::size_t&);
void adjustItems(); void adjustItems() const;
bool activateMenu (const FMenuItem*); bool activateMenu (const FMenuItem*);
bool clickItem (FMenuItem*); bool clickItem (FMenuItem*);
void unselectMenuItem (FMenuItem*); void unselectMenuItem (FMenuItem*);
@ -140,7 +140,7 @@ class FMenuBar : public FWindow, public FMenuList
void mouseDownOverList (const FMouseEvent*); void mouseDownOverList (const FMouseEvent*);
void mouseUpOverList (const FMouseEvent*); void mouseUpOverList (const FMouseEvent*);
void mouseMoveOverList (const FMouseEvent*); void mouseMoveOverList (const FMouseEvent*);
void passEventToMenu (const FMouseEvent* const&); void passEventToMenu (const FMouseEvent* const&) const;
void leaveMenuBar(); void leaveMenuBar();
// Data members // Data members

View File

@ -160,12 +160,12 @@ class FMenuItem : public FWidget
void processDisable(); void processDisable();
void processActivate(); void processActivate();
void processDeactivate(); void processDeactivate();
void createDialogList (FMenu*); void createDialogList (FMenu*) const;
template <typename T> template <typename T>
void passMouseEvent (T, const FMouseEvent*, fc::events); void passMouseEvent (T, const FMouseEvent*, fc::events) const;
// Callback methods // Callback methods
void cb_switchToDialog (const FWidget*, FDataPtr); void cb_switchToDialog (const FWidget*, FDataPtr) const;
void cb_destroyDialog (FWidget*, const FDataPtr); void cb_destroyDialog (FWidget*, const FDataPtr);
virtual void processClicked(); virtual void processClicked();

View File

@ -144,7 +144,7 @@ class FMessageBox : public FDialog
void initCallbacks(); void initCallbacks();
void calculateDimensions(); void calculateDimensions();
void draw() override; void draw() override;
void resizeButtons(); void resizeButtons() const;
void adjustButtons(); void adjustButtons();
// Data members // Data members

View File

@ -103,7 +103,7 @@ class FMouse
// Accessors // Accessors
virtual const FString getClassName() const; virtual const FString getClassName() const;
const FPoint& getPos(); const FPoint& getPos() const;
void clearEvent(); void clearEvent();
// Mutators // Mutators
@ -113,7 +113,7 @@ class FMouse
// Inquiries // Inquiries
virtual bool hasData() = 0; virtual bool hasData() = 0;
bool hasEvent(); bool hasEvent() const;
bool isLeftButtonPressed(); bool isLeftButtonPressed();
bool isLeftButtonReleased(); bool isLeftButtonReleased();
bool isLeftButtonDoubleClick(); bool isLeftButtonDoubleClick();
@ -127,7 +127,7 @@ class FMouse
bool isWheelUp(); bool isWheelUp();
bool isWheelDown(); bool isWheelDown();
bool isMoved(); bool isMoved();
bool isInputDataPending(); bool isInputDataPending() const;
// Methods // Methods
template<typename ClassT> template<typename ClassT>
@ -162,10 +162,10 @@ class FMouse
// Accessors // Accessors
FMouseButton& getButtonState(); FMouseButton& getButtonState();
const FPoint& getNewPos(); const FPoint& getNewPos() const;
uInt16 getMaxWidth(); uInt16 getMaxWidth() const;
uInt16 getMaxHeight(); uInt16 getMaxHeight() const;
uInt64 getDblclickInterval(); uInt64 getDblclickInterval() const;
timeval* getMousePressedTime(); timeval* getMousePressedTime();
// Mutator // Mutator
@ -177,7 +177,7 @@ class FMouse
void resetMousePressedTime(); void resetMousePressedTime();
// Inquiry // Inquiry
bool isDblclickTimeout (const timeval*); bool isDblclickTimeout (const timeval*) const;
private: private:
// Data members // Data members
@ -222,7 +222,7 @@ class FMouseGPM final : public FMouse
// Inquiry // Inquiry
bool hasData() override; bool hasData() override;
bool isGpmMouseEnabled(); bool isGpmMouseEnabled() const;
// Methods // Methods
void setRawData (FKeyboard::keybuffer&) override; void setRawData (FKeyboard::keybuffer&) override;
@ -230,7 +230,7 @@ class FMouseGPM final : public FMouse
bool gpmMouse (bool); bool gpmMouse (bool);
bool enableGpmMouse(); bool enableGpmMouse();
bool disableGpmMouse(); bool disableGpmMouse();
bool hasSignificantEvents(); bool hasSignificantEvents() const;
void interpretKeyDown(); void interpretKeyDown();
void interpretKeyUp(); void interpretKeyUp();
bool getGpmKeyPressed(bool); bool getGpmKeyPressed(bool);
@ -246,7 +246,7 @@ class FMouseGPM final : public FMouse
}; };
// Method // Method
int gpmEvent (bool = true); int gpmEvent (bool = true) const;
// Data member // Data member
Gpm_Event gpm_ev{}; Gpm_Event gpm_ev{};
@ -264,7 +264,7 @@ inline bool FMouseGPM::disableGpmMouse()
{ return gpmMouse(false); } { return gpmMouse(false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FMouseGPM::isGpmMouseEnabled() inline bool FMouseGPM::isGpmMouseEnabled() const
{ return gpm_mouse_enabled; } { return gpm_mouse_enabled; }
#endif // F_HAVE_LIBGPM #endif // F_HAVE_LIBGPM
@ -513,7 +513,7 @@ class FMouseControl
// Accessor // Accessor
FMouse* getMouseWithData(); FMouse* getMouseWithData();
FMouse* getMouseWithEvent(); FMouse* getMouseWithEvent();
void xtermMouse (bool); void xtermMouse (bool) const;
void enableXTermMouse(); void enableXTermMouse();
void disableXTermMouse(); void disableXTermMouse();

View File

@ -124,9 +124,9 @@ class FObject
static void getCurrentTime (timeval*); static void getCurrentTime (timeval*);
static bool isTimeout (const timeval*, uInt64); static bool isTimeout (const timeval*, uInt64);
int addTimer (int); int addTimer (int);
bool delTimer (int); bool delTimer (int) const;
bool delOwnTimer(); bool delOwnTimer() const;
bool delAllTimer(); bool delAllTimer() const;
protected: protected:
struct FTimerData struct FTimerData

View File

@ -244,7 +244,7 @@ class FOptiAttr final
// Methods // Methods
bool hasColorChanged (const FChar* const&, const FChar* const&) const; bool hasColorChanged (const FChar* const&, const FChar* const&) const;
void resetColor (FChar*&); void resetColor (FChar*&) const;
void prevent_no_color_video_attributes (FChar*&, bool = false); void prevent_no_color_video_attributes (FChar*&, bool = false);
void deactivateAttributes (FChar*&, FChar*&); void deactivateAttributes (FChar*&, FChar*&);
void changeAttributeSGR (FChar*&, FChar*&); void changeAttributeSGR (FChar*&, FChar*&);
@ -252,14 +252,14 @@ class FOptiAttr final
void change_color (FChar*&, FChar*&); void change_color (FChar*&, FChar*&);
void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&); void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&);
void change_current_color (const FChar* const&, FColor, FColor); void change_current_color (const FChar* const&, FColor, FColor);
void resetAttribute (FChar*&); void resetAttribute (FChar*&) const;
void reset (FChar*&); void reset (FChar*&);
bool caused_reset_attributes (const char[], uChar = all_tests); bool caused_reset_attributes (const char[], uChar = all_tests) const;
bool hasCharsetEquivalence() const; bool hasCharsetEquivalence() const;
void detectSwitchOn (const FChar* const&, const FChar* const&); void detectSwitchOn (const FChar* const&, const FChar* const&);
void detectSwitchOff (const FChar* const&, const FChar* const&); void detectSwitchOff (const FChar* const&, const FChar* const&);
bool switchOn(); bool switchOn() const;
bool switchOff(); bool switchOff() const;
bool append_sequence (const char[]); bool append_sequence (const char[]);
// Data members // Data members

View File

@ -143,7 +143,7 @@ class FOptiMove final
void set_eat_newline_glitch (bool); void set_eat_newline_glitch (bool);
// Methods // Methods
void check_boundaries (int&, int&, int&, int&); void check_boundaries (int&, int&, int&, int&) const;
const char* moveCursor (int, int, int, int); const char* moveCursor (int, int, int, int);
private: private:
@ -166,9 +166,9 @@ class FOptiMove final
// Methods // Methods
void calculateCharDuration(); void calculateCharDuration();
int capDuration (const char[], int); int capDuration (const char[], int) const;
int capDurationToLength (int); int capDurationToLength (int) const;
int repeatedAppend (const capability&, volatile int, char*); int repeatedAppend (const capability&, volatile int, char*) const;
int relativeMove (char[], int, int, int, int); int relativeMove (char[], int, int, int, int);
int verticalMove (char[], int, int); int verticalMove (char[], int, int);
void downMove (char[], int&, int, int); void downMove (char[], int&, int, int);

View File

@ -70,7 +70,7 @@ class FProgressbar : public FWidget
// Accessors // Accessors
const FString getClassName() const override; const FString getClassName() const override;
std::size_t getPercentage(); std::size_t getPercentage() const;
// Mutators // Mutators
void setPercentage (std::size_t); void setPercentage (std::size_t);
@ -112,7 +112,7 @@ inline const FString FProgressbar::getClassName() const
{ return "FProgressbar"; } { return "FProgressbar"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FProgressbar::getPercentage() inline std::size_t FProgressbar::getPercentage() const
{ return percentage; } { return percentage; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -139,9 +139,9 @@ class FScrollbar : public FWidget
void drawHorizontalBackgroundColumn(); void drawHorizontalBackgroundColumn();
void drawButtons(); void drawButtons();
sType getClickedScrollType (int, int); sType getClickedScrollType (int, int);
sType getVerticalClickedScrollType (int); sType getVerticalClickedScrollType (int) const;
sType getHorizontalClickedScrollType (int); sType getHorizontalClickedScrollType (int) const;
int getSliderClickPos (int, int); int getSliderClickPos (int, int) const;
void jumpToClickPos (int, int); void jumpToClickPos (int, int);
void jumpToClickPos (int); void jumpToClickPos (int);
void avoidScrollOvershoot(); void avoidScrollOvershoot();

View File

@ -83,7 +83,7 @@ class FScrollView : public FWidget
const FString getClassName() const override; const FString getClassName() const override;
std::size_t getViewportWidth() const; std::size_t getViewportWidth() const;
std::size_t getViewportHeight() const; std::size_t getViewportHeight() const;
const FSize getViewportSize(); const FSize getViewportSize() const;
std::size_t getScrollWidth() const; std::size_t getScrollWidth() const;
std::size_t getScrollHeight() const; std::size_t getScrollHeight() const;
const FSize getScrollSize() const; const FSize getScrollSize() const;
@ -157,18 +157,18 @@ class FScrollView : public FWidget
static constexpr int horizontal_border_spacing = 2; static constexpr int horizontal_border_spacing = 2;
// Accessors // Accessors
const FPoint getViewportCursorPos(); const FPoint getViewportCursorPos() const;
// Methods // Methods
void init(); void init();
void mapKeyFunctions(); void mapKeyFunctions();
void calculateScrollbarPos(); void calculateScrollbarPos() const;
template<typename Callback> template<typename Callback>
void initScrollbar ( FScrollbarPtr& void initScrollbar ( FScrollbarPtr&
, fc::orientation , fc::orientation
, Callback ); , Callback );
void setHorizontalScrollBarVisibility(); void setHorizontalScrollBarVisibility() const;
void setVerticalScrollBarVisibility(); void setVerticalScrollBarVisibility() const;
void setViewportCursor(); void setViewportCursor();
// Callback methods // Callback methods
@ -203,7 +203,7 @@ inline std::size_t FScrollView::getViewportHeight() const
{ return getHeight() - horizontal_border_spacing; } { return getHeight() - horizontal_border_spacing; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FSize FScrollView::getViewportSize() inline const FSize FScrollView::getViewportSize() const
{ return FSize(getViewportWidth(), getViewportHeight()); } { return FSize(getViewportWidth(), getViewportHeight()); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -79,7 +79,7 @@ class FSpinBox : public FWidget
// Accessors // Accessors
const FString getClassName() const override; const FString getClassName() const override;
sInt64 getValue(); sInt64 getValue() const;
FString getPrefix() const; FString getPrefix() const;
FString getSuffix() const; FString getSuffix() const;
FLineEdit::label_o getLabelOrientation(); FLineEdit::label_o getLabelOrientation();
@ -163,7 +163,7 @@ inline const FString FSpinBox::getClassName() const
{ return "FSpinBox"; } { return "FSpinBox"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline sInt64 FSpinBox::getValue() inline sInt64 FSpinBox::getValue() const
{ return value; } { return value; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -235,8 +235,8 @@ class FStatusBar : public FWindow
// Methods // Methods
void init(); void init();
int getKeyNameWidth (const FStatusKey*); int getKeyNameWidth (const FStatusKey*) const;
int getKeyTextWidth (const FStatusKey*); int getKeyTextWidth (const FStatusKey*) const;
void draw() override; void draw() override;
void drawKeys(); void drawKeys();
void drawKey (keyList::const_iterator); void drawKey (keyList::const_iterator);

View File

@ -120,25 +120,26 @@ class FString
, int>::type = 0 > , int>::type = 0 >
FString& operator << (const NumT); FString& operator << (const NumT);
const FString& operator >> (FString&); const FString& operator >> (FString&) const;
const FString& operator >> (std::wstring&); const FString& operator >> (std::wstring&) const;
const FString& operator >> (std::string&); const FString& operator >> (std::string&) const;
const FString& operator >> (wchar_t&); const FString& operator >> (wchar_t&) const;
const FString& operator >> (char&); const FString& operator >> (char&) const;
const FString& operator >> (sInt16&); const FString& operator >> (sInt16&) const;
const FString& operator >> (uInt16&); const FString& operator >> (uInt16&) const;
const FString& operator >> (sInt32&); const FString& operator >> (sInt32&) const;
const FString& operator >> (uInt32&); const FString& operator >> (uInt32&) const;
const FString& operator >> (sInt64&); const FString& operator >> (sInt64&) const;
const FString& operator >> (uInt64&); const FString& operator >> (uInt64&) const;
const FString& operator >> (double&); const FString& operator >> (double&) const;
const FString& operator >> (float&); const FString& operator >> (float&) const;
template <typename IndexT> template <typename IndexT>
wchar_t& operator [] (const IndexT); wchar_t& operator [] (const IndexT);
template <typename IndexT> template <typename IndexT>
const wchar_t& operator [] (const IndexT) const; const wchar_t& operator [] (const IndexT) const;
const FString& operator () (); explicit operator bool () const;
const FString& operator () () const;
bool operator < (const FString&) const; bool operator < (const FString&) const;
template <typename CharT> template <typename CharT>
@ -227,7 +228,7 @@ class FString
const FString& insert (const FString&, int); const FString& insert (const FString&, int);
const FString& insert (const FString&, std::size_t); const FString& insert (const FString&, std::size_t);
const FString replace (const FString&, const FString&); const FString replace (const FString&, const FString&) const;
const FString replaceControlCodes() const; const FString replaceControlCodes() const;
const FString expandTabs (int = 8) const; const FString expandTabs (int = 8) const;
@ -254,7 +255,7 @@ class FString
void _remove (std::size_t, std::size_t); void _remove (std::size_t, std::size_t);
const char* _to_cstring (const wchar_t[]) const; const char* _to_cstring (const wchar_t[]) const;
const wchar_t* _to_wcstring (const char[]) const; const wchar_t* _to_wcstring (const char[]) const;
const wchar_t* _extractToken (wchar_t*[], const wchar_t[], const wchar_t[]); const wchar_t* _extractToken (wchar_t*[], const wchar_t[], const wchar_t[]) const;
// Data members // Data members
wchar_t* string{nullptr}; wchar_t* string{nullptr};

View File

@ -349,16 +349,16 @@ class FTerm final
static void enableAlternateCharset(); static void enableAlternateCharset();
static void useAlternateScreenBuffer(); static void useAlternateScreenBuffer();
static void useNormalScreenBuffer(); static void useNormalScreenBuffer();
void allocationValues(); void allocationValues() const;
void deallocationValues(); void deallocationValues();
void init(); void init();
bool init_terminal(); bool init_terminal();
void initOSspecifics(); void initOSspecifics() const;
void initTermspecifics(); void initTermspecifics() const;
void initBaudRate(); void initBaudRate() const;
void finish(); void finish();
void finishOSspecifics(); void finishOSspecifics() const;
void finish_encoding(); void finish_encoding() const;
void destroyColorPaletteTheme(); void destroyColorPaletteTheme();
static void printExitMessage(); static void printExitMessage();
static void terminalSizeChange(); static void terminalSizeChange();
@ -475,10 +475,6 @@ inline void FTerm::initTerminal()
} // namespace finalcut } // namespace finalcut
namespace
{
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::ostream& operator << ( std::ostream& os inline std::ostream& operator << ( std::ostream& os
, finalcut::fc::SpecialCharacter c ) , finalcut::fc::SpecialCharacter c )
@ -493,6 +489,4 @@ inline std::wostream& operator << ( std::wostream& os
return os << static_cast<wchar_t>(c); return os << static_cast<wchar_t>(c);
} }
} // namespace
#endif // FTERM_H #endif // FTERM_H

View File

@ -98,8 +98,8 @@ class FTermBuffer
int writef (const FString&, Args&&...); int writef (const FString&, Args&&...);
int write (const FString&); int write (const FString&);
int write (wchar_t); int write (wchar_t);
void write (const FStyle&); void write (const FStyle&) const;
void write (const FColorPair&); void write (const FColorPair&) const;
FTermBuffer& write (); FTermBuffer& write ();
private: private:

View File

@ -78,8 +78,8 @@ class FTermData final
FRect& getTermGeometry(); FRect& getTermGeometry();
int getTTYFileDescriptor() const; int getTTYFileDescriptor() const;
uInt getBaudrate() const; uInt getBaudrate() const;
const char* getTermType(); const char* getTermType() const;
const char* getTermFileName(); const char* getTermFileName() const;
const FString& getXtermFont() const; const FString& getXtermFont() const;
const FString& getXtermTitle() const; const FString& getXtermTitle() const;
const FString& getExitMessage() const; const FString& getExitMessage() const;
@ -194,11 +194,11 @@ inline uInt FTermData::getBaudrate() const
{ return baudrate; } { return baudrate; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const char* FTermData::getTermType() inline const char* FTermData::getTermType() const
{ return termtype; } { return termtype; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const char* FTermData::getTermFileName() inline const char* FTermData::getTermFileName() const
{ return termfilename; } { return termfilename; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -94,14 +94,14 @@ class FTermLinux final
// Accessors // Accessors
const FString getClassName() const; const FString getClassName() const;
fc::linuxConsoleCursorStyle getCursorStyle(); fc::linuxConsoleCursorStyle getCursorStyle() const;
char* getCursorStyleString(); char* getCursorStyleString();
int getFramebufferBpp() const; int getFramebufferBpp() const;
// Mutators // Mutators
bool setCursorStyle (CursorStyle); bool setCursorStyle (CursorStyle);
bool setPalette (FColor, int, int, int); bool setPalette (FColor, int, int, int);
void setUTF8 (bool); void setUTF8 (bool) const;
// Inquiries // Inquiries
bool isLinuxConsole(); bool isLinuxConsole();
@ -117,8 +117,8 @@ class FTermLinux final
bool loadOldFont(); bool loadOldFont();
bool saveColorMap(); bool saveColorMap();
bool resetColorMap(); bool resetColorMap();
void setBeep (int, int); void setBeep (int, int) const;
void resetBeep(); void resetBeep() const;
FKey modifierKeyCorrection (const FKey&); FKey modifierKeyCorrection (const FKey&);
@ -155,7 +155,7 @@ class FTermLinux final
int setScreenFont ( uChar[], uInt, uInt, uInt int setScreenFont ( uChar[], uInt, uInt, uInt
, bool = false ); , bool = false );
int setUnicodeMap (struct unimapdesc*); int setUnicodeMap (struct unimapdesc*);
void setLinuxCursorStyle (fc::linuxConsoleCursorStyle); void setLinuxCursorStyle (fc::linuxConsoleCursorStyle) const;
// Methods // Methods
#if defined(ISA_SYSCTL_SUPPORT) #if defined(ISA_SYSCTL_SUPPORT)
@ -172,14 +172,14 @@ class FTermLinux final
bool saveVGAPalette(); bool saveVGAPalette();
bool resetVGAPalette(); bool resetVGAPalette();
#endif // defined(ISA_SYSCTL_SUPPORT) #endif // defined(ISA_SYSCTL_SUPPORT)
FKey shiftKeyCorrection (const FKey&); FKey shiftKeyCorrection (const FKey&) const;
FKey ctrlKeyCorrection (const FKey&); FKey ctrlKeyCorrection (const FKey&) const;
FKey altKeyCorrection (const FKey&); FKey altKeyCorrection (const FKey&) const;
FKey shiftCtrlKeyCorrection (const FKey&); FKey shiftCtrlKeyCorrection (const FKey&) const;
FKey shiftAltKeyCorrection (const FKey&); FKey shiftAltKeyCorrection (const FKey&) const;
FKey ctrlAltKeyCorrection (const FKey&); FKey ctrlAltKeyCorrection (const FKey&) const;
FKey shiftCtrlAltKeyCorrection (const FKey&); FKey shiftCtrlAltKeyCorrection (const FKey&) const;
sInt16 getFontPos (wchar_t ucs); sInt16 getFontPos (wchar_t ucs) const;
void initSpecialCharacter(); void initSpecialCharacter();
void characterFallback (wchar_t, std::vector<wchar_t>); void characterFallback (wchar_t, std::vector<wchar_t>);

View File

@ -110,7 +110,7 @@ class FTermXTerminal final
private: private:
// Methods // Methods
void warnNotInitialized(); void warnNotInitialized() const;
void setXTermCursorStyle(); void setXTermCursorStyle();
void setXTermFont(); void setXTermFont();
void setXTermTitle(); void setXTermTitle();
@ -132,7 +132,7 @@ class FTermXTerminal final
void resetXTermMouseForeground(); void resetXTermMouseForeground();
void resetXTermMouseBackground(); void resetXTermMouseBackground();
void resetXTermHighlightBackground(); void resetXTermHighlightBackground();
bool isInitialized(); bool isInitialized() const;
bool canResetColor(); bool canResetColor();
void oscPrefix(); void oscPrefix();
void oscPostfix(); void oscPostfix();
@ -225,7 +225,7 @@ inline void FTermXTerminal::unsetMouseSupport()
{ setMouseSupport (false); } { setMouseSupport (false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FTermXTerminal::isInitialized() inline bool FTermXTerminal::isInitialized() const
{ return bool(fsystem && term_detection); } { return bool(fsystem && term_detection); }
} // namespace finalcut } // namespace finalcut

View File

@ -141,8 +141,8 @@ class FTextView : public FWidget
typedef std::unordered_map<int, std::function<void()>> keyMap; typedef std::unordered_map<int, std::function<void()>> keyMap;
// Accessors // Accessors
std::size_t getTextHeight(); std::size_t getTextHeight() const;
std::size_t getTextWidth(); std::size_t getTextWidth() const;
// Inquiry // Inquiry
bool isHorizontallyScrollable(); bool isHorizontallyScrollable();
@ -155,10 +155,10 @@ class FTextView : public FWidget
void drawBorder() override; void drawBorder() override;
void drawScrollbars(); void drawScrollbars();
void drawText(); void drawText();
bool useFDialogBorder(); bool useFDialogBorder() const;
bool isPrintable (wchar_t); bool isPrintable (wchar_t) const;
void processChanged(); void processChanged();
void changeOnResize(); void changeOnResize() const;
// Callback methods // Callback methods
void cb_vbarChange (const FWidget*, const FDataPtr); void cb_vbarChange (const FWidget*, const FDataPtr);

View File

@ -149,7 +149,7 @@ class FToggleButton : public FWidget
// Methods // Methods
void init(); void init();
void drawText (const FString&, std::size_t); void drawText (const FString&, std::size_t);
void correctSize (FSize&); void correctSize (FSize&) const;
// Data members // Data members
FButtonGroup* button_group{nullptr}; FButtonGroup* button_group{nullptr};

View File

@ -47,9 +47,6 @@
<< " in " \ << " in " \
<< __func__ << std::endl; << __func__ << std::endl;
namespace
{
typedef unsigned char uChar; typedef unsigned char uChar;
typedef unsigned short uShort; typedef unsigned short uShort;
typedef unsigned int uInt; typedef unsigned int uInt;
@ -73,8 +70,6 @@ typedef uInt16 FAttribute;
typedef uInt32 FKey; typedef uInt32 FKey;
typedef void* FDataPtr; typedef void* FDataPtr;
} // namespace
namespace finalcut namespace finalcut
{ {
@ -82,7 +77,7 @@ namespace finalcut
template <typename T, bool is_signed> template <typename T, bool is_signed>
struct is_negative struct is_negative
{ {
inline bool operator () (const T& x) inline bool operator () (const T& x) const
{ {
return x < 0; return x < 0;
} }
@ -91,7 +86,7 @@ struct is_negative
template <typename T> template <typename T>
struct is_negative<T, false> struct is_negative<T, false>
{ {
inline bool operator () (const T&) inline bool operator () (const T&) const
{ {
return false; return false;
} }

View File

@ -151,14 +151,14 @@ class FVTerm
FTerm& getFTerm(); FTerm& getFTerm();
// Mutators // Mutators
void setTermXY (int, int); void setTermXY (int, int) const;
void setTerminalUpdates (terminal_update); void setTerminalUpdates (terminal_update);
void hideCursor (bool); void hideCursor (bool) const;
void hideCursor(); void hideCursor() const;
void showCursor(); void showCursor() const;
void setPrintCursor (const FPoint&); void setPrintCursor (const FPoint&);
FColor rgb2ColorIndex (uInt8, uInt8, uInt8); FColor rgb2ColorIndex (uInt8, uInt8, uInt8) const;
static void setColor (FColor, FColor); static void setColor (FColor, FColor);
static void setNormal(); static void setNormal();
@ -287,7 +287,7 @@ class FVTerm
// Mutators // Mutators
void setPrintArea (FTermArea*); void setPrintArea (FTermArea*);
void setChildPrintArea (FTermArea*); void setChildPrintArea (FTermArea*);
void setActiveArea (FTermArea*); void setActiveArea (FTermArea*) const;
// Inquiries // Inquiries
bool hasPrintArea() const; bool hasPrintArea() const;
@ -339,7 +339,8 @@ class FVTerm
static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768; static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768;
// Methods // Methods
void setTextToDefault (const FTermArea*, const FSize&); void resetTextAreaToDefault ( const FTermArea*
, const FSize&) const;
static bool reallocateTextArea ( FTermArea* static bool reallocateTextArea ( FTermArea*
, std::size_t , std::size_t
, std::size_t ); , std::size_t );
@ -366,7 +367,7 @@ class FVTerm
void updateVTerm(); void updateVTerm();
static void callPreprocessingHandler (const FTermArea*); static void callPreprocessingHandler (const FTermArea*);
bool hasChildAreaChanges (FTermArea*) const; bool hasChildAreaChanges (FTermArea*) const;
void clearChildAreaChanges (const FTermArea*); void clearChildAreaChanges (const FTermArea*) const;
static bool isInsideArea (const FPoint&, const FTermArea*); static bool isInsideArea (const FPoint&, const FTermArea*);
static const FChar generateCharacter (const FPoint&); static const FChar generateCharacter (const FPoint&);
static const FChar getCharacter ( character_type static const FChar getCharacter ( character_type
@ -390,30 +391,30 @@ class FVTerm
static bool canClearTrailingWS (uInt&, uInt); static bool canClearTrailingWS (uInt&, uInt);
bool skipUnchangedCharacters (uInt&, uInt, uInt); bool skipUnchangedCharacters (uInt&, uInt, uInt);
void printRange (uInt, uInt, uInt, bool); void printRange (uInt, uInt, uInt, bool);
void replaceNonPrintableFullwidth (uInt, FChar*&); void replaceNonPrintableFullwidth (uInt, FChar*&) const;
void printCharacter (uInt&, uInt, bool, FChar*&); void printCharacter (uInt&, uInt, bool, FChar*&);
void printFullWidthCharacter (uInt&, uInt, FChar*&); void printFullWidthCharacter (uInt&, uInt, FChar*&);
void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&); void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&);
void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&); void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&);
void skipPaddingCharacter (uInt&, uInt, const FChar* const&); void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const;
exit_state eraseCharacters (uInt&, uInt, uInt, bool); exit_state eraseCharacters (uInt&, uInt, uInt, bool);
exit_state repeatCharacter (uInt&, uInt, uInt); exit_state repeatCharacter (uInt&, uInt, uInt);
bool isFullWidthChar (const FChar* const&) const; bool isFullWidthChar (const FChar* const&) const;
bool isFullWidthPaddingChar (const FChar* const&) const; bool isFullWidthPaddingChar (const FChar* const&) const;
static void cursorWrap(); static void cursorWrap();
bool printWrap (FTermArea*); bool printWrap (FTermArea*) const;
void printPaddingCharacter (FTermArea*, const FChar&); void printPaddingCharacter (FTermArea*, const FChar&);
void updateTerminalLine (uInt); void updateTerminalLine (uInt);
bool updateTerminalCursor(); bool updateTerminalCursor();
bool isInsideTerminal (const FPoint&); bool isInsideTerminal (const FPoint&) const;
bool isTermSizeChanged(); bool isTermSizeChanged() const;
static void markAsPrinted (uInt, uInt); static void markAsPrinted (uInt, uInt);
static void markAsPrinted (uInt, uInt, uInt); static void markAsPrinted (uInt, uInt, uInt);
static void newFontChanges (FChar*&); static void newFontChanges (FChar*&);
static void charsetChanges (FChar*&); static void charsetChanges (FChar*&);
void appendCharacter (FChar*&); void appendCharacter (FChar*&);
void appendChar (FChar*&); void appendChar (FChar*&);
void appendAttributes (FChar*&); void appendAttributes (FChar*&) const;
int appendLowerRight (FChar*&); int appendLowerRight (FChar*&);
static void characterFilter (FChar*&); static void characterFilter (FChar*&);
static void appendOutputBuffer (const std::string&); static void appendOutputBuffer (const std::string&);
@ -629,11 +630,11 @@ inline FTerm& FVTerm::getFTerm()
{ return *fterm; } { return *fterm; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::hideCursor() inline void FVTerm::hideCursor() const
{ return hideCursor(true); } { return hideCursor(true); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::showCursor() inline void FVTerm::showCursor() const
{ return hideCursor(false); } { return hideCursor(false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -957,7 +958,7 @@ inline void FVTerm::setChildPrintArea (FTermArea* area)
{ child_print_area = area; } { child_print_area = area; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::setActiveArea (FTermArea* area) inline void FVTerm::setActiveArea (FTermArea* area) const
{ active_area = area; } { active_area = area; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -233,10 +233,10 @@ class FWidget : public FVTerm, public FObject
const FRect& getGeometryWithShadow(); const FRect& getGeometryWithShadow();
const FRect& getTermGeometry(); const FRect& getTermGeometry();
const FRect& getTermGeometryWithShadow(); const FRect& getTermGeometryWithShadow();
std::size_t getDesktopWidth(); std::size_t getDesktopWidth() const;
std::size_t getDesktopHeight(); std::size_t getDesktopHeight() const;
const FWidgetFlags& getFlags() const; const FWidgetFlags& getFlags() const;
const FPoint getCursorPos(); const FPoint getCursorPos() const;
const FPoint getPrintPos(); const FPoint getPrintPos();
// Mutators // Mutators
@ -272,7 +272,7 @@ class FWidget : public FVTerm, public FObject
virtual void setBackgroundColor (FColor); virtual void setBackgroundColor (FColor);
virtual void resetColors(); virtual void resetColors();
void useParentWidgetColor(); void useParentWidgetColor();
void setColor(); void setColor() const;
FWidgetFlags& setFlags(); FWidgetFlags& setFlags();
// Positioning and sizes mutators... // Positioning and sizes mutators...
virtual void setX (int, bool = true); virtual void setX (int, bool = true);
@ -285,7 +285,7 @@ class FWidget : public FVTerm, public FObject
void setLeftPadding (int, bool = true); void setLeftPadding (int, bool = true);
void setBottomPadding (int, bool = true); void setBottomPadding (int, bool = true);
void setRightPadding (int, bool = true); void setRightPadding (int, bool = true);
void setTermSize (const FSize&); void setTermSize (const FSize&) const;
virtual void setGeometry (const FRect&, bool = true); virtual void setGeometry (const FRect&, bool = true);
virtual void setGeometry (const FPoint&, const FSize&, bool = true); virtual void setGeometry (const FPoint&, const FSize&, bool = true);
virtual void setShadowSize (const FSize&); virtual void setShadowSize (const FSize&);
@ -344,7 +344,7 @@ class FWidget : public FVTerm, public FObject
virtual void hide(); virtual void hide();
virtual bool focusFirstChild(); // widget focusing virtual bool focusFirstChild(); // widget focusing
virtual bool focusLastChild(); virtual bool focusLastChild();
const FPoint termToWidgetPos (const FPoint&); const FPoint termToWidgetPos (const FPoint&) const;
void print (const FPoint&) override; void print (const FPoint&) override;
virtual void move (const FPoint&); virtual void move (const FPoint&);
virtual void drawBorder(); virtual void drawBorder();
@ -381,7 +381,7 @@ class FWidget : public FVTerm, public FObject
void initTerminal() override; void initTerminal() override;
void initDesktop(); void initDesktop();
virtual void adjustSize(); virtual void adjustSize();
void adjustSizeGlobal(); void adjustSizeGlobal() const;
void hideArea (const FSize&); void hideArea (const FSize&);
virtual bool focusNextChild(); // Change child... virtual bool focusNextChild(); // Change child...
virtual bool focusPrevChild(); // ...focus virtual bool focusPrevChild(); // ...focus
@ -465,12 +465,12 @@ class FWidget : public FVTerm, public FObject
bool changeFocus (FWidget*, FWidget*, fc::FocusTypes); bool changeFocus (FWidget*, FWidget*, fc::FocusTypes);
void processDestroy(); void processDestroy();
virtual void draw(); virtual void draw();
void drawWindows(); void drawWindows() const;
void drawChildren(); void drawChildren();
static bool isDefaultTheme(); static bool isDefaultTheme();
static void initColorTheme(); static void initColorTheme();
void destroyColorTheme(); void destroyColorTheme();
void setStatusbarText (bool); void setStatusbarText (bool) const;
// Data members // Data members
struct FWidgetFlags flags{}; struct FWidgetFlags flags{};
@ -817,11 +817,11 @@ inline const FRect& FWidget::getTermGeometryWithShadow()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FWidget::getDesktopWidth() inline std::size_t FWidget::getDesktopWidth() const
{ return FTerm::getColumnNumber(); } { return FTerm::getColumnNumber(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FWidget::getDesktopHeight() inline std::size_t FWidget::getDesktopHeight() const
{ return FTerm::getLineNumber(); } { return FTerm::getLineNumber(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -829,7 +829,7 @@ inline const FWidget::FWidgetFlags& FWidget::getFlags() const
{ return flags; } { return flags; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint FWidget::getCursorPos() inline const FPoint FWidget::getCursorPos() const
{ return widget_cursor_position; } { return widget_cursor_position; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1071,7 +1071,7 @@ inline void FWidget::delAccelerator()
{ delAccelerator(this); } { delAccelerator(this); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint FWidget::termToWidgetPos (const FPoint& tPos) inline const FPoint FWidget::termToWidgetPos (const FPoint& tPos) const
{ {
return { tPos.getX() + 1 - woffset.getX1() - adjust_wsize.getX() return { tPos.getX() + 1 - woffset.getX1() - adjust_wsize.getX()
, tPos.getY() + 1 - woffset.getY1() - adjust_wsize.getY() }; , tPos.getY() + 1 - woffset.getY1() - adjust_wsize.getY() };

View File

@ -96,7 +96,7 @@ class FWindow : public FWidget
void setWindowFocusWidget (FWidget*); void setWindowFocusWidget (FWidget*);
bool activateWindow (bool); bool activateWindow (bool);
bool activateWindow(); bool activateWindow();
void unsetActiveWindow(); void unsetActiveWindow() const;
bool deactivateWindow(); bool deactivateWindow();
virtual bool setResizeable (bool); virtual bool setResizeable (bool);
virtual bool setResizeable(); virtual bool setResizeable();