From d8b35dc1a7e881bcfeb4f99f4c92c93a47e9a608 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 17:00:16 +0200 Subject: [PATCH] More function declared as const --- examples/dialog.cpp | 2 +- examples/ui.cpp | 2 +- src/fapplication.cpp | 12 ++++++------ src/fcolorpalette.cpp | 2 +- src/fkeyboard.cpp | 6 +++--- src/flistview.cpp | 8 ++++---- src/flogger.cpp | 2 +- src/fmenu.cpp | 2 +- src/fmouse.cpp | 2 +- src/foptiattr.cpp | 2 +- src/foptimove.cpp | 8 ++++---- src/fscrollbar.cpp | 2 +- src/fscrollview.cpp | 2 +- src/fstring.cpp | 2 +- src/fterm.cpp | 4 ++-- src/ftermxterminal.cpp | 12 ++++++------ src/fvterm.cpp | 16 ++++++++-------- src/include/final/fapplication.h | 12 ++++++------ src/include/final/fcolorpalette.h | 2 +- src/include/final/fcombobox.h | 4 ++-- src/include/final/fkeyboard.h | 6 +++--- src/include/final/flistview.h | 8 ++++---- src/include/final/flogger.h | 2 +- src/include/final/fmenu.h | 2 +- src/include/final/fmouse.h | 10 +++++----- src/include/final/foptiattr.h | 2 +- src/include/final/foptimove.h | 8 ++++---- src/include/final/fscrollbar.h | 2 +- src/include/final/fscrollview.h | 2 +- src/include/final/fspinbox.h | 4 ++-- src/include/final/fstring.h | 2 +- src/include/final/fterm.h | 4 ++-- src/include/final/ftermxterminal.h | 12 ++++++------ src/include/final/ftextview.h | 8 ++++---- src/include/final/fvterm.h | 16 ++++++++-------- 35 files changed, 96 insertions(+), 96 deletions(-) diff --git a/examples/dialog.cpp b/examples/dialog.cpp index b65b8e82..88591909 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -34,7 +34,7 @@ void cb_quit (const finalcut::FWidget*, FDataPtr); //---------------------------------------------------------------------- void cb_quit (const finalcut::FWidget*, FDataPtr data) { - auto& app = *(static_cast(data)); + const auto& app = *(static_cast(data)); app.quit(); } diff --git a/examples/ui.cpp b/examples/ui.cpp index 9399431e..fa48153f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -942,7 +942,7 @@ void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) co //---------------------------------------------------------------------- void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, const FDataPtr) { - auto& lineedit = *(static_cast(widget)); + const auto& lineedit = *(static_cast(widget)); finalcut::FString title{}; lineedit >> title; finalcut::FTerm::setTermTitle (title); diff --git a/src/fapplication.cpp b/src/fapplication.cpp index e1519430..1cd5382c 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -613,13 +613,13 @@ void FApplication::keyPressed() } //---------------------------------------------------------------------- -void FApplication::keyReleased() +void FApplication::keyReleased() const { sendKeyUpEvent (keyboard_widget); } //---------------------------------------------------------------------- -void FApplication::escapeKeyPressed() +void FApplication::escapeKeyPressed() const { sendEscapeKeyPressEvent(); } @@ -710,7 +710,7 @@ inline bool FApplication::sendKeyUpEvent (FWidget* widget) const } //---------------------------------------------------------------------- -inline void FApplication::sendKeyboardAccelerator() +inline void FApplication::sendKeyboardAccelerator() const { if ( FWidget::getOpenMenu() ) return; @@ -738,7 +738,7 @@ inline void FApplication::sendKeyboardAccelerator() } //---------------------------------------------------------------------- -void FApplication::processKeyboardEvent() +void FApplication::processKeyboardEvent() const { if ( quit_now || app_exit_loop ) return; @@ -933,7 +933,7 @@ void FApplication::unselectMenubarItems() } //---------------------------------------------------------------------- -void FApplication::sendMouseEvent() +void FApplication::sendMouseEvent() const { auto clicked = FWidget::getClickedWidget(); @@ -1186,7 +1186,7 @@ void FApplication::processMouseEvent() } //---------------------------------------------------------------------- -void FApplication::processResizeEvent() +void FApplication::processResizeEvent() const { if ( ! FTerm::hasChangedTermSize() ) return; diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index e0e5fcf0..9eb8329c 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -48,7 +48,7 @@ void FColorPalette::setPalette (FColor index, int r, int g, int b) const } //---------------------------------------------------------------------- -void FColorPalette::setVGAdefaultPalette() +void FColorPalette::setVGAdefaultPalette() const { setPalette (fc::Black, 0x00, 0x00, 0x00); setPalette (fc::Blue, 0x00, 0x00, 0xaa); diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index 039c18bc..84fb8687 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -535,19 +535,19 @@ void FKeyboard::substringKeyHandling() } //---------------------------------------------------------------------- -void FKeyboard::keyPressed() +void FKeyboard::keyPressed() const { keypressed_cmd.execute(); } //---------------------------------------------------------------------- -void FKeyboard::keyReleased() +void FKeyboard::keyReleased() const { keyreleased_cmd.execute(); } //---------------------------------------------------------------------- -void FKeyboard::escapeKeyPressed() +void FKeyboard::escapeKeyPressed() const { escape_key_cmd.execute(); } diff --git a/src/flistview.cpp b/src/flistview.cpp index 82134c89..4441188d 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -1454,7 +1454,7 @@ void FListView::adjustViewport (const int element_count) } //---------------------------------------------------------------------- -void FListView::adjustScrollbars (const std::size_t element_count) +void FListView::adjustScrollbars (const std::size_t element_count) const { const std::size_t width = getClientWidth(); const std::size_t height = getClientHeight(); @@ -1681,7 +1681,7 @@ void FListView::drawBorder() } //---------------------------------------------------------------------- -void FListView::drawScrollbars() +void FListView::drawScrollbars() const { if ( ! hbar->isShown() && isHorizontallyScrollable() ) hbar->show(); @@ -1958,7 +1958,7 @@ inline FString FListView::getCheckBox (const FListViewItem* item) const //---------------------------------------------------------------------- inline FString FListView::getLinePrefix ( const FListViewItem* item - , std::size_t indent ) + , std::size_t indent ) const { FString line{""}; @@ -2286,7 +2286,7 @@ void FListView::recalculateHorizontalBar (std::size_t len) } //---------------------------------------------------------------------- -void FListView::recalculateVerticalBar (std::size_t element_count) +void FListView::recalculateVerticalBar (std::size_t element_count) const { const std::size_t height = getClientHeight(); const int vmax = ( element_count > height ) diff --git a/src/flogger.cpp b/src/flogger.cpp index 4e74138d..106fc849 100644 --- a/src/flogger.cpp +++ b/src/flogger.cpp @@ -69,7 +69,7 @@ const std::string FLogger::getTimeString() const } //---------------------------------------------------------------------- -const std::string FLogger::getEOL() +const std::string FLogger::getEOL() const { if ( getEnding() == FLog::LF ) return "\n"; diff --git a/src/fmenu.cpp b/src/fmenu.cpp index a6e3b767..6f467921 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -585,7 +585,7 @@ void FMenu::adjustItems() const } //---------------------------------------------------------------------- -int FMenu::adjustX (int x_pos) +int FMenu::adjustX (int x_pos) const { // Is menu outside on the right of the screen? if ( x_pos + int(max_item_width) >= int(getDesktopWidth() - 1) ) diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 5a104580..55c44629 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -476,7 +476,7 @@ bool FMouseGPM::getGpmKeyPressed (bool is_pending) } //---------------------------------------------------------------------- -void FMouseGPM::drawGpmPointer() +void FMouseGPM::drawGpmPointer() const { if ( isGpmMouseEnabled() && gpm_ev.x != -1 ) GPM_DRAWPOINTER(&gpm_ev); diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 211772a9..9f6680dd 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1545,7 +1545,7 @@ inline void FOptiAttr::resetAttribute (FChar*& attr) const } //---------------------------------------------------------------------- -inline void FOptiAttr::reset (FChar*& attr) +inline void FOptiAttr::reset (FChar*& attr) const { if ( attr ) { diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 8d45320b..92388b80 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -707,7 +707,7 @@ inline int FOptiMove::verticalMove (char move[], int from_y, int to_y) //---------------------------------------------------------------------- inline void FOptiMove::downMove ( char move[], int& vtime - , int from_y, int to_y ) + , int from_y, int to_y ) const { const int num = to_y - from_y; @@ -735,7 +735,7 @@ inline void FOptiMove::downMove ( char move[], int& vtime //---------------------------------------------------------------------- inline void FOptiMove::upMove ( char move[], int& vtime - , int from_y, int to_y ) + , int from_y, int to_y ) const { const int num = from_y - to_y; @@ -786,7 +786,7 @@ inline int FOptiMove::horizontalMove (char hmove[], int from_x, int to_x) //---------------------------------------------------------------------- inline void FOptiMove::rightMove ( char hmove[], int& htime - , int from_x, int to_x ) + , int from_x, int to_x ) const { int num = to_x - from_x; @@ -841,7 +841,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime //---------------------------------------------------------------------- inline void FOptiMove::leftMove ( char hmove[], int& htime - , int from_x, int to_x ) + , int from_x, int to_x ) const { int num = from_x - to_x; diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 43b3a004..375fb78e 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -613,7 +613,7 @@ void FScrollbar::drawButtons() } //---------------------------------------------------------------------- -FScrollbar::sType FScrollbar::getClickedScrollType (int x, int y) +FScrollbar::sType FScrollbar::getClickedScrollType (int x, int y) const { if ( bar_orientation == fc::vertical ) { diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index fb82aef3..fe0a6dae 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -846,7 +846,7 @@ void FScrollView::setVerticalScrollBarVisibility() const } //---------------------------------------------------------------------- -void FScrollView::setViewportCursor() +void FScrollView::setViewportCursor() const { if ( ! isChild(getFocusWidget()) ) return; diff --git a/src/fstring.cpp b/src/fstring.cpp index 21eb6997..1216fa32 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -776,7 +776,7 @@ const FString FString::mid (std::size_t pos, std::size_t len) const } //---------------------------------------------------------------------- -FStringList FString::split (const FString& delimiter) +FStringList FString::split (const FString& delimiter) const { const FString s{*this}; FStringList string_list{}; diff --git a/src/fterm.cpp b/src/fterm.cpp index e2ff12b2..01788721 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -2359,7 +2359,7 @@ void FTerm::init() } //---------------------------------------------------------------------- -bool FTerm::init_terminal() +bool FTerm::init_terminal() const { // Initialize termios FTermios::init(); @@ -2462,7 +2462,7 @@ void FTerm::initBaudRate() const } //---------------------------------------------------------------------- -void FTerm::finish() +void FTerm::finish() const { // Set default signal handler diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index 2a501e2f..c9093bfe 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -368,7 +368,7 @@ void FTermXTerminal::setXTermTitle() } //---------------------------------------------------------------------- -void FTermXTerminal::setXTermSize() +void FTermXTerminal::setXTermSize() const { initCheck(); @@ -572,7 +572,7 @@ inline void FTermXTerminal::setXTermDefaultsMouseCursor() } //---------------------------------------------------------------------- -inline bool FTermXTerminal::canSetXTermBackground() +inline bool FTermXTerminal::canSetXTermBackground() const { initCheck(false); @@ -691,7 +691,7 @@ void FTermXTerminal::resetXTermHighlightBackground() } //---------------------------------------------------------------------- -bool FTermXTerminal::canResetColor() +bool FTermXTerminal::canResetColor() const { initCheck(false); @@ -712,7 +712,7 @@ bool FTermXTerminal::canResetColor() } //---------------------------------------------------------------------- -void FTermXTerminal::oscPrefix() +void FTermXTerminal::oscPrefix() const { initCheck(); @@ -729,7 +729,7 @@ void FTermXTerminal::oscPrefix() } //---------------------------------------------------------------------- -void FTermXTerminal::oscPostfix() +void FTermXTerminal::oscPostfix() const { initCheck(); @@ -786,7 +786,7 @@ const FString FTermXTerminal::captureXTermFont() } //---------------------------------------------------------------------- -const FString FTermXTerminal::captureXTermTitle() +const FString FTermXTerminal::captureXTermTitle() const { initCheck(FString{}); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 94cc408c..78660d49 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -711,7 +711,7 @@ void FVTerm::createArea ( const FRect& box //---------------------------------------------------------------------- void FVTerm::resizeArea ( const FRect& box , const FSize& shadow - , FTermArea* area ) + , FTermArea* area ) const { // Resize the virtual window to a new size. @@ -854,7 +854,7 @@ void FVTerm::restoreVTerm (const FRect& box) } //---------------------------------------------------------------------- -bool FVTerm::updateVTermCursor (const FTermArea* area) +bool FVTerm::updateVTermCursor (const FTermArea* area) const { if ( ! area ) return false; @@ -1147,7 +1147,7 @@ void FVTerm::putArea (const FPoint& pos, const FTermArea* area) } //---------------------------------------------------------------------- -void FVTerm::scrollAreaForward (FTermArea* area) +void FVTerm::scrollAreaForward (FTermArea* area) const { // Scrolls the entire area up line down FChar nc{}; // next character @@ -1201,7 +1201,7 @@ void FVTerm::scrollAreaForward (FTermArea* area) } //---------------------------------------------------------------------- -void FVTerm::scrollAreaReverse (FTermArea* area) +void FVTerm::scrollAreaReverse (FTermArea* area) const { // Scrolls the entire area one line down @@ -2111,7 +2111,7 @@ void FVTerm::getAreaCharacter ( const FPoint& pos, const FTermArea* area } //---------------------------------------------------------------------- -bool FVTerm::clearTerm (int fillchar) +bool FVTerm::clearTerm (int fillchar) const { // Clear the real terminal and put cursor at home @@ -2324,7 +2324,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y) } //---------------------------------------------------------------------- -bool FVTerm::skipUnchangedCharacters(uInt& x, uInt xmax, uInt y) +bool FVTerm::skipUnchangedCharacters (uInt& x, uInt xmax, uInt y) const { // Skip characters without changes if it is faster than redrawing @@ -2860,7 +2860,7 @@ void FVTerm::updateTerminalLine (uInt y) } //---------------------------------------------------------------------- -bool FVTerm::updateTerminalCursor() +bool FVTerm::updateTerminalCursor() const { // Updates the input cursor visibility and the position if ( vterm && vterm->input_cursor_visible ) @@ -3006,7 +3006,7 @@ inline void FVTerm::appendCharacter (FChar*& next_char) } //---------------------------------------------------------------------- -inline void FVTerm::appendChar (FChar*& next_char) +inline void FVTerm::appendChar (FChar*& next_char) const { newFontChanges (next_char); charsetChanges (next_char); diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index aab0c61b..6b85dc8b 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -160,15 +160,15 @@ class FApplication : public FWidget void findKeyboardWidget() const; bool isKeyPressed() const; void keyPressed(); - void keyReleased(); - void escapeKeyPressed(); + void keyReleased() const; + void escapeKeyPressed() const; void performKeyboardAction(); void sendEscapeKeyPressEvent() const; bool sendKeyDownEvent (FWidget*) const; bool sendKeyPressEvent (FWidget*) const; bool sendKeyUpEvent (FWidget*) const; - void sendKeyboardAccelerator(); - void processKeyboardEvent(); + void sendKeyboardAccelerator() const; + void processKeyboardEvent() const; bool processDialogSwitchAccelerator() const; bool processAccelerator (const FWidget* const&) const; bool getMouseEvent() const; @@ -176,7 +176,7 @@ class FApplication : public FWidget void unsetMoveSizeMode() const; void closeDropDown(); void unselectMenubarItems(); - void sendMouseEvent(); + void sendMouseEvent() const; void sendMouseMoveEvent ( const FPoint& , const FPoint& , int ) const; @@ -192,7 +192,7 @@ class FApplication : public FWidget void sendWheelEvent (const FPoint&, const FPoint&) const; static FWidget* processParameters (const int&, char*[]); void processMouseEvent(); - void processResizeEvent(); + void processResizeEvent() const; void processCloseWidget(); void processLogger() const; bool processNextEvent(); diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index 860c40b4..606ab79c 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -67,7 +67,7 @@ class FColorPalette protected: void setPalette (FColor, int, int, int) const; - void setVGAdefaultPalette(); + void setVGAdefaultPalette() const; private: // Data members diff --git a/src/include/final/fcombobox.h b/src/include/final/fcombobox.h index 1fddc318..62e30897 100644 --- a/src/include/final/fcombobox.h +++ b/src/include/final/fcombobox.h @@ -151,7 +151,7 @@ class FComboBox : public FWidget std::size_t getCount() const; FString getText() const; FDataPtr getItemData(); - FLineEdit::label_o getLabelOrientation(); + FLineEdit::label_o getLabelOrientation() const; // Mutators void setSize (const FSize&, bool = true) override; @@ -254,7 +254,7 @@ inline FDataPtr FComboBox::getItemData() } //---------------------------------------------------------------------- -inline FLineEdit::label_o FComboBox::getLabelOrientation() +inline FLineEdit::label_o FComboBox::getLabelOrientation() const { return input_field.getLabelOrientation(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 7b4535f6..3a6b3b58 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -156,9 +156,9 @@ class FKeyboard final FKey parseKeyString(); FKey keyCorrection (const FKey&) const; void substringKeyHandling(); - void keyPressed(); - void keyReleased(); - void escapeKeyPressed(); + void keyPressed() const; + void keyReleased() const; + void escapeKeyPressed() const; // Data members FKeyboardCommand keypressed_cmd{}; diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 79fb11be..bff471ae 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -358,7 +358,7 @@ class FListView : public FWidget protected: // Methods void adjustViewport (const int); - void adjustScrollbars (const std::size_t); + void adjustScrollbars (const std::size_t) const; void adjustSize() override; private: @@ -399,14 +399,14 @@ class FListView : public FWidget iterator getListEnd (const FListViewItem*); void draw() override; void drawBorder() override; - void drawScrollbars(); + void drawScrollbars() const; void drawHeadlines(); void drawList(); void drawListLine (const FListViewItem*, bool, bool); void clearList(); void setLineAttributes (bool, bool) const; FString getCheckBox (const FListViewItem* item) const; - FString getLinePrefix (const FListViewItem*, std::size_t); + FString getLinePrefix (const FListViewItem*, std::size_t) const; void drawSortIndicator (std::size_t&, std::size_t); void drawHeadlineLabel (const headerItems::const_iterator&); void drawHeaderBorder (std::size_t); @@ -418,7 +418,7 @@ class FListView : public FWidget void beforeInsertion (FListViewItem*); void afterInsertion(); void recalculateHorizontalBar (std::size_t); - void recalculateVerticalBar (std::size_t); + void recalculateVerticalBar (std::size_t) const; void mouseHeaderClicked(); void wheelUp (int); void wheelDown (int); diff --git a/src/include/final/flogger.h b/src/include/final/flogger.h index ea00fe06..2811bc67 100644 --- a/src/include/final/flogger.h +++ b/src/include/final/flogger.h @@ -87,7 +87,7 @@ class FLogger : public FLog // Methods void newlineReplace (std::string&, const std::string&) const; const std::string getTimeString() const; - const std::string getEOL(); + const std::string getEOL() const; void printLogLine (const std::string&); // Data member diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 69516a11..34ec1418 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -176,7 +176,7 @@ class FMenu : public FWindow, public FMenuList void initCallbacks(); void calculateDimensions(); void adjustItems() const; - int adjustX(int); + int adjustX(int) const; void openSubMenu (FMenu*, bool = false); void closeOpenedSubMenu(); void hideSubMenus(); diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 5a1dc369..e182c9b7 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -234,7 +234,7 @@ class FMouseGPM final : public FMouse void interpretKeyDown(); void interpretKeyUp(); bool getGpmKeyPressed(bool); - void drawGpmPointer(); + void drawGpmPointer() const; private: // Enumeration @@ -514,8 +514,8 @@ class FMouseControl FMouse* getMouseWithData(); FMouse* getMouseWithEvent(); void xtermMouse (bool) const; - void enableXTermMouse(); - void disableXTermMouse(); + void enableXTermMouse() const; + void disableXTermMouse() const; // Data member FMouseProtocol mouse_protocol{}; @@ -530,11 +530,11 @@ inline const FString FMouseControl::getClassName() const { return "FMouseControl"; } //---------------------------------------------------------------------- -inline void FMouseControl::enableXTermMouse() +inline void FMouseControl::enableXTermMouse() const { xtermMouse(true); } //---------------------------------------------------------------------- -inline void FMouseControl::disableXTermMouse() +inline void FMouseControl::disableXTermMouse() const { xtermMouse(false); } } // namespace finalcut diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 95c38c97..d0aa7abf 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -253,7 +253,7 @@ class FOptiAttr final void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&); void change_current_color (const FChar* const&, FColor, FColor); void resetAttribute (FChar*&) const; - void reset (FChar*&); + void reset (FChar*&) const; bool caused_reset_attributes (const char[], uChar = all_tests) const; bool hasCharsetEquivalence() const; void detectSwitchOn (const FChar* const&, const FChar* const&); diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index f7068b1f..d86a0c83 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -171,11 +171,11 @@ class FOptiMove final int repeatedAppend (const capability&, volatile int, char*) const; int relativeMove (char[], int, int, int, int); int verticalMove (char[], int, int); - void downMove (char[], int&, int, int); - void upMove (char[], int&, int, int); + void downMove (char[], int&, int, int) const; + void upMove (char[], int&, int, int) const; int horizontalMove (char[], int, int); - void rightMove (char[], int&, int, int); - void leftMove (char[], int&, int, int); + void rightMove (char[], int&, int, int) const; + void leftMove (char[], int&, int, int) const; bool isWideMove (int, int, int, int) const; bool isMethod0Faster (int&, int, int); diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 3578cd70..cb24a08c 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -138,7 +138,7 @@ class FScrollbar : public FWidget void drawHorizontalBar(); void drawHorizontalBackgroundColumn(); void drawButtons(); - sType getClickedScrollType (int, int); + sType getClickedScrollType (int, int) const; sType getVerticalClickedScrollType (int) const; sType getHorizontalClickedScrollType (int) const; int getSliderClickPos (int, int) const; diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index e9d3a813..a99b3c49 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -169,7 +169,7 @@ class FScrollView : public FWidget , Callback ); void setHorizontalScrollBarVisibility() const; void setVerticalScrollBarVisibility() const; - void setViewportCursor(); + void setViewportCursor() const; // Callback methods void cb_vbarChange (const FWidget*, const FDataPtr); diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 9ed83b74..422c986c 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -82,7 +82,7 @@ class FSpinBox : public FWidget sInt64 getValue() const; FString getPrefix() const; FString getSuffix() const; - FLineEdit::label_o getLabelOrientation(); + FLineEdit::label_o getLabelOrientation() const; // Mutators void setSize (const FSize&, bool = true) override; @@ -175,7 +175,7 @@ inline FString FSpinBox::getSuffix() const { return sfix; } //---------------------------------------------------------------------- -inline FLineEdit::label_o FSpinBox::getLabelOrientation() +inline FLineEdit::label_o FSpinBox::getLabelOrientation() const { return input_field.getLabelOrientation(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index d215f799..c3c5bcf4 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -211,7 +211,7 @@ class FString const FString right (std::size_t) const; const FString mid (std::size_t, std::size_t) const; - FStringList split (const FString&); + FStringList split (const FString&) const; FString& setString (const FString&); template diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 0e1f38b5..6bb74c48 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -352,11 +352,11 @@ class FTerm final void allocationValues() const; void deallocationValues(); void init(); - bool init_terminal(); + bool init_terminal() const; void initOSspecifics() const; void initTermspecifics() const; void initBaudRate() const; - void finish(); + void finish() const; void finishOSspecifics() const; void finish_encoding() const; void destroyColorPaletteTheme(); diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index ead250de..ff3b62cb 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -114,7 +114,7 @@ class FTermXTerminal final void setXTermCursorStyle(); void setXTermFont(); void setXTermTitle(); - void setXTermSize(); + void setXTermSize() const; void setXTermForeground(); void setXTermBackground(); void setXTermCursorColor(); @@ -124,7 +124,7 @@ class FTermXTerminal final void setXTerm8ColorDefaults(); void setXTerm16ColorDefaults(); void setXTermDefaultsMouseCursor(); - bool canSetXTermBackground(); + bool canSetXTermBackground() const; void resetXTermColorMap(); void resetXTermForeground(); void resetXTermBackground(); @@ -133,11 +133,11 @@ class FTermXTerminal final void resetXTermMouseBackground(); void resetXTermHighlightBackground(); bool isInitialized() const; - bool canResetColor(); - void oscPrefix(); - void oscPostfix(); + bool canResetColor() const; + void oscPrefix() const; + void oscPostfix() const; const FString captureXTermFont(); - const FString captureXTermTitle(); + const FString captureXTermTitle() const; static void enableXTermMouse(); static void disableXTermMouse(); void enableXTermMetaSendsESC(); diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index f8d6996c..ebea7ce3 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -145,8 +145,8 @@ class FTextView : public FWidget std::size_t getTextWidth() const; // Inquiry - bool isHorizontallyScrollable(); - bool isVerticallyScrollable(); + bool isHorizontallyScrollable() const; + bool isVerticallyScrollable() const; // Methods void init(); @@ -259,11 +259,11 @@ inline void FTextView::deleteLine (int pos) { deleteRange (pos, pos); } //---------------------------------------------------------------------- -inline bool FTextView::isHorizontallyScrollable() +inline bool FTextView::isHorizontallyScrollable() const { return bool( max_line_width > getTextWidth() ); } //---------------------------------------------------------------------- -inline bool FTextView::isVerticallyScrollable() +inline bool FTextView::isVerticallyScrollable() const { return bool( getRows() > getTextHeight() ); } } // namespace finalcut diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 7b47c9a4..42ffedbe 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -301,18 +301,18 @@ class FVTerm , FTermArea*& ); void resizeArea ( const FRect& , const FSize& - , FTermArea* ); + , FTermArea* ) const; static void removeArea (FTermArea*&); static void restoreVTerm (const FRect&); - bool updateVTermCursor (const FTermArea*); + bool updateVTermCursor (const FTermArea*) const; static void setAreaCursor ( const FPoint& , bool, FTermArea* ); static void getArea (const FPoint&, const FTermArea*); static void getArea (const FRect&, const FTermArea*); void putArea (const FTermArea*); static void putArea (const FPoint&, const FTermArea*); - void scrollAreaForward (FTermArea*); - void scrollAreaReverse (FTermArea*); + void scrollAreaForward (FTermArea*) const; + void scrollAreaReverse (FTermArea*) const; void clearArea (FTermArea*, int = ' '); void processTerminalUpdate(); static void startTerminalUpdate(); @@ -383,13 +383,13 @@ class FVTerm , const FChar*, FChar* ); static void getAreaCharacter ( const FPoint&, const FTermArea* , FChar*& ); - bool clearTerm (int = ' '); + bool clearTerm (int = ' ') const; bool clearFullArea (const FTermArea*, FChar&); static void clearAreaWithShadow (const FTermArea*, const FChar&); static bool canClearToEOL (uInt, uInt); static bool canClearLeadingWS (uInt&, uInt); static bool canClearTrailingWS (uInt&, uInt); - bool skipUnchangedCharacters (uInt&, uInt, uInt); + bool skipUnchangedCharacters (uInt&, uInt, uInt) const; void printRange (uInt, uInt, uInt, bool); void replaceNonPrintableFullwidth (uInt, FChar*&) const; void printCharacter (uInt&, uInt, bool, FChar*&); @@ -405,7 +405,7 @@ class FVTerm bool printWrap (FTermArea*) const; void printPaddingCharacter (FTermArea*, const FChar&); void updateTerminalLine (uInt); - bool updateTerminalCursor(); + bool updateTerminalCursor() const; bool isInsideTerminal (const FPoint&) const; bool isTermSizeChanged() const; static void markAsPrinted (uInt, uInt); @@ -413,7 +413,7 @@ class FVTerm static void newFontChanges (FChar*&); static void charsetChanges (FChar*&); void appendCharacter (FChar*&); - void appendChar (FChar*&); + void appendChar (FChar*&) const; void appendAttributes (FChar*&) const; int appendLowerRight (FChar*&); static void characterFilter (FChar*&);