From 07127634fdac54066cdb0dc4d4af54ff2f028b45 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 19 Jul 2020 14:15:02 +0200 Subject: [PATCH] Method name changes --- ChangeLog | 6 ++++++ doc/first-steps.md | 2 +- examples/busy.cpp | 2 +- examples/ui.cpp | 4 ++-- examples/watch.cpp | 2 +- examples/windows.cpp | 4 ++-- src/fbusyindicator.cpp | 2 +- src/fbutton.cpp | 2 +- src/flineedit.cpp | 8 ++++---- src/flistbox.cpp | 10 +++++----- src/flistview.cpp | 10 +++++----- src/fobject.cpp | 6 +++--- src/fscrollbar.cpp | 16 ++++++++-------- src/fspinbox.cpp | 12 ++++++------ src/fvterm.cpp | 2 +- src/fwidget.cpp | 8 ++++---- src/include/final/fobject.h | 4 ++-- src/include/final/fvterm.h | 2 +- src/include/final/fwidget.h | 2 +- test/fobject-test.cpp | 6 +++--- 20 files changed, 58 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29ac2690..35a3eed8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-07-19 Markus Gans + * API: Some method name changes: + FObject::delOwnTimer() -> FObject::delOwnTimers() + FObject::delAllTimer() -> FObject::delAllTimers() + FWidget::delCallbacks() -> FWidget::delAllCallbacks() + 2020-07-08 Markus Gans * New data wrapper class FData diff --git a/doc/first-steps.md b/doc/first-steps.md index dc3397e4..e42e0b11 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -549,7 +549,7 @@ void FWidget::addCallback ( const FString& cb_signal There are two macros `F_FUNCTION_CALLBACK` and `F_METHOD_CALLBACK` to avoid having to deal with necessary type conversions. With `delCallback()` you can remove a connection to a signal handler or a widget. Alternatively, you can -use `delCallbacks()` to remove all existing callbacks from an object. +use `delAllCallbacks()` to remove all existing callbacks from an object. ### The FINAL CUT widgets emit the following default signals ### diff --git a/examples/busy.cpp b/examples/busy.cpp index 8b503150..f867fd0f 100644 --- a/examples/busy.cpp +++ b/examples/busy.cpp @@ -100,7 +100,7 @@ void Dialog::adjustSize() //---------------------------------------------------------------------- void Dialog::onTimer (finalcut::FTimerEvent*) { - delOwnTimer(); + delOwnTimers(); busy_indicator.stop(); } diff --git a/examples/ui.cpp b/examples/ui.cpp index fa48153f..ca97fe9f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -126,7 +126,7 @@ ProgressDialog::ProgressDialog (finalcut::FWidget* parent) //---------------------------------------------------------------------- ProgressDialog::~ProgressDialog() // destructor { - delOwnTimer(); + delOwnTimers(); delCallback(&quit); delCallback(&more); delCallback(&reset); @@ -149,7 +149,7 @@ void ProgressDialog::onTimer (finalcut::FTimerEvent*) if ( p != 100 ) return; - delOwnTimer(); + delOwnTimers(); activateWindow(); raiseWindow(); reset.setEnable(); diff --git a/examples/watch.cpp b/examples/watch.cpp index 2048626f..53c4a43c 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -161,7 +161,7 @@ void Watch::cb_clock (const finalcut::FWidget*, const FDataPtr) } else { - delAllTimer(); // Delete all timers and stop updating the time + delAllTimers(); // Delete all timers and stop updating the time time_str = "--:--:--"; time_str.redraw(); } diff --git a/examples/windows.cpp b/examples/windows.cpp index 491c5246..27fa27b6 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -152,7 +152,7 @@ void SmallWindow::onTimer (finalcut::FTimerEvent*) bottom_label.unsetEmphasis(); bottom_label.redraw(); updateTerminal(); - delOwnTimer(); + delOwnTimers(); } @@ -277,7 +277,7 @@ Window::~Window() // Remove all callbacks before Window::cb_destroyWindow() will be called if ( win_dat->is_open && win_dat->dgl ) - win_dat->dgl->delCallbacks(); + win_dat->dgl->delAllCallbacks(); delete win_dat; iter = windows.erase(iter); diff --git a/src/fbusyindicator.cpp b/src/fbusyindicator.cpp index d46c1431..370c5975 100644 --- a/src/fbusyindicator.cpp +++ b/src/fbusyindicator.cpp @@ -56,7 +56,7 @@ void FBusyIndicator::start() //---------------------------------------------------------------------- void FBusyIndicator::stop() { - delOwnTimer(); + delOwnTimers(); running = false; hide(); updateTerminal(); diff --git a/src/fbutton.cpp b/src/fbutton.cpp index 753b2f7e..30c0c72f 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -53,7 +53,7 @@ FButton::FButton (const FString& txt, FWidget* parent) FButton::~FButton() // destructor { delAccelerator(); - delOwnTimer(); + delOwnTimers(); } // FButton operator diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 81823bee..54aa8cfa 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -405,7 +405,7 @@ void FLineEdit::onMouseUp (FMouseEvent*) { if ( drag_scroll != FLineEdit::noScroll ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = FLineEdit::noScroll; scroll_timer = false; } @@ -446,7 +446,7 @@ void FLineEdit::onMouseMove (FMouseEvent* ev) if ( text_offset == 0 ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = FLineEdit::noScroll; } } @@ -462,14 +462,14 @@ void FLineEdit::onMouseMove (FMouseEvent* ev) if ( cursor_pos == len ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = FLineEdit::noScroll; } } else { // no dragging - delOwnTimer(); + delOwnTimers(); scroll_timer = false; drag_scroll = FLineEdit::noScroll; } diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 7f4415e5..76aef6f6 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -95,7 +95,7 @@ FListBox::FListBox (FWidget* parent) //---------------------------------------------------------------------- FListBox::~FListBox() // destructor { - delOwnTimer(); + delOwnTimers(); } @@ -572,7 +572,7 @@ void FListBox::onFocusOut (FFocusEvent*) getStatusBar()->drawMessage(); } - delOwnTimer(); + delOwnTimers(); inc_search.clear(); } @@ -1306,7 +1306,7 @@ void FListBox::dragUp (int mouse_button) if ( current == 1 ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -1331,7 +1331,7 @@ void FListBox::dragDown (int mouse_button) if ( current == getCount() ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -1339,7 +1339,7 @@ void FListBox::dragDown (int mouse_button) //---------------------------------------------------------------------- void FListBox::stopDragScroll() { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; scroll_distance = 1; scroll_timer = false; diff --git a/src/flistview.cpp b/src/flistview.cpp index 4441188d..0a3cbbfc 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -691,7 +691,7 @@ FListView::FListView (FWidget* parent) //---------------------------------------------------------------------- FListView::~FListView() // destructor { - delOwnTimer(); + delOwnTimers(); } // public methods of FListView @@ -1408,7 +1408,7 @@ void FListView::onFocusOut (FFocusEvent*) getStatusBar()->drawMessage(); } - delOwnTimer(); + delOwnTimers(); } @@ -2447,7 +2447,7 @@ void FListView::dragUp (int mouse_button) if ( current_iter.getPosition() == 0 ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -2472,7 +2472,7 @@ void FListView::dragDown (int mouse_button) if ( current_iter.getPosition() - 1 == int(getCount()) ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -2480,7 +2480,7 @@ void FListView::dragDown (int mouse_button) //---------------------------------------------------------------------- void FListView::stopDragScroll() { - delOwnTimer(); + delOwnTimers(); scroll_timer = false; scroll_distance = 1; drag_scroll = fc::noScroll; diff --git a/src/fobject.cpp b/src/fobject.cpp index 3bdb4470..f10a8adc 100644 --- a/src/fobject.cpp +++ b/src/fobject.cpp @@ -72,7 +72,7 @@ FObject::FObject (FObject* parent) //---------------------------------------------------------------------- FObject::~FObject() // destructor { - delOwnTimer(); // Delete all timers of this object + delOwnTimers(); // Delete all timers of this object if ( ! has_parent && timer_list ) { @@ -333,7 +333,7 @@ bool FObject::delTimer (int id) const } //---------------------------------------------------------------------- -bool FObject::delOwnTimer() const +bool FObject::delOwnTimers() const { // Deletes all timers of this object @@ -359,7 +359,7 @@ bool FObject::delOwnTimer() const } //---------------------------------------------------------------------- -bool FObject::delAllTimer() const +bool FObject::delAllTimers() const { // Deletes all timers of all objects diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 375fb78e..361e44a7 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -55,7 +55,7 @@ FScrollbar::FScrollbar(fc::orientation o, FWidget* parent) //---------------------------------------------------------------------- FScrollbar::~FScrollbar() // destructor { - delOwnTimer(); + delOwnTimers(); } @@ -305,7 +305,7 @@ void FScrollbar::onMouseUp (FMouseEvent* ev) if ( scroll_type != FScrollbar::noScroll ) { - delOwnTimer(); + delOwnTimers(); scroll_type = FScrollbar::noScroll; } } @@ -360,7 +360,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev) if ( mouse_x < 1 || mouse_x > int(getWidth()) || mouse_y < 1 || mouse_y > int(getHeight()) ) { - delOwnTimer(); + delOwnTimers(); } else if ( scroll_type != FScrollbar::scrollJump ) { @@ -369,7 +369,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev) if ( scroll_type != new_scroll_type ) { - delOwnTimer(); + delOwnTimers(); } } @@ -380,7 +380,7 @@ void FScrollbar::onWheel (FWheelEvent* ev) if ( scroll_type != FScrollbar::noScroll ) { - delOwnTimer(); + delOwnTimers(); scroll_type = FScrollbar::noScroll; } @@ -401,7 +401,7 @@ void FScrollbar::onTimer (FTimerEvent*) if ( ! threshold_reached ) { threshold_reached = true; - delOwnTimer(); + delOwnTimers(); addTimer(repeat_time); } @@ -426,7 +426,7 @@ void FScrollbar::onTimer (FTimerEvent*) processScroll(); } - delOwnTimer(); + delOwnTimers(); return; } @@ -787,7 +787,7 @@ void FScrollbar::avoidScrollOvershoot() && slider_pos > slider_click_stop_pos ) ) { jumpToClickPos (slider_click_stop_pos); - delOwnTimer(); + delOwnTimers(); } } diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index e77edb9e..ec6fa2b3 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -235,13 +235,13 @@ void FSpinBox::onMouseDown (FMouseEvent* ev) addTimer(threshold_time); } else - delOwnTimer(); + delOwnTimers(); } //---------------------------------------------------------------------- void FSpinBox::onMouseUp (FMouseEvent*) { - delOwnTimer(); + delOwnTimers(); spining_state = FSpinBox::noSpin; } @@ -250,7 +250,7 @@ void FSpinBox::onWheel (FWheelEvent* ev) { const int wheel = ev->getWheel(); - delOwnTimer(); + delOwnTimers(); forceFocus(); spining_state = FSpinBox::noSpin; @@ -277,7 +277,7 @@ void FSpinBox::onTimer (FTimerEvent*) if ( ! threshold_reached ) { threshold_reached = true; - delOwnTimer(); + delOwnTimers(); addTimer(repeat_time); } @@ -382,7 +382,7 @@ inline void FSpinBox::increaseValue() processChanged(); } else - delOwnTimer(); + delOwnTimers(); } //---------------------------------------------------------------------- @@ -394,7 +394,7 @@ inline void FSpinBox::decreaseValue() processChanged(); } else - delOwnTimer(); + delOwnTimers(); } //---------------------------------------------------------------------- diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 0a9db678..76f9eebf 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2417,7 +2417,7 @@ inline void FVTerm::replaceNonPrintableFullwidth ( uInt x //---------------------------------------------------------------------- void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max - , FChar*& print_char) + , FChar*& print_char) const { // General character output on terminal diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 88db56fa..700e8f1d 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -101,7 +101,7 @@ FWidget::FWidget (FWidget* parent) FWidget::~FWidget() // destructor { processDestroy(); - delCallbacks(); + delAllCallbacks(); auto app_object = FApplication::getApplicationObject(); app_object->removeQueuedEvent(this); @@ -858,7 +858,7 @@ void FWidget::addCallback ( const FString& cb_signal //---------------------------------------------------------------------- void FWidget::delCallback (const FCallback& cb_function) { - // Delete cb_function form callback list + // Deletes entries with cb_function form the callback list if ( callback_objects.empty() ) return; @@ -877,7 +877,7 @@ void FWidget::delCallback (const FCallback& cb_function) //---------------------------------------------------------------------- void FWidget::delCallback (const FWidget* cb_instance) { - // Delete all member function pointer from cb_instance + // Deletes entries with cb_instance from the callback list if ( callback_objects.empty() ) return; @@ -894,7 +894,7 @@ void FWidget::delCallback (const FWidget* cb_instance) } //---------------------------------------------------------------------- -void FWidget::delCallbacks() +void FWidget::delAllCallbacks() { // Delete all callbacks from this widget diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index 39f5d82c..e4456bb8 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -125,8 +125,8 @@ class FObject static bool isTimeout (const timeval*, uInt64); int addTimer (int); bool delTimer (int) const; - bool delOwnTimer() const; - bool delAllTimer() const; + bool delOwnTimers() const; + bool delAllTimers() const; protected: struct FTimerData diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 2efeeb62..a60ee9dc 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -392,7 +392,7 @@ class FVTerm bool skipUnchangedCharacters (uInt&, uInt, uInt) const; void printRange (uInt, uInt, uInt, bool); void replaceNonPrintableFullwidth (uInt, FChar*&) const; - void printCharacter (uInt&, uInt, bool, FChar*&); + void printCharacter (uInt&, uInt, bool, FChar*&) const; void printFullWidthCharacter (uInt&, uInt, FChar*&) const; void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&) const; void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&) const; diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 3f8c0000..bee3e49e 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -332,7 +332,7 @@ class FWidget : public FVTerm, public FObject , FDataPtr = nullptr ); void delCallback (const FCallback&); void delCallback (const FWidget*); - void delCallbacks(); + void delAllCallbacks(); void emitCallback (const FString&); void addAccelerator (FKey); virtual void addAccelerator (FKey, FWidget*); diff --git a/test/fobject-test.cpp b/test/fobject-test.cpp index a9ca10ea..eb356b10 100644 --- a/test/fobject-test.cpp +++ b/test/fobject-test.cpp @@ -514,7 +514,7 @@ void FObjectTest::timerTest() CPPUNIT_ASSERT ( t1.getTimerList()->size() == 0 ); CPPUNIT_ASSERT ( ! t1.delTimer (id1) ); // id double delete - CPPUNIT_ASSERT ( ! t1.delAllTimer() ); + CPPUNIT_ASSERT ( ! t1.delAllTimers() ); t1.addTimer(250); t1.addTimer(500); @@ -524,7 +524,7 @@ void FObjectTest::timerTest() CPPUNIT_ASSERT ( t1.getTimerList()->size() == 4 ); CPPUNIT_ASSERT ( t2.getTimerList()->size() == 4 ); - t1.delOwnTimer(); + t1.delOwnTimers(); CPPUNIT_ASSERT ( t1.getTimerList()->size() == 2 ); CPPUNIT_ASSERT ( t2.getTimerList()->size() == 2 ); @@ -532,7 +532,7 @@ void FObjectTest::timerTest() CPPUNIT_ASSERT ( t1.getTimerList()->size() == 3 ); CPPUNIT_ASSERT ( t2.getTimerList()->size() == 3 ); - t2.delAllTimer(); + t2.delAllTimers(); CPPUNIT_ASSERT ( t1.getTimerList()->empty() ); CPPUNIT_ASSERT ( t2.getTimerList()->empty() ); CPPUNIT_ASSERT ( t1.getTimerList()->size() == 0 );