diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 6b059868..1d18c146 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -123,7 +123,7 @@ class Calc : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback method - void cb_buttonClicked (finalcut::FWidget*, data_ptr); + void cb_buttonClicked (finalcut::FWidget*, FDataPtr); private: // Typedef and Enumeration @@ -1053,7 +1053,7 @@ void Calc::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void Calc::cb_buttonClicked (finalcut::FWidget*, data_ptr data) +void Calc::cb_buttonClicked (finalcut::FWidget*, FDataPtr data) { lDouble& x = getValue(); Calc::button key = *(static_cast(data)); diff --git a/examples/checklist.cpp b/examples/checklist.cpp index 1ee56939..96c87c76 100644 --- a/examples/checklist.cpp +++ b/examples/checklist.cpp @@ -59,7 +59,7 @@ class CheckList : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback method - void cb_showList (finalcut::FWidget*, data_ptr); + void cb_showList (finalcut::FWidget*, FDataPtr); // Data Members finalcut::FListView listView{this}; @@ -160,7 +160,7 @@ void CheckList::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void CheckList::cb_showList (finalcut::FWidget*, data_ptr) +void CheckList::cb_showList (finalcut::FWidget*, FDataPtr) { auto iter = listView.beginOfList(); finalcut::FString shopping_list; diff --git a/examples/choice.cpp b/examples/choice.cpp index ad7cdfd6..db05d27f 100644 --- a/examples/choice.cpp +++ b/examples/choice.cpp @@ -27,14 +27,14 @@ typedef std::shared_ptr FRadioButtonPtr; // Function prototypes -void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); +void cb_quit (finalcut::FWidget*, FDataPtr); void populateChoice (std::vector&, finalcut::FButtonGroup&); void preset (std::vector&); //---------------------------------------------------------------------- // Callback functions //---------------------------------------------------------------------- -void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) +void cb_quit (finalcut::FWidget*, FDataPtr data) { auto dlg = static_cast(data); dlg->close(); diff --git a/examples/dialog.cpp b/examples/dialog.cpp index a10ec5d5..b0940c6b 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -23,13 +23,13 @@ #include // function prototype -void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); +void cb_quit (finalcut::FWidget*, FDataPtr); //---------------------------------------------------------------------- // callback function //---------------------------------------------------------------------- -void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) +void cb_quit (finalcut::FWidget*, FDataPtr data) { auto& app = *(static_cast(data)); app.quit(); diff --git a/examples/input-dialog.cpp b/examples/input-dialog.cpp index 292ff806..be6f9ea9 100644 --- a/examples/input-dialog.cpp +++ b/examples/input-dialog.cpp @@ -24,19 +24,19 @@ // function prototypes -void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); -void cb_publish (finalcut::FWidget*, finalcut::FWidget::data_ptr); +void cb_quit (finalcut::FWidget*, FDataPtr); +void cb_publish (finalcut::FWidget*, FDataPtr); //---------------------------------------------------------------------- // callback functions //---------------------------------------------------------------------- -void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) +void cb_quit (finalcut::FWidget*, FDataPtr data) { auto app = static_cast(data); app->quit(); } -void cb_publish (finalcut::FWidget* widget, finalcut::FWidget::data_ptr data) +void cb_publish (finalcut::FWidget* widget, FDataPtr data) { auto cbox1 = static_cast(widget); auto cbox2 = static_cast(data); diff --git a/examples/listbox.cpp b/examples/listbox.cpp index ddfb5c31..172195dc 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -35,7 +35,7 @@ static std::shared_ptr temp_str { nullptr }; // Function prototypes void doubleToItem ( FListBoxItem& - , FWidget::data_ptr container + , FDataPtr container , int index); FString& doubleToString (std::list::const_iterator iter); FString& mapToString ( std::map* double_list_ptr; double_list_ptr dbllist = static_cast(container); std::list::iterator iter = dbllist->begin(); std::advance (iter, index); item.setText (FString() << *iter); - item.setData (FWidget::data_ptr(&(*iter))); + item.setData (FDataPtr(&(*iter))); } // Import converter functions diff --git a/examples/listview.cpp b/examples/listview.cpp index e1f16598..8aa4413e 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -58,7 +58,7 @@ class Listview : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback method - void cb_showInMessagebox (finalcut::FWidget*, data_ptr); + void cb_showInMessagebox (finalcut::FWidget*, FDataPtr); // Data Members finalcut::FListView listView{this}; @@ -189,7 +189,7 @@ void Listview::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void Listview::cb_showInMessagebox (finalcut::FWidget*, data_ptr) +void Listview::cb_showInMessagebox (finalcut::FWidget*, FDataPtr) { const auto& item = listView.getCurrentItem(); finalcut::FMessageBox info ( "Weather in " + item->getText(1) diff --git a/examples/menu.cpp b/examples/menu.cpp index dde19e35..693637d8 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -60,7 +60,7 @@ class Menu : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback method - void cb_message (finalcut::FWidget*, data_ptr); + void cb_message (finalcut::FWidget*, FDataPtr); // Data Members finalcut::FString line{13, finalcut::fc::BoxDrawingsHorizontal}; @@ -302,7 +302,7 @@ void Menu::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void Menu::cb_message (finalcut::FWidget* widget, data_ptr) +void Menu::cb_message (finalcut::FWidget* widget, FDataPtr) { auto menuitem = static_cast(widget); auto text = menuitem->getText(); diff --git a/examples/mouse.cpp b/examples/mouse.cpp index a4f13506..470f9a22 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -342,7 +342,7 @@ class MouseDraw : public finalcut::FDialog virtual void onMouseMove (finalcut::FMouseEvent*); // Callback methods - void cb_colorChanged (finalcut::FWidget*, data_ptr); + void cb_colorChanged (finalcut::FWidget*, FDataPtr); // Data Members term_area* canvas{nullptr}; @@ -538,7 +538,7 @@ void MouseDraw::onMouseMove (finalcut::FMouseEvent* ev) } //---------------------------------------------------------------------- -void MouseDraw::cb_colorChanged (finalcut::FWidget*, data_ptr) +void MouseDraw::cb_colorChanged (finalcut::FWidget*, FDataPtr) { brush.setForeground (c_chooser.getForeground()); brush.setBackground (c_chooser.getBackground()); diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index 9ba2ef4d..30e790e7 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -53,10 +53,10 @@ class Scrollview : public finalcut::FScrollView virtual void draw(); // Callback methods - void cb_go_east (finalcut::FWidget*, data_ptr); - void cb_go_south (finalcut::FWidget*, data_ptr); - void cb_go_west (finalcut::FWidget*, data_ptr); - void cb_go_north (finalcut::FWidget*, data_ptr); + void cb_go_east (finalcut::FWidget*, FDataPtr); + void cb_go_south (finalcut::FWidget*, FDataPtr); + void cb_go_west (finalcut::FWidget*, FDataPtr); + void cb_go_north (finalcut::FWidget*, FDataPtr); // Data Members wchar_t pointer_right{finalcut::fc::BlackRightPointingPointer}; @@ -144,7 +144,7 @@ void Scrollview::draw() } //---------------------------------------------------------------------- -void Scrollview::cb_go_east (finalcut::FWidget*, data_ptr) +void Scrollview::cb_go_east (finalcut::FWidget*, FDataPtr) { scrollToX (int(getScrollWidth() - getViewportWidth()) + 1); go_south.setFocus(); @@ -153,7 +153,7 @@ void Scrollview::cb_go_east (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Scrollview::cb_go_south (finalcut::FWidget*, data_ptr) +void Scrollview::cb_go_south (finalcut::FWidget*, FDataPtr) { scrollToY (int(getScrollHeight() - getViewportHeight()) + 1); go_west.setFocus(); @@ -162,7 +162,7 @@ void Scrollview::cb_go_south (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Scrollview::cb_go_west (finalcut::FWidget*, data_ptr) +void Scrollview::cb_go_west (finalcut::FWidget*, FDataPtr) { scrollToX (1); go_north.setFocus(); @@ -171,7 +171,7 @@ void Scrollview::cb_go_west (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Scrollview::cb_go_north (finalcut::FWidget*, data_ptr) +void Scrollview::cb_go_north (finalcut::FWidget*, FDataPtr) { scrollToY (1); go_east.setFocus(); @@ -200,7 +200,7 @@ class Scrollviewdemo : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback method - void cb_quit (finalcut::FWidget* = nullptr, data_ptr = nullptr); + void cb_quit (finalcut::FWidget* = nullptr, FDataPtr = nullptr); // Data Members Scrollview sview{this}; @@ -242,7 +242,7 @@ Scrollviewdemo::~Scrollviewdemo() { } //---------------------------------------------------------------------- -void Scrollviewdemo::cb_quit (finalcut::FWidget*, data_ptr) +void Scrollviewdemo::cb_quit (finalcut::FWidget*, FDataPtr) { close(); } diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 7a770a5b..fdf576fa 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -52,8 +52,8 @@ class AttribDlg : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_next (finalcut::FWidget* = nullptr, data_ptr = nullptr); - void cb_back (finalcut::FWidget* = nullptr, data_ptr = nullptr); + void cb_next (finalcut::FWidget* = nullptr, FDataPtr = nullptr); + void cb_back (finalcut::FWidget* = nullptr, FDataPtr = nullptr); // Data Members FColor bgcolor; @@ -125,7 +125,7 @@ void AttribDlg::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void AttribDlg::cb_next (finalcut::FWidget*, data_ptr) +void AttribDlg::cb_next (finalcut::FWidget*, FDataPtr) { if ( isMonochron() ) return; @@ -141,7 +141,7 @@ void AttribDlg::cb_next (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void AttribDlg::cb_back (finalcut::FWidget*, data_ptr) +void AttribDlg::cb_back (finalcut::FWidget*, FDataPtr) { if ( isMonochron() ) return; diff --git a/examples/ui.cpp b/examples/ui.cpp index 2f710f6d..1447886a 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -55,9 +55,9 @@ class ProgressDialog : public finalcut::FDialog virtual void onTimer (finalcut::FTimerEvent*); // Callback methods - void cb_reset_bar (finalcut::FWidget*, data_ptr); - void cb_more_bar (finalcut::FWidget*, data_ptr); - void cb_exit_bar (finalcut::FWidget*, data_ptr); + void cb_reset_bar (finalcut::FWidget*, FDataPtr); + void cb_more_bar (finalcut::FWidget*, FDataPtr); + void cb_exit_bar (finalcut::FWidget*, FDataPtr); // Data Members finalcut::FProgressbar progressBar{this}; @@ -153,20 +153,20 @@ void ProgressDialog::onTimer (finalcut::FTimerEvent*) } //---------------------------------------------------------------------- -void ProgressDialog::cb_reset_bar (finalcut::FWidget*, data_ptr) +void ProgressDialog::cb_reset_bar (finalcut::FWidget*, FDataPtr) { progressBar.reset(); } //---------------------------------------------------------------------- -void ProgressDialog::cb_more_bar (finalcut::FWidget*, data_ptr) +void ProgressDialog::cb_more_bar (finalcut::FWidget*, FDataPtr) { auto p = progressBar.getPercentage(); progressBar.setPercentage(++p); } //---------------------------------------------------------------------- -void ProgressDialog::cb_exit_bar (finalcut::FWidget*, data_ptr) +void ProgressDialog::cb_exit_bar (finalcut::FWidget*, FDataPtr) { close(); } @@ -285,21 +285,21 @@ class MyDialog : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_noFunctionMsg (finalcut::FWidget*, data_ptr); - void cb_about (finalcut::FWidget*, data_ptr); - void cb_terminfo (finalcut::FWidget*, data_ptr); - void cb_drives (finalcut::FWidget*, data_ptr); - void cb_cutClipboard (finalcut::FWidget*, data_ptr); - void cb_copyClipboard (finalcut::FWidget*, data_ptr); - void cb_pasteClipboard (finalcut::FWidget*, data_ptr); - void cb_clearInput (finalcut::FWidget*, data_ptr); - void cb_input2buttonText (finalcut::FWidget*, data_ptr); - void cb_setTitlebar (finalcut::FWidget*, data_ptr); - void cb_ProgressBar (finalcut::FWidget*, data_ptr); - void cb_updateNumber (finalcut::FWidget*, data_ptr); - void cb_activateButton (finalcut::FWidget*, data_ptr); - void cb_view (finalcut::FWidget*, data_ptr); - void cb_setInput (finalcut::FWidget*, data_ptr); + void cb_noFunctionMsg (finalcut::FWidget*, FDataPtr); + void cb_about (finalcut::FWidget*, FDataPtr); + void cb_terminfo (finalcut::FWidget*, FDataPtr); + void cb_drives (finalcut::FWidget*, FDataPtr); + void cb_cutClipboard (finalcut::FWidget*, FDataPtr); + void cb_copyClipboard (finalcut::FWidget*, FDataPtr); + void cb_pasteClipboard (finalcut::FWidget*, FDataPtr); + void cb_clearInput (finalcut::FWidget*, FDataPtr); + void cb_input2buttonText (finalcut::FWidget*, FDataPtr); + void cb_setTitlebar (finalcut::FWidget*, FDataPtr); + void cb_ProgressBar (finalcut::FWidget*, FDataPtr); + void cb_updateNumber (finalcut::FWidget*, FDataPtr); + void cb_activateButton (finalcut::FWidget*, FDataPtr); + void cb_view (finalcut::FWidget*, FDataPtr); + void cb_setInput (finalcut::FWidget*, FDataPtr); // Data Members bool initialized{false}; @@ -442,21 +442,21 @@ void MyDialog::initFileMenuCallbacks() ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_view), - static_cast(&File1) + static_cast(&File1) ); File2.addCallback ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_view), - static_cast(&File2) + static_cast(&File2) ); File3.addCallback ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_view), - static_cast(&File3) + static_cast(&File3) ); } @@ -666,7 +666,7 @@ void MyDialog::initButtons() ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText), - static_cast(&myLineEdit) + static_cast(&myLineEdit) ); MyButton5.addCallback @@ -718,21 +718,21 @@ void MyDialog::initWidgetsCallbacks() ( "toggled", F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton), - static_cast(&MyButton5) + static_cast(&MyButton5) ); myList.addCallback ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_setInput), - static_cast(&myLineEdit) + static_cast(&myLineEdit) ); myList.addCallback ( "row-selected", F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber), - static_cast(&tagged_count) + static_cast(&tagged_count) ); } @@ -761,7 +761,7 @@ void MyDialog::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, data_ptr) +void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, FDataPtr) { auto& button = *(static_cast(widget)); auto text = button.getText(); @@ -772,7 +772,7 @@ void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_about (finalcut::FWidget*, data_ptr) +void MyDialog::cb_about (finalcut::FWidget*, FDataPtr) { constexpr char libver[] = F_VERSION; const finalcut::FString line(2, finalcut::fc::BoxDrawingsHorizontal); @@ -787,7 +787,7 @@ void MyDialog::cb_about (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr) +void MyDialog::cb_terminfo (finalcut::FWidget*, FDataPtr) { auto x = getDesktopWidth(); auto y = getDesktopHeight(); @@ -808,7 +808,7 @@ void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_drives (finalcut::FWidget*, data_ptr) +void MyDialog::cb_drives (finalcut::FWidget*, FDataPtr) { finalcut::FMessageBox info2 \ ( @@ -859,7 +859,7 @@ void MyDialog::cb_drives (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_cutClipboard (finalcut::FWidget*, data_ptr) +void MyDialog::cb_cutClipboard (finalcut::FWidget*, FDataPtr) { clipboard = myLineEdit.getText(); myLineEdit.clear(); @@ -867,20 +867,20 @@ void MyDialog::cb_cutClipboard (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_copyClipboard (finalcut::FWidget*, data_ptr) +void MyDialog::cb_copyClipboard (finalcut::FWidget*, FDataPtr) { clipboard = myLineEdit.getText(); } //---------------------------------------------------------------------- -void MyDialog::cb_pasteClipboard (finalcut::FWidget*, data_ptr) +void MyDialog::cb_pasteClipboard (finalcut::FWidget*, FDataPtr) { myLineEdit = clipboard; myLineEdit.redraw(); } //---------------------------------------------------------------------- -void MyDialog::cb_clearInput (finalcut::FWidget*, data_ptr) +void MyDialog::cb_clearInput (finalcut::FWidget*, FDataPtr) { clipboard.clear(); myLineEdit.clear(); @@ -888,7 +888,7 @@ void MyDialog::cb_clearInput (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, data_ptr data) +void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) { auto& button = *(static_cast(widget)); const auto& lineedit = *(static_cast(data)); @@ -897,7 +897,7 @@ void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr) +void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, FDataPtr) { auto& lineedit = *(static_cast(widget)); finalcut::FString title; @@ -908,14 +908,14 @@ void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_ProgressBar (finalcut::FWidget*, data_ptr) +void MyDialog::cb_ProgressBar (finalcut::FWidget*, FDataPtr) { auto p_dgl = new ProgressDialog(this); p_dgl->show(); } //---------------------------------------------------------------------- -void MyDialog::cb_updateNumber (finalcut::FWidget* widget, data_ptr data) +void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data) { auto& list = *(static_cast(widget)); auto& num = *(static_cast(data)); @@ -932,7 +932,7 @@ void MyDialog::cb_updateNumber (finalcut::FWidget* widget, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_activateButton (finalcut::FWidget* widget, data_ptr data) +void MyDialog::cb_activateButton (finalcut::FWidget* widget, FDataPtr data) { auto& rb = *(static_cast(widget)); auto& button = *(static_cast(data)); @@ -946,7 +946,7 @@ void MyDialog::cb_activateButton (finalcut::FWidget* widget, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_view (finalcut::FWidget*, data_ptr data) +void MyDialog::cb_view (finalcut::FWidget*, FDataPtr data) { finalcut::FString file; auto item = static_cast(data); @@ -984,7 +984,7 @@ void MyDialog::cb_view (finalcut::FWidget*, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_setInput (finalcut::FWidget* widget, data_ptr data) +void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) { auto& ListBox = *(static_cast(widget)); auto& lineedit = *(static_cast(data)); diff --git a/examples/watch.cpp b/examples/watch.cpp index e5c13d40..f65aeb1c 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -54,8 +54,8 @@ class Watch : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_clock (finalcut::FWidget*, data_ptr); - void cb_seconds (finalcut::FWidget*, data_ptr); + void cb_clock (finalcut::FWidget*, FDataPtr); + void cb_seconds (finalcut::FWidget*, FDataPtr); protected: // Method @@ -153,7 +153,7 @@ void Watch::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void Watch::cb_clock (finalcut::FWidget*, data_ptr) +void Watch::cb_clock (finalcut::FWidget*, FDataPtr) { if ( clock_sw.isChecked() ) { @@ -169,7 +169,7 @@ void Watch::cb_clock (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Watch::cb_seconds (finalcut::FWidget*, data_ptr) +void Watch::cb_seconds (finalcut::FWidget*, FDataPtr) { if ( seconds_sw.isChecked() ) sec = true; diff --git a/examples/windows.cpp b/examples/windows.cpp index 534f0ce2..526bd649 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -179,8 +179,8 @@ class Window : public finalcut::FDialog private: // Typedefs - typedef void (Window::*WindowCallback)(finalcut::FWidget*, data_ptr); - typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, data_ptr); + typedef void (Window::*WindowCallback)(finalcut::FWidget*, FDataPtr); + typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, FDataPtr); struct win_data { @@ -210,11 +210,11 @@ class Window : public finalcut::FDialog virtual void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_createWindows (finalcut::FWidget*, data_ptr); - void cb_closeWindows (finalcut::FWidget*, data_ptr); - void cb_next (finalcut::FWidget*, data_ptr); - void cb_previous (finalcut::FWidget*, data_ptr); - void cb_destroyWindow (finalcut::FWidget*, data_ptr); + void cb_createWindows (finalcut::FWidget*, FDataPtr); + void cb_closeWindows (finalcut::FWidget*, FDataPtr); + void cb_next (finalcut::FWidget*, FDataPtr); + void cb_previous (finalcut::FWidget*, FDataPtr); + void cb_destroyWindow (finalcut::FWidget*, FDataPtr); // Data Members std::vector windows{}; @@ -405,7 +405,7 @@ void Window::onClose (finalcut::FCloseEvent* ev) } //---------------------------------------------------------------------- -void Window::cb_createWindows (finalcut::FWidget*, data_ptr) +void Window::cb_createWindows (finalcut::FWidget*, FDataPtr) { auto first = windows.begin(); auto iter = first; @@ -435,7 +435,7 @@ void Window::cb_createWindows (finalcut::FWidget*, data_ptr) ( "destroy", F_METHOD_CALLBACK (this, &Window::cb_destroyWindow), - static_cast(win_dat) + static_cast(win_dat) ); } @@ -446,7 +446,7 @@ void Window::cb_createWindows (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_closeWindows (finalcut::FWidget*, data_ptr) +void Window::cb_closeWindows (finalcut::FWidget*, FDataPtr) { if ( ! dialog_list || dialog_list->empty() ) return; @@ -466,7 +466,7 @@ void Window::cb_closeWindows (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_next (finalcut::FWidget*, data_ptr) +void Window::cb_next (finalcut::FWidget*, FDataPtr) { if ( ! dialog_list || dialog_list->empty() ) return; @@ -502,7 +502,7 @@ void Window::cb_next (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_previous (finalcut::FWidget*, data_ptr) +void Window::cb_previous (finalcut::FWidget*, FDataPtr) { if ( ! dialog_list || dialog_list->empty() ) return; @@ -539,7 +539,7 @@ void Window::cb_previous (finalcut::FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_destroyWindow (finalcut::FWidget*, data_ptr data) +void Window::cb_destroyWindow (finalcut::FWidget*, FDataPtr data) { auto win_dat = static_cast(data); diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index bd878b22..0d08b8d1 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -381,7 +381,7 @@ void FButtonGroup::onFocusIn (FFocusEvent* in_ev) } //---------------------------------------------------------------------- -void FButtonGroup::cb_buttonToggled (FWidget* widget, data_ptr) +void FButtonGroup::cb_buttonToggled (FWidget* widget, FDataPtr) { auto button = static_cast(widget); diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 6be9436f..7d7b1c55 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -1646,7 +1646,7 @@ void FDialog::delDialog (FWidget* obj) } //---------------------------------------------------------------------- -void FDialog::cb_move (FWidget*, data_ptr) +void FDialog::cb_move (FWidget*, FDataPtr) { if ( isZoomed() ) return; @@ -1697,7 +1697,7 @@ void FDialog::cb_move (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FDialog::cb_zoom (FWidget*, data_ptr) +void FDialog::cb_zoom (FWidget*, FDataPtr) { dialog_menu->unselectItem(); dialog_menu->hide(); @@ -1708,7 +1708,7 @@ void FDialog::cb_zoom (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FDialog::cb_close (FWidget*, data_ptr) +void FDialog::cb_close (FWidget*, FDataPtr) { dialog_menu->unselectItem(); dialog_menu->hide(); diff --git a/src/fevent.cpp b/src/fevent.cpp index 21d36d83..e9edd8a0 100644 --- a/src/fevent.cpp +++ b/src/fevent.cpp @@ -369,11 +369,11 @@ int FUserEvent::getUserId() const { return uid; } //---------------------------------------------------------------------- -FUserEvent::data_ptr FUserEvent::getData() const +FDataPtr FUserEvent::getData() const { return data_pointer; } //---------------------------------------------------------------------- -void FUserEvent::setData (data_ptr data) +void FUserEvent::setData (FDataPtr data) { data_pointer = data; } } // namespace finalcut diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 48c5d55c..b111923c 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -748,7 +748,7 @@ const FString FFileDialog::getHomeDir() } //---------------------------------------------------------------------- -void FFileDialog::cb_processActivate (FWidget*, data_ptr) +void FFileDialog::cb_processActivate (FWidget*, FDataPtr) { if ( filename.getText().includes('*') || filename.getText().includes('?') ) @@ -796,7 +796,7 @@ void FFileDialog::cb_processActivate (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FFileDialog::cb_processRowChanged (FWidget*, data_ptr) +void FFileDialog::cb_processRowChanged (FWidget*, FDataPtr) { const std::size_t n = filebrowser.currentItem(); @@ -814,7 +814,7 @@ void FFileDialog::cb_processRowChanged (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FFileDialog::cb_processClicked (FWidget*, data_ptr) +void FFileDialog::cb_processClicked (FWidget*, FDataPtr) { const uLong n = uLong(filebrowser.currentItem() - 1); @@ -825,19 +825,19 @@ void FFileDialog::cb_processClicked (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FFileDialog::cb_processCancel (FWidget*, data_ptr) +void FFileDialog::cb_processCancel (FWidget*, FDataPtr) { done (FDialog::Reject); } //---------------------------------------------------------------------- -void FFileDialog::cb_processOpen (FWidget*, data_ptr) +void FFileDialog::cb_processOpen (FWidget*, FDataPtr) { done (FDialog::Accept); } //---------------------------------------------------------------------- -void FFileDialog::cb_processShowHidden (FWidget*, data_ptr) +void FFileDialog::cb_processShowHidden (FWidget*, FDataPtr) { setShowHiddenFiles(! show_hidden); } diff --git a/src/flabel.cpp b/src/flabel.cpp index 6c19272f..e9e48471 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -342,7 +342,7 @@ void FLabel::onAccel (FAccelEvent* ev) } //---------------------------------------------------------------------- -void FLabel::cb_accel_widget_destroyed (FWidget*, data_ptr) +void FLabel::cb_accel_widget_destroyed (FWidget*, FDataPtr) { accel_widget = nullptr; delAccelerator(); diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 34778dac..a9ca484b 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -48,7 +48,7 @@ FListBoxItem::FListBoxItem (const FListBoxItem& item) { } //---------------------------------------------------------------------- -FListBoxItem::FListBoxItem (const FString& txt, FWidget::data_ptr data) +FListBoxItem::FListBoxItem (const FString& txt, FDataPtr data) : text(txt) , data_pointer(data) { } @@ -264,7 +264,7 @@ void FListBox::insert (FListBoxItem listItem) void FListBox::insert ( const FString& item , fc::brackets_type b , bool s - , data_ptr d ) + , FDataPtr d ) { FListBoxItem listItem (item, d); listItem.brackets = b; @@ -276,7 +276,7 @@ void FListBox::insert ( const FString& item void FListBox::insert ( long item , fc::brackets_type b , bool s - , data_ptr d ) + , FDataPtr d ) { insert (FString() << item, b, s, d); } @@ -1846,7 +1846,7 @@ void FListBox::lazyConvert(listBoxItems::iterator iter, int y) } //---------------------------------------------------------------------- -void FListBox::cb_VBarChange (FWidget*, data_ptr) +void FListBox::cb_VBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType; std::size_t current_before = current; @@ -1913,7 +1913,7 @@ void FListBox::cb_VBarChange (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FListBox::cb_HBarChange (FWidget*, data_ptr) +void FListBox::cb_HBarChange (FWidget*, FDataPtr) { static constexpr int padding_space = 2; // 1 leading space + 1 trailing space FScrollbar::sType scrollType; diff --git a/src/flistview.cpp b/src/flistview.cpp index 9678f5ce..c092ed41 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -186,7 +186,7 @@ FListViewItem::FListViewItem (FObjectIterator parent_iter) //---------------------------------------------------------------------- FListViewItem::FListViewItem ( const FStringList& cols - , FWidget::data_ptr data + , FDataPtr data , FObjectIterator parent_iter ) : FObject(0) , column_list(cols) @@ -788,7 +788,7 @@ FObject::FObjectIterator FListView::insert ( FListViewItem* item //---------------------------------------------------------------------- FObject::FObjectIterator FListView::insert ( const FStringList& cols - , data_ptr d + , FDataPtr d , FObjectIterator parent_iter ) { FListViewItem* item; @@ -815,7 +815,7 @@ FObject::FObjectIterator FListView::insert ( const FStringList& cols //---------------------------------------------------------------------- FObject::FObjectIterator FListView::insert ( const std::vector& cols - , data_ptr d + , FDataPtr d , FObjectIterator parent_iter ) { FStringList str_cols; @@ -2504,7 +2504,7 @@ void FListView::scrollBy (int dx, int dy) } //---------------------------------------------------------------------- -void FListView::cb_VBarChange (FWidget*, data_ptr) +void FListView::cb_VBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType = vbar->getScrollType(); int distance = 1 @@ -2564,7 +2564,7 @@ void FListView::cb_VBarChange (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FListView::cb_HBarChange (FWidget*, data_ptr) +void FListView::cb_HBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType = hbar->getScrollType(); int distance = 1 diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 95411f58..a6b8dea3 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -312,7 +312,7 @@ void FMenu::onMouseMove (FMouseEvent* ev) } //---------------------------------------------------------------------- -void FMenu::cb_menuitem_toggled (FWidget* widget, data_ptr) +void FMenu::cb_menuitem_toggled (FWidget* widget, FDataPtr) { auto menuitem = static_cast(widget); diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 6b7fd56a..a6718fde 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -215,7 +215,7 @@ void FMenuBar::onAccel (FAccelEvent* ev) } //---------------------------------------------------------------------- -void FMenuBar::cb_item_deactivated (FWidget* widget, data_ptr) +void FMenuBar::cb_item_deactivated (FWidget* widget, FDataPtr) { auto menuitem = static_cast(widget); diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index 5486d1ac..559b1bb7 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -653,7 +653,7 @@ void FMenuItem::createDialogList (FMenu* winmenu) ( "clicked", F_METHOD_CALLBACK (win_item, &FMenuItem::cb_switchToDialog), - static_cast(win) + static_cast(win) ); win->addCallback @@ -716,7 +716,7 @@ void FMenuItem::passMouseEvent ( T widget, FMouseEvent* ev } //---------------------------------------------------------------------- -void FMenuItem::cb_switchToDialog (FWidget*, data_ptr data) +void FMenuItem::cb_switchToDialog (FWidget*, FDataPtr data) { auto win = static_cast(data); @@ -729,7 +729,7 @@ void FMenuItem::cb_switchToDialog (FWidget*, data_ptr data) } //---------------------------------------------------------------------- -void FMenuItem::cb_destroyDialog (FWidget* widget, data_ptr) +void FMenuItem::cb_destroyDialog (FWidget* widget, FDataPtr) { auto win = static_cast(widget); auto fapp = FApplication::getApplicationObject(); diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index 7aa96dcc..131f8055 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -189,7 +189,7 @@ void FMessageBox::adjustSize() } //---------------------------------------------------------------------- -void FMessageBox::cb_processClick (FWidget*, data_ptr data) +void FMessageBox::cb_processClick (FWidget*, FDataPtr data) { int reply = *(static_cast(data)); done (reply); @@ -281,7 +281,7 @@ inline void FMessageBox::initCallbacks() ( "clicked", F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), - static_cast(&button_digit[0]) + static_cast(&button_digit[0]) ); } @@ -291,7 +291,7 @@ inline void FMessageBox::initCallbacks() ( "clicked", F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), - static_cast(&button_digit[1]) + static_cast(&button_digit[1]) ); } @@ -301,7 +301,7 @@ inline void FMessageBox::initCallbacks() ( "clicked", F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), - static_cast(&button_digit[2]) + static_cast(&button_digit[2]) ); } } diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index ada1ed2b..2a011dd1 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -876,7 +876,7 @@ void FScrollView::setViewportCursor() } //---------------------------------------------------------------------- -void FScrollView::cb_VBarChange (FWidget*, data_ptr) +void FScrollView::cb_VBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType = vbar->getScrollType(); int distance = 1; @@ -928,7 +928,7 @@ void FScrollView::cb_VBarChange (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FScrollView::cb_HBarChange (FWidget*, data_ptr) +void FScrollView::cb_HBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType = hbar->getScrollType(); int distance = 1; diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 993d5758..17e5056b 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -479,7 +479,7 @@ void FStatusBar::onMouseMove (FMouseEvent* ev) } //---------------------------------------------------------------------- -void FStatusBar::cb_statuskey_activated (FWidget* widget, data_ptr) +void FStatusBar::cb_statuskey_activated (FWidget* widget, FDataPtr) { if ( ! key_list.empty() ) { diff --git a/src/ftextview.cpp b/src/ftextview.cpp index 3194f957..e369c3c5 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -781,7 +781,7 @@ inline void FTextView::drawVBar() } //---------------------------------------------------------------------- -void FTextView::cb_VBarChange (FWidget*, data_ptr) +void FTextView::cb_VBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType = vbar->getScrollType(); int distance = 1; @@ -837,7 +837,7 @@ void FTextView::cb_VBarChange (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void FTextView::cb_HBarChange (FWidget*, data_ptr) +void FTextView::cb_HBarChange (FWidget*, FDataPtr) { FScrollbar::sType scrollType = hbar->getScrollType(); int distance = 1; diff --git a/src/fwidget.cpp b/src/fwidget.cpp index a04c3663..f51505f9 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -826,7 +826,7 @@ bool FWidget::close() //---------------------------------------------------------------------- void FWidget::addCallback ( const FString& cb_signal , FCallback cb_handler - , data_ptr data ) + , FDataPtr data ) { // add a (normal) function pointer as callback callback_data obj = { cb_signal, cb_handler, data }; @@ -837,7 +837,7 @@ void FWidget::addCallback ( const FString& cb_signal void FWidget::addCallback ( const FString& cb_signal , FWidget* cb_instance , FMemberCallback cb_handler - , data_ptr data ) + , FDataPtr data ) { // add a member function pointer as callback member_callback_data obj = { cb_signal, cb_instance, cb_handler, data }; diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index 62e955ea..99febf82 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -124,7 +124,7 @@ class FApplication : public FWidget static void closeConfirmationDialog (FWidget*, FCloseEvent*); // Callback method - void cb_exitApp (FWidget*, FWidget::data_ptr); + void cb_exitApp (FWidget*, FDataPtr); private: // Typedefs and Enumerations @@ -206,7 +206,7 @@ inline char** FApplication::getArgv() const { return app_argv; } //---------------------------------------------------------------------- -inline void FApplication::cb_exitApp (FWidget*, FWidget::data_ptr) +inline void FApplication::cb_exitApp (FWidget*, FDataPtr) { close(); } } // namespace finalcut diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index 95b1f0c5..2b054bbb 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -117,7 +117,7 @@ class FButtonGroup : public FScrollView virtual void onFocusIn (FFocusEvent*); // Callback method - void cb_buttonToggled (FWidget*, data_ptr); + void cb_buttonToggled (FWidget*, FDataPtr); protected: // Accessor diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index 8190c61d..37f2abc3 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -217,9 +217,9 @@ class FDialog : public FWindow static void delDialog (FWidget*); // Callback methods - void cb_move (FWidget*, data_ptr); - void cb_zoom (FWidget*, data_ptr); - void cb_close (FWidget*, data_ptr); + void cb_move (FWidget*, FDataPtr); + void cb_zoom (FWidget*, FDataPtr); + void cb_close (FWidget*, FDataPtr); // Data Members FString tb_text{}; // title bar text diff --git a/src/include/final/fevent.h b/src/include/final/fevent.h index d77b4428..fb754679 100644 --- a/src/include/final/fevent.h +++ b/src/include/final/fevent.h @@ -78,6 +78,7 @@ #include "final/fc.h" #include "final/fpoint.h" +#include "final/ftypes.h" namespace finalcut { @@ -352,20 +353,17 @@ class FTimerEvent : public FEvent // timer event class FUserEvent : public FEvent // timer event { public: - // Typedef - typedef void* data_ptr; - FUserEvent() = default; FUserEvent (fc::events, int); ~FUserEvent(); int getUserId() const; - data_ptr getData() const; - void setData (data_ptr); + FDataPtr getData() const; + void setData (FDataPtr); protected: int uid; - data_ptr data_pointer{nullptr}; + FDataPtr data_pointer{nullptr}; }; #pragma pack(pop) diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index 847b8c6b..94a1ead4 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -180,12 +180,12 @@ class FFileDialog : public FDialog static const FString getHomeDir(); // Callback methods - void cb_processActivate (FWidget*, data_ptr); - void cb_processRowChanged (FWidget*, data_ptr); - void cb_processClicked (FWidget*, data_ptr); - void cb_processCancel (FWidget*, data_ptr); - void cb_processOpen (FWidget*, data_ptr); - void cb_processShowHidden (FWidget*, data_ptr); + void cb_processActivate (FWidget*, FDataPtr); + void cb_processRowChanged (FWidget*, FDataPtr); + void cb_processClicked (FWidget*, FDataPtr); + void cb_processCancel (FWidget*, FDataPtr); + void cb_processOpen (FWidget*, FDataPtr); + void cb_processShowHidden (FWidget*, FDataPtr); // Data Members DIR* directory_stream{nullptr}; diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index 0be75abc..89afe013 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -135,7 +135,7 @@ class FLabel : public FWidget virtual void onAccel (FAccelEvent*); // Callback method - void cb_accel_widget_destroyed (FWidget*, data_ptr); + void cb_accel_widget_destroyed (FWidget*, FDataPtr); private: // Constants diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index 470cb1d7..148fa219 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -75,7 +75,7 @@ class FListBoxItem // Constructors FListBoxItem (); FListBoxItem (const FListBoxItem&); // copy constructor - explicit FListBoxItem (const FString&, FWidget::data_ptr = nullptr); + explicit FListBoxItem (const FString&, FDataPtr = nullptr); // Destructor virtual ~FListBoxItem(); @@ -85,11 +85,11 @@ class FListBoxItem // Accessors virtual FString& getText(); - virtual FWidget::data_ptr getData() const; + virtual FDataPtr getData() const; // Mutators void setText (const FString&); - void setData (FWidget::data_ptr); + void setData (FDataPtr); // Methods void clear(); @@ -100,7 +100,7 @@ class FListBoxItem // Data Members FString text{}; - FWidget::data_ptr data_pointer{nullptr}; + FDataPtr data_pointer{nullptr}; fc::brackets_type brackets{fc::NoBrackets}; bool selected{false}; }; @@ -113,7 +113,7 @@ inline FString& FListBoxItem::getText() { return text; } //---------------------------------------------------------------------- -inline FWidget::data_ptr FListBoxItem::getData() const +inline FDataPtr FListBoxItem::getData() const { return data_pointer; } //---------------------------------------------------------------------- @@ -121,7 +121,7 @@ inline void FListBoxItem::setText (const FString& txt) { text = txt; } //---------------------------------------------------------------------- -inline void FListBoxItem::setData (FWidget::data_ptr data) +inline void FListBoxItem::setData (FDataPtr data) { data_pointer = data; } //---------------------------------------------------------------------- @@ -206,11 +206,11 @@ class FListBox : public FWidget void insert ( const FString& , fc::brackets_type = fc::NoBrackets , bool = false - , data_ptr = nullptr ); + , FDataPtr = nullptr ); void insert ( long , fc::brackets_type = fc::NoBrackets , bool = false - , data_ptr = nullptr ); + , FDataPtr = nullptr ); void remove (std::size_t); void clear(); @@ -296,17 +296,17 @@ class FListBox : public FWidget listBoxItems::iterator index2iterator (std::size_t); // Callback methods - void cb_VBarChange (FWidget*, data_ptr); - void cb_HBarChange (FWidget*, data_ptr); + void cb_VBarChange (FWidget*, FDataPtr); + void cb_HBarChange (FWidget*, FDataPtr); // Function Pointer void (*convertToItem) ( FListBoxItem& - , FWidget::data_ptr + , FDataPtr , int index ){nullptr}; // Data Members listBoxItems itemlist{}; - FWidget::data_ptr source_container{nullptr}; + FDataPtr source_container{nullptr}; convert_type conv_type{FListBox::no_convert}; FScrollbarPtr vbar{nullptr}; FScrollbarPtr hbar{nullptr}; diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 78ee2a5a..f020e615 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -81,7 +81,7 @@ class FListViewItem : public FObject FListViewItem (const FListViewItem&); // copy constructor explicit FListViewItem (FObjectIterator); FListViewItem ( const FStringList& - , FWidget::data_ptr + , FDataPtr , FObjectIterator ); // Destructor @@ -95,12 +95,12 @@ class FListViewItem : public FObject uInt getColumnCount() const; int getSortColumn() const; FString getText (int) const; - FWidget::data_ptr getData() const; + FDataPtr getData() const; uInt getDepth() const; // Mutators void setText (int, const FString&); - void setData (FWidget::data_ptr); + void setData (FDataPtr); void setCheckable (bool); void setChecked (bool); @@ -129,7 +129,7 @@ class FListViewItem : public FObject // Data Members FStringList column_list{}; - FWidget::data_ptr data_pointer{nullptr}; + FDataPtr data_pointer{nullptr}; FObjectIterator root{}; std::size_t visible_lines{1}; bool expandable{false}; @@ -154,11 +154,11 @@ inline uInt FListViewItem::getColumnCount() const { return uInt(column_list.size()); } //---------------------------------------------------------------------- -inline FWidget::data_ptr FListViewItem::getData() const +inline FDataPtr FListViewItem::getData() const { return data_pointer; } //---------------------------------------------------------------------- -inline void FListViewItem::setData (FWidget::data_ptr data) +inline void FListViewItem::setData (FDataPtr data) { data_pointer = data; } //---------------------------------------------------------------------- @@ -317,18 +317,18 @@ class FListView : public FWidget FObjectIterator insert (FListViewItem*); FObjectIterator insert (FListViewItem*, FObjectIterator); FObjectIterator insert ( const FStringList& - , data_ptr = nullptr ); + , FDataPtr = nullptr ); FObjectIterator insert ( const FStringList& , FObjectIterator ); FObjectIterator insert ( const FStringList& - , data_ptr + , FDataPtr , FObjectIterator ); FObjectIterator insert ( const std::vector& - , data_ptr = nullptr ); + , FDataPtr = nullptr ); FObjectIterator insert ( const std::vector& , FObjectIterator ); FObjectIterator insert ( const std::vector& - , data_ptr + , FDataPtr , FObjectIterator ); FObjectIterator beginOfList(); FObjectIterator endOfList(); @@ -419,8 +419,8 @@ class FListView : public FWidget bool hasCheckableItems() const; // Callback methods - void cb_VBarChange (FWidget*, data_ptr); - void cb_HBarChange (FWidget*, data_ptr); + void cb_VBarChange (FWidget*, FDataPtr); + void cb_HBarChange (FWidget*, FDataPtr); // Data Members FObjectIterator root{}; @@ -526,7 +526,7 @@ inline FObject::FObjectIterator FListView::insert (FListViewItem* item) //---------------------------------------------------------------------- inline FObject::FObjectIterator - FListView::insert (const FStringList& cols, data_ptr d) + FListView::insert (const FStringList& cols, FDataPtr d) { return insert (cols, d, root); } //---------------------------------------------------------------------- @@ -537,7 +537,7 @@ inline FObject::FObjectIterator //---------------------------------------------------------------------- inline FObject::FObjectIterator - FListView::insert (const std::vector& cols, data_ptr d) + FListView::insert (const std::vector& cols, FDataPtr d) { return insert (cols, d, root); } //---------------------------------------------------------------------- diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 01794232..8da190c0 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -127,7 +127,7 @@ class FMenu : public FWindow, public FMenuList virtual void onAccel (FAccelEvent*); // Callback method - void cb_menuitem_toggled (FWidget*, data_ptr); + void cb_menuitem_toggled (FWidget*, FDataPtr); private: // Constants diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index 11466cd7..f8e6c17a 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -104,7 +104,7 @@ class FMenuBar : public FWindow, public FMenuList virtual void onAccel (FAccelEvent*); // Callback methods - void cb_item_deactivated (FWidget*, data_ptr); + void cb_item_deactivated (FWidget*, FDataPtr); private: // Constants diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index c96b9a34..f3d216de 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -179,8 +179,8 @@ class FMenuItem : public FWidget void passMouseEvent (T, FMouseEvent*, fc::events); // Callback methods - void cb_switchToDialog (FWidget*, data_ptr); - void cb_destroyDialog (FWidget*, data_ptr); + void cb_switchToDialog (FWidget*, FDataPtr); + void cb_destroyDialog (FWidget*, FDataPtr); virtual void processClicked(); diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index a87ad04f..a206ac25 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -140,7 +140,7 @@ class FMessageBox : public FDialog virtual void adjustSize(); // Callback method - void cb_processClick (FWidget*, data_ptr); + void cb_processClick (FWidget*, FDataPtr); private: // Methods diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 9e375ba3..a33cb12a 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -175,8 +175,8 @@ class FScrollView : public FWidget void drawVBar(); // Callback methods - void cb_VBarChange (FWidget*, data_ptr); - void cb_HBarChange (FWidget*, data_ptr); + void cb_VBarChange (FWidget*, FDataPtr); + void cb_HBarChange (FWidget*, FDataPtr); // Data Members FRect scroll_geometry{1, 1, 1, 1}; diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index 6fa2d8b7..cdcff344 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -236,7 +236,7 @@ class FStatusBar : public FWindow virtual void onMouseMove (FMouseEvent*); // Callback method - void cb_statuskey_activated (FWidget*, data_ptr); + void cb_statuskey_activated (FWidget*, FDataPtr); private: // Typedef diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index 015335b2..d6a568b6 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -145,8 +145,8 @@ class FTextView : public FWidget void drawVBar(); // Callback methods - void cb_VBarChange (FWidget*, data_ptr); - void cb_HBarChange (FWidget*, data_ptr); + void cb_VBarChange (FWidget*, FDataPtr); + void cb_HBarChange (FWidget*, FDataPtr); // Data Members FStringList data{}; diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index 045f4867..e680d308 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -58,6 +58,7 @@ typedef long double lDouble; typedef uInt16 FColor; typedef uInt32 FKey; +typedef void* FDataPtr; } // namespace diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index a509878d..28f623be 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -138,10 +138,9 @@ class FWidget : public FVTerm, public FObject // Typedefs typedef std::vector widgetList; - typedef void* data_ptr; - typedef void (*FCallback)(FWidget*, data_ptr); - typedef void (FWidget::*FMemberCallback)(FWidget*, data_ptr); typedef std::vector Accelerators; + typedef void (*FCallback)(FWidget*, FDataPtr); + typedef void (FWidget::*FMemberCallback)(FWidget*, FDataPtr); struct widget_flags // Properties of a widget ⚑ { @@ -307,11 +306,11 @@ class FWidget : public FVTerm, public FObject void clearStatusbarMessage(); void addCallback ( const FString& , FCallback - , data_ptr = nullptr ); + , FDataPtr = nullptr ); void addCallback ( const FString& , FWidget* , FMemberCallback - , data_ptr = nullptr ); + , FDataPtr = nullptr ); void delCallback (FCallback); void delCallback (FWidget*); void delCallbacks(); @@ -347,7 +346,7 @@ class FWidget : public FVTerm, public FObject { FString cb_signal; FCallback cb_handler; - data_ptr data; + FDataPtr data; }; struct member_callback_data @@ -355,7 +354,7 @@ class FWidget : public FVTerm, public FObject FString cb_signal; FWidget* cb_instance; FMemberCallback cb_handler; - data_ptr data; + FDataPtr data; }; // Typedefs