Global use of FDataPtr for void*

This commit is contained in:
Markus Gans 2018-12-27 00:14:46 +01:00
parent 2a06915f1c
commit 831e9fe05e
46 changed files with 194 additions and 196 deletions

View File

@ -123,7 +123,7 @@ class Calc : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback method // Callback method
void cb_buttonClicked (finalcut::FWidget*, data_ptr); void cb_buttonClicked (finalcut::FWidget*, FDataPtr);
private: private:
// Typedef and Enumeration // 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(); lDouble& x = getValue();
Calc::button key = *(static_cast<Calc::button*>(data)); Calc::button key = *(static_cast<Calc::button*>(data));

View File

@ -59,7 +59,7 @@ class CheckList : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback method // Callback method
void cb_showList (finalcut::FWidget*, data_ptr); void cb_showList (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
finalcut::FListView listView{this}; 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(); auto iter = listView.beginOfList();
finalcut::FString shopping_list; finalcut::FString shopping_list;

View File

@ -27,14 +27,14 @@
typedef std::shared_ptr<finalcut::FRadioButton> FRadioButtonPtr; typedef std::shared_ptr<finalcut::FRadioButton> FRadioButtonPtr;
// Function prototypes // Function prototypes
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); void cb_quit (finalcut::FWidget*, FDataPtr);
void populateChoice (std::vector<FRadioButtonPtr>&, finalcut::FButtonGroup&); void populateChoice (std::vector<FRadioButtonPtr>&, finalcut::FButtonGroup&);
void preset (std::vector<FRadioButtonPtr>&); void preset (std::vector<FRadioButtonPtr>&);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Callback functions // Callback functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) void cb_quit (finalcut::FWidget*, FDataPtr data)
{ {
auto dlg = static_cast<finalcut::FDialog*>(data); auto dlg = static_cast<finalcut::FDialog*>(data);
dlg->close(); dlg->close();

View File

@ -23,13 +23,13 @@
#include <final/final.h> #include <final/final.h>
// function prototype // function prototype
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); void cb_quit (finalcut::FWidget*, FDataPtr);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// callback function // callback function
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) void cb_quit (finalcut::FWidget*, FDataPtr data)
{ {
auto& app = *(static_cast<finalcut::FApplication*>(data)); auto& app = *(static_cast<finalcut::FApplication*>(data));
app.quit(); app.quit();

View File

@ -24,19 +24,19 @@
// function prototypes // function prototypes
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); void cb_quit (finalcut::FWidget*, FDataPtr);
void cb_publish (finalcut::FWidget*, finalcut::FWidget::data_ptr); void cb_publish (finalcut::FWidget*, FDataPtr);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// callback functions // callback functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) void cb_quit (finalcut::FWidget*, FDataPtr data)
{ {
auto app = static_cast<finalcut::FApplication*>(data); auto app = static_cast<finalcut::FApplication*>(data);
app->quit(); 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<finalcut::FCheckBox*>(widget); auto cbox1 = static_cast<finalcut::FCheckBox*>(widget);
auto cbox2 = static_cast<finalcut::FCheckBox*>(data); auto cbox2 = static_cast<finalcut::FCheckBox*>(data);

View File

@ -35,7 +35,7 @@ static std::shared_ptr<FString> temp_str { nullptr };
// Function prototypes // Function prototypes
void doubleToItem ( FListBoxItem& void doubleToItem ( FListBoxItem&
, FWidget::data_ptr container , FDataPtr container
, int index); , int index);
FString& doubleToString (std::list<double>::const_iterator iter); FString& doubleToString (std::list<double>::const_iterator iter);
FString& mapToString ( std::map<FString FString& mapToString ( std::map<FString
@ -44,14 +44,14 @@ FString& mapToString ( std::map<FString
// Lazy conversion import function // Lazy conversion import function
void doubleToItem ( FListBoxItem& item void doubleToItem ( FListBoxItem& item
, FWidget::data_ptr container, int index) , FDataPtr container, int index)
{ {
typedef std::list<double>* double_list_ptr; typedef std::list<double>* double_list_ptr;
double_list_ptr dbllist = static_cast<double_list_ptr>(container); double_list_ptr dbllist = static_cast<double_list_ptr>(container);
std::list<double>::iterator iter = dbllist->begin(); std::list<double>::iterator iter = dbllist->begin();
std::advance (iter, index); std::advance (iter, index);
item.setText (FString() << *iter); item.setText (FString() << *iter);
item.setData (FWidget::data_ptr(&(*iter))); item.setData (FDataPtr(&(*iter)));
} }
// Import converter functions // Import converter functions

View File

@ -58,7 +58,7 @@ class Listview : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback method // Callback method
void cb_showInMessagebox (finalcut::FWidget*, data_ptr); void cb_showInMessagebox (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
finalcut::FListView listView{this}; 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(); const auto& item = listView.getCurrentItem();
finalcut::FMessageBox info ( "Weather in " + item->getText(1) finalcut::FMessageBox info ( "Weather in " + item->getText(1)

View File

@ -60,7 +60,7 @@ class Menu : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback method // Callback method
void cb_message (finalcut::FWidget*, data_ptr); void cb_message (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
finalcut::FString line{13, finalcut::fc::BoxDrawingsHorizontal}; 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<finalcut::FMenuItem*>(widget); auto menuitem = static_cast<finalcut::FMenuItem*>(widget);
auto text = menuitem->getText(); auto text = menuitem->getText();

View File

@ -342,7 +342,7 @@ class MouseDraw : public finalcut::FDialog
virtual void onMouseMove (finalcut::FMouseEvent*); virtual void onMouseMove (finalcut::FMouseEvent*);
// Callback methods // Callback methods
void cb_colorChanged (finalcut::FWidget*, data_ptr); void cb_colorChanged (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
term_area* canvas{nullptr}; 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.setForeground (c_chooser.getForeground());
brush.setBackground (c_chooser.getBackground()); brush.setBackground (c_chooser.getBackground());

View File

@ -53,10 +53,10 @@ class Scrollview : public finalcut::FScrollView
virtual void draw(); virtual void draw();
// Callback methods // Callback methods
void cb_go_east (finalcut::FWidget*, data_ptr); void cb_go_east (finalcut::FWidget*, FDataPtr);
void cb_go_south (finalcut::FWidget*, data_ptr); void cb_go_south (finalcut::FWidget*, FDataPtr);
void cb_go_west (finalcut::FWidget*, data_ptr); void cb_go_west (finalcut::FWidget*, FDataPtr);
void cb_go_north (finalcut::FWidget*, data_ptr); void cb_go_north (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
wchar_t pointer_right{finalcut::fc::BlackRightPointingPointer}; 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); scrollToX (int(getScrollWidth() - getViewportWidth()) + 1);
go_south.setFocus(); 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); scrollToY (int(getScrollHeight() - getViewportHeight()) + 1);
go_west.setFocus(); 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); scrollToX (1);
go_north.setFocus(); 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); scrollToY (1);
go_east.setFocus(); go_east.setFocus();
@ -200,7 +200,7 @@ class Scrollviewdemo : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback method // Callback method
void cb_quit (finalcut::FWidget* = nullptr, data_ptr = nullptr); void cb_quit (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
// Data Members // Data Members
Scrollview sview{this}; 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(); close();
} }

View File

@ -52,8 +52,8 @@ class AttribDlg : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback methods // Callback methods
void cb_next (finalcut::FWidget* = nullptr, data_ptr = nullptr); void cb_next (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
void cb_back (finalcut::FWidget* = nullptr, data_ptr = nullptr); void cb_back (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
// Data Members // Data Members
FColor bgcolor; 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() ) if ( isMonochron() )
return; 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() ) if ( isMonochron() )
return; return;

View File

@ -55,9 +55,9 @@ class ProgressDialog : public finalcut::FDialog
virtual void onTimer (finalcut::FTimerEvent*); virtual void onTimer (finalcut::FTimerEvent*);
// Callback methods // Callback methods
void cb_reset_bar (finalcut::FWidget*, data_ptr); void cb_reset_bar (finalcut::FWidget*, FDataPtr);
void cb_more_bar (finalcut::FWidget*, data_ptr); void cb_more_bar (finalcut::FWidget*, FDataPtr);
void cb_exit_bar (finalcut::FWidget*, data_ptr); void cb_exit_bar (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
finalcut::FProgressbar progressBar{this}; 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(); progressBar.reset();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void ProgressDialog::cb_more_bar (finalcut::FWidget*, data_ptr) void ProgressDialog::cb_more_bar (finalcut::FWidget*, FDataPtr)
{ {
auto p = progressBar.getPercentage(); auto p = progressBar.getPercentage();
progressBar.setPercentage(++p); progressBar.setPercentage(++p);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void ProgressDialog::cb_exit_bar (finalcut::FWidget*, data_ptr) void ProgressDialog::cb_exit_bar (finalcut::FWidget*, FDataPtr)
{ {
close(); close();
} }
@ -285,21 +285,21 @@ class MyDialog : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback methods // Callback methods
void cb_noFunctionMsg (finalcut::FWidget*, data_ptr); void cb_noFunctionMsg (finalcut::FWidget*, FDataPtr);
void cb_about (finalcut::FWidget*, data_ptr); void cb_about (finalcut::FWidget*, FDataPtr);
void cb_terminfo (finalcut::FWidget*, data_ptr); void cb_terminfo (finalcut::FWidget*, FDataPtr);
void cb_drives (finalcut::FWidget*, data_ptr); void cb_drives (finalcut::FWidget*, FDataPtr);
void cb_cutClipboard (finalcut::FWidget*, data_ptr); void cb_cutClipboard (finalcut::FWidget*, FDataPtr);
void cb_copyClipboard (finalcut::FWidget*, data_ptr); void cb_copyClipboard (finalcut::FWidget*, FDataPtr);
void cb_pasteClipboard (finalcut::FWidget*, data_ptr); void cb_pasteClipboard (finalcut::FWidget*, FDataPtr);
void cb_clearInput (finalcut::FWidget*, data_ptr); void cb_clearInput (finalcut::FWidget*, FDataPtr);
void cb_input2buttonText (finalcut::FWidget*, data_ptr); void cb_input2buttonText (finalcut::FWidget*, FDataPtr);
void cb_setTitlebar (finalcut::FWidget*, data_ptr); void cb_setTitlebar (finalcut::FWidget*, FDataPtr);
void cb_ProgressBar (finalcut::FWidget*, data_ptr); void cb_ProgressBar (finalcut::FWidget*, FDataPtr);
void cb_updateNumber (finalcut::FWidget*, data_ptr); void cb_updateNumber (finalcut::FWidget*, FDataPtr);
void cb_activateButton (finalcut::FWidget*, data_ptr); void cb_activateButton (finalcut::FWidget*, FDataPtr);
void cb_view (finalcut::FWidget*, data_ptr); void cb_view (finalcut::FWidget*, FDataPtr);
void cb_setInput (finalcut::FWidget*, data_ptr); void cb_setInput (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
bool initialized{false}; bool initialized{false};
@ -442,21 +442,21 @@ void MyDialog::initFileMenuCallbacks()
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_view), F_METHOD_CALLBACK (this, &MyDialog::cb_view),
static_cast<finalcut::FWidget::data_ptr>(&File1) static_cast<FDataPtr>(&File1)
); );
File2.addCallback File2.addCallback
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_view), F_METHOD_CALLBACK (this, &MyDialog::cb_view),
static_cast<finalcut::FWidget::data_ptr>(&File2) static_cast<FDataPtr>(&File2)
); );
File3.addCallback File3.addCallback
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_view), F_METHOD_CALLBACK (this, &MyDialog::cb_view),
static_cast<finalcut::FWidget::data_ptr>(&File3) static_cast<FDataPtr>(&File3)
); );
} }
@ -666,7 +666,7 @@ void MyDialog::initButtons()
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText), F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText),
static_cast<finalcut::FWidget::data_ptr>(&myLineEdit) static_cast<FDataPtr>(&myLineEdit)
); );
MyButton5.addCallback MyButton5.addCallback
@ -718,21 +718,21 @@ void MyDialog::initWidgetsCallbacks()
( (
"toggled", "toggled",
F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton), F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton),
static_cast<finalcut::FWidget::data_ptr>(&MyButton5) static_cast<FDataPtr>(&MyButton5)
); );
myList.addCallback myList.addCallback
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_setInput), F_METHOD_CALLBACK (this, &MyDialog::cb_setInput),
static_cast<finalcut::FWidget::data_ptr>(&myLineEdit) static_cast<FDataPtr>(&myLineEdit)
); );
myList.addCallback myList.addCallback
( (
"row-selected", "row-selected",
F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber), F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber),
static_cast<finalcut::FWidget::data_ptr>(&tagged_count) static_cast<FDataPtr>(&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<finalcut::FButton*>(widget)); auto& button = *(static_cast<finalcut::FButton*>(widget));
auto text = button.getText(); 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; constexpr char libver[] = F_VERSION;
const finalcut::FString line(2, finalcut::fc::BoxDrawingsHorizontal); 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 x = getDesktopWidth();
auto y = getDesktopHeight(); 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 \ 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(); clipboard = myLineEdit.getText();
myLineEdit.clear(); 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(); clipboard = myLineEdit.getText();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_pasteClipboard (finalcut::FWidget*, data_ptr) void MyDialog::cb_pasteClipboard (finalcut::FWidget*, FDataPtr)
{ {
myLineEdit = clipboard; myLineEdit = clipboard;
myLineEdit.redraw(); myLineEdit.redraw();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::cb_clearInput (finalcut::FWidget*, data_ptr) void MyDialog::cb_clearInput (finalcut::FWidget*, FDataPtr)
{ {
clipboard.clear(); clipboard.clear();
myLineEdit.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<finalcut::FButton*>(widget)); auto& button = *(static_cast<finalcut::FButton*>(widget));
const auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data)); const auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data));
@ -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<finalcut::FLineEdit*>(widget)); auto& lineedit = *(static_cast<finalcut::FLineEdit*>(widget));
finalcut::FString title; 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); auto p_dgl = new ProgressDialog(this);
p_dgl->show(); 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<finalcut::FListBox*>(widget)); auto& list = *(static_cast<finalcut::FListBox*>(widget));
auto& num = *(static_cast<finalcut::FLabel*>(data)); auto& num = *(static_cast<finalcut::FLabel*>(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<finalcut::FRadioButton*>(widget)); auto& rb = *(static_cast<finalcut::FRadioButton*>(widget));
auto& button = *(static_cast<finalcut::FButton*>(data)); auto& button = *(static_cast<finalcut::FButton*>(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; finalcut::FString file;
auto item = static_cast<finalcut::FMenuItem*>(data); auto item = static_cast<finalcut::FMenuItem*>(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<finalcut::FListBox*>(widget)); auto& ListBox = *(static_cast<finalcut::FListBox*>(widget));
auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data)); auto& lineedit = *(static_cast<finalcut::FLineEdit*>(data));

View File

@ -54,8 +54,8 @@ class Watch : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback methods // Callback methods
void cb_clock (finalcut::FWidget*, data_ptr); void cb_clock (finalcut::FWidget*, FDataPtr);
void cb_seconds (finalcut::FWidget*, data_ptr); void cb_seconds (finalcut::FWidget*, FDataPtr);
protected: protected:
// Method // 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() ) 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() ) if ( seconds_sw.isChecked() )
sec = true; sec = true;

View File

@ -179,8 +179,8 @@ class Window : public finalcut::FDialog
private: private:
// Typedefs // Typedefs
typedef void (Window::*WindowCallback)(finalcut::FWidget*, data_ptr); typedef void (Window::*WindowCallback)(finalcut::FWidget*, FDataPtr);
typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, data_ptr); typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, FDataPtr);
struct win_data struct win_data
{ {
@ -210,11 +210,11 @@ class Window : public finalcut::FDialog
virtual void onClose (finalcut::FCloseEvent*); virtual void onClose (finalcut::FCloseEvent*);
// Callback methods // Callback methods
void cb_createWindows (finalcut::FWidget*, data_ptr); void cb_createWindows (finalcut::FWidget*, FDataPtr);
void cb_closeWindows (finalcut::FWidget*, data_ptr); void cb_closeWindows (finalcut::FWidget*, FDataPtr);
void cb_next (finalcut::FWidget*, data_ptr); void cb_next (finalcut::FWidget*, FDataPtr);
void cb_previous (finalcut::FWidget*, data_ptr); void cb_previous (finalcut::FWidget*, FDataPtr);
void cb_destroyWindow (finalcut::FWidget*, data_ptr); void cb_destroyWindow (finalcut::FWidget*, FDataPtr);
// Data Members // Data Members
std::vector<win_data*> windows{}; std::vector<win_data*> 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 first = windows.begin();
auto iter = first; auto iter = first;
@ -435,7 +435,7 @@ void Window::cb_createWindows (finalcut::FWidget*, data_ptr)
( (
"destroy", "destroy",
F_METHOD_CALLBACK (this, &Window::cb_destroyWindow), F_METHOD_CALLBACK (this, &Window::cb_destroyWindow),
static_cast<finalcut::FWidget::data_ptr>(win_dat) static_cast<FDataPtr>(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() ) if ( ! dialog_list || dialog_list->empty() )
return; 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() ) if ( ! dialog_list || dialog_list->empty() )
return; 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() ) if ( ! dialog_list || dialog_list->empty() )
return; 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<win_data*>(data); auto win_dat = static_cast<win_data*>(data);

View File

@ -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<FToggleButton*>(widget); auto button = static_cast<FToggleButton*>(widget);

View File

@ -1646,7 +1646,7 @@ void FDialog::delDialog (FWidget* obj)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FDialog::cb_move (FWidget*, data_ptr) void FDialog::cb_move (FWidget*, FDataPtr)
{ {
if ( isZoomed() ) if ( isZoomed() )
return; 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->unselectItem();
dialog_menu->hide(); 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->unselectItem();
dialog_menu->hide(); dialog_menu->hide();

View File

@ -369,11 +369,11 @@ int FUserEvent::getUserId() const
{ return uid; } { return uid; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FUserEvent::data_ptr FUserEvent::getData() const FDataPtr FUserEvent::getData() const
{ return data_pointer; } { return data_pointer; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FUserEvent::setData (data_ptr data) void FUserEvent::setData (FDataPtr data)
{ data_pointer = data; } { data_pointer = data; }
} // namespace finalcut } // namespace finalcut

View File

@ -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('*') if ( filename.getText().includes('*')
|| 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(); 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); 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); done (FDialog::Reject);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FFileDialog::cb_processOpen (FWidget*, data_ptr) void FFileDialog::cb_processOpen (FWidget*, FDataPtr)
{ {
done (FDialog::Accept); done (FDialog::Accept);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FFileDialog::cb_processShowHidden (FWidget*, data_ptr) void FFileDialog::cb_processShowHidden (FWidget*, FDataPtr)
{ {
setShowHiddenFiles(! show_hidden); setShowHiddenFiles(! show_hidden);
} }

View File

@ -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; accel_widget = nullptr;
delAccelerator(); delAccelerator();

View File

@ -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) : text(txt)
, data_pointer(data) , data_pointer(data)
{ } { }
@ -264,7 +264,7 @@ void FListBox::insert (FListBoxItem listItem)
void FListBox::insert ( const FString& item void FListBox::insert ( const FString& item
, fc::brackets_type b , fc::brackets_type b
, bool s , bool s
, data_ptr d ) , FDataPtr d )
{ {
FListBoxItem listItem (item, d); FListBoxItem listItem (item, d);
listItem.brackets = b; listItem.brackets = b;
@ -276,7 +276,7 @@ void FListBox::insert ( const FString& item
void FListBox::insert ( long item void FListBox::insert ( long item
, fc::brackets_type b , fc::brackets_type b
, bool s , bool s
, data_ptr d ) , FDataPtr d )
{ {
insert (FString() << item, b, s, 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; FScrollbar::sType scrollType;
std::size_t current_before = current; 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 static constexpr int padding_space = 2; // 1 leading space + 1 trailing space
FScrollbar::sType scrollType; FScrollbar::sType scrollType;

View File

@ -186,7 +186,7 @@ FListViewItem::FListViewItem (FObjectIterator parent_iter)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FListViewItem::FListViewItem ( const FStringList& cols FListViewItem::FListViewItem ( const FStringList& cols
, FWidget::data_ptr data , FDataPtr data
, FObjectIterator parent_iter ) , FObjectIterator parent_iter )
: FObject(0) : FObject(0)
, column_list(cols) , column_list(cols)
@ -788,7 +788,7 @@ FObject::FObjectIterator FListView::insert ( FListViewItem* item
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FObject::FObjectIterator FListView::insert ( const FStringList& cols FObject::FObjectIterator FListView::insert ( const FStringList& cols
, data_ptr d , FDataPtr d
, FObjectIterator parent_iter ) , FObjectIterator parent_iter )
{ {
FListViewItem* item; FListViewItem* item;
@ -815,7 +815,7 @@ FObject::FObjectIterator FListView::insert ( const FStringList& cols
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FObject::FObjectIterator FListView::insert ( const std::vector<long>& cols FObject::FObjectIterator FListView::insert ( const std::vector<long>& cols
, data_ptr d , FDataPtr d
, FObjectIterator parent_iter ) , FObjectIterator parent_iter )
{ {
FStringList str_cols; 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(); FScrollbar::sType scrollType = vbar->getScrollType();
int distance = 1 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(); FScrollbar::sType scrollType = hbar->getScrollType();
int distance = 1 int distance = 1

View File

@ -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<FMenuItem*>(widget); auto menuitem = static_cast<FMenuItem*>(widget);

View File

@ -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<FMenuItem*>(widget); auto menuitem = static_cast<FMenuItem*>(widget);

View File

@ -653,7 +653,7 @@ void FMenuItem::createDialogList (FMenu* winmenu)
( (
"clicked", "clicked",
F_METHOD_CALLBACK (win_item, &FMenuItem::cb_switchToDialog), F_METHOD_CALLBACK (win_item, &FMenuItem::cb_switchToDialog),
static_cast<FWidget::data_ptr>(win) static_cast<FDataPtr>(win)
); );
win->addCallback 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<FDialog*>(data); auto win = static_cast<FDialog*>(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<FDialog*>(widget); auto win = static_cast<FDialog*>(widget);
auto fapp = FApplication::getApplicationObject(); auto fapp = FApplication::getApplicationObject();

View File

@ -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<int*>(data)); int reply = *(static_cast<int*>(data));
done (reply); done (reply);
@ -281,7 +281,7 @@ inline void FMessageBox::initCallbacks()
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick),
static_cast<FWidget::data_ptr>(&button_digit[0]) static_cast<FDataPtr>(&button_digit[0])
); );
} }
@ -291,7 +291,7 @@ inline void FMessageBox::initCallbacks()
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick),
static_cast<FWidget::data_ptr>(&button_digit[1]) static_cast<FDataPtr>(&button_digit[1])
); );
} }
@ -301,7 +301,7 @@ inline void FMessageBox::initCallbacks()
( (
"clicked", "clicked",
F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick),
static_cast<FWidget::data_ptr>(&button_digit[2]) static_cast<FDataPtr>(&button_digit[2])
); );
} }
} }

View File

@ -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(); FScrollbar::sType scrollType = vbar->getScrollType();
int distance = 1; 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(); FScrollbar::sType scrollType = hbar->getScrollType();
int distance = 1; int distance = 1;

View File

@ -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() ) if ( ! key_list.empty() )
{ {

View File

@ -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(); FScrollbar::sType scrollType = vbar->getScrollType();
int distance = 1; 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(); FScrollbar::sType scrollType = hbar->getScrollType();
int distance = 1; int distance = 1;

View File

@ -826,7 +826,7 @@ bool FWidget::close()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::addCallback ( const FString& cb_signal void FWidget::addCallback ( const FString& cb_signal
, FCallback cb_handler , FCallback cb_handler
, data_ptr data ) , FDataPtr data )
{ {
// add a (normal) function pointer as callback // add a (normal) function pointer as callback
callback_data obj = { cb_signal, cb_handler, data }; 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 void FWidget::addCallback ( const FString& cb_signal
, FWidget* cb_instance , FWidget* cb_instance
, FMemberCallback cb_handler , FMemberCallback cb_handler
, data_ptr data ) , FDataPtr data )
{ {
// add a member function pointer as callback // add a member function pointer as callback
member_callback_data obj = { cb_signal, cb_instance, cb_handler, data }; member_callback_data obj = { cb_signal, cb_instance, cb_handler, data };

View File

@ -124,7 +124,7 @@ class FApplication : public FWidget
static void closeConfirmationDialog (FWidget*, FCloseEvent*); static void closeConfirmationDialog (FWidget*, FCloseEvent*);
// Callback method // Callback method
void cb_exitApp (FWidget*, FWidget::data_ptr); void cb_exitApp (FWidget*, FDataPtr);
private: private:
// Typedefs and Enumerations // Typedefs and Enumerations
@ -206,7 +206,7 @@ inline char** FApplication::getArgv() const
{ return app_argv; } { return app_argv; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FApplication::cb_exitApp (FWidget*, FWidget::data_ptr) inline void FApplication::cb_exitApp (FWidget*, FDataPtr)
{ close(); } { close(); }
} // namespace finalcut } // namespace finalcut

View File

@ -117,7 +117,7 @@ class FButtonGroup : public FScrollView
virtual void onFocusIn (FFocusEvent*); virtual void onFocusIn (FFocusEvent*);
// Callback method // Callback method
void cb_buttonToggled (FWidget*, data_ptr); void cb_buttonToggled (FWidget*, FDataPtr);
protected: protected:
// Accessor // Accessor

View File

@ -217,9 +217,9 @@ class FDialog : public FWindow
static void delDialog (FWidget*); static void delDialog (FWidget*);
// Callback methods // Callback methods
void cb_move (FWidget*, data_ptr); void cb_move (FWidget*, FDataPtr);
void cb_zoom (FWidget*, data_ptr); void cb_zoom (FWidget*, FDataPtr);
void cb_close (FWidget*, data_ptr); void cb_close (FWidget*, FDataPtr);
// Data Members // Data Members
FString tb_text{}; // title bar text FString tb_text{}; // title bar text

View File

@ -78,6 +78,7 @@
#include "final/fc.h" #include "final/fc.h"
#include "final/fpoint.h" #include "final/fpoint.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {
@ -352,20 +353,17 @@ class FTimerEvent : public FEvent // timer event
class FUserEvent : public FEvent // timer event class FUserEvent : public FEvent // timer event
{ {
public: public:
// Typedef
typedef void* data_ptr;
FUserEvent() = default; FUserEvent() = default;
FUserEvent (fc::events, int); FUserEvent (fc::events, int);
~FUserEvent(); ~FUserEvent();
int getUserId() const; int getUserId() const;
data_ptr getData() const; FDataPtr getData() const;
void setData (data_ptr); void setData (FDataPtr);
protected: protected:
int uid; int uid;
data_ptr data_pointer{nullptr}; FDataPtr data_pointer{nullptr};
}; };
#pragma pack(pop) #pragma pack(pop)

View File

@ -180,12 +180,12 @@ class FFileDialog : public FDialog
static const FString getHomeDir(); static const FString getHomeDir();
// Callback methods // Callback methods
void cb_processActivate (FWidget*, data_ptr); void cb_processActivate (FWidget*, FDataPtr);
void cb_processRowChanged (FWidget*, data_ptr); void cb_processRowChanged (FWidget*, FDataPtr);
void cb_processClicked (FWidget*, data_ptr); void cb_processClicked (FWidget*, FDataPtr);
void cb_processCancel (FWidget*, data_ptr); void cb_processCancel (FWidget*, FDataPtr);
void cb_processOpen (FWidget*, data_ptr); void cb_processOpen (FWidget*, FDataPtr);
void cb_processShowHidden (FWidget*, data_ptr); void cb_processShowHidden (FWidget*, FDataPtr);
// Data Members // Data Members
DIR* directory_stream{nullptr}; DIR* directory_stream{nullptr};

View File

@ -135,7 +135,7 @@ class FLabel : public FWidget
virtual void onAccel (FAccelEvent*); virtual void onAccel (FAccelEvent*);
// Callback method // Callback method
void cb_accel_widget_destroyed (FWidget*, data_ptr); void cb_accel_widget_destroyed (FWidget*, FDataPtr);
private: private:
// Constants // Constants

View File

@ -75,7 +75,7 @@ class FListBoxItem
// Constructors // Constructors
FListBoxItem (); FListBoxItem ();
FListBoxItem (const FListBoxItem&); // copy constructor FListBoxItem (const FListBoxItem&); // copy constructor
explicit FListBoxItem (const FString&, FWidget::data_ptr = nullptr); explicit FListBoxItem (const FString&, FDataPtr = nullptr);
// Destructor // Destructor
virtual ~FListBoxItem(); virtual ~FListBoxItem();
@ -85,11 +85,11 @@ class FListBoxItem
// Accessors // Accessors
virtual FString& getText(); virtual FString& getText();
virtual FWidget::data_ptr getData() const; virtual FDataPtr getData() const;
// Mutators // Mutators
void setText (const FString&); void setText (const FString&);
void setData (FWidget::data_ptr); void setData (FDataPtr);
// Methods // Methods
void clear(); void clear();
@ -100,7 +100,7 @@ class FListBoxItem
// Data Members // Data Members
FString text{}; FString text{};
FWidget::data_ptr data_pointer{nullptr}; FDataPtr data_pointer{nullptr};
fc::brackets_type brackets{fc::NoBrackets}; fc::brackets_type brackets{fc::NoBrackets};
bool selected{false}; bool selected{false};
}; };
@ -113,7 +113,7 @@ inline FString& FListBoxItem::getText()
{ return text; } { return text; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FWidget::data_ptr FListBoxItem::getData() const inline FDataPtr FListBoxItem::getData() const
{ return data_pointer; } { return data_pointer; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -121,7 +121,7 @@ inline void FListBoxItem::setText (const FString& txt)
{ text = txt; } { text = txt; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListBoxItem::setData (FWidget::data_ptr data) inline void FListBoxItem::setData (FDataPtr data)
{ data_pointer = data; } { data_pointer = data; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -206,11 +206,11 @@ class FListBox : public FWidget
void insert ( const FString& void insert ( const FString&
, fc::brackets_type = fc::NoBrackets , fc::brackets_type = fc::NoBrackets
, bool = false , bool = false
, data_ptr = nullptr ); , FDataPtr = nullptr );
void insert ( long void insert ( long
, fc::brackets_type = fc::NoBrackets , fc::brackets_type = fc::NoBrackets
, bool = false , bool = false
, data_ptr = nullptr ); , FDataPtr = nullptr );
void remove (std::size_t); void remove (std::size_t);
void clear(); void clear();
@ -296,17 +296,17 @@ class FListBox : public FWidget
listBoxItems::iterator index2iterator (std::size_t); listBoxItems::iterator index2iterator (std::size_t);
// Callback methods // Callback methods
void cb_VBarChange (FWidget*, data_ptr); void cb_VBarChange (FWidget*, FDataPtr);
void cb_HBarChange (FWidget*, data_ptr); void cb_HBarChange (FWidget*, FDataPtr);
// Function Pointer // Function Pointer
void (*convertToItem) ( FListBoxItem& void (*convertToItem) ( FListBoxItem&
, FWidget::data_ptr , FDataPtr
, int index ){nullptr}; , int index ){nullptr};
// Data Members // Data Members
listBoxItems itemlist{}; listBoxItems itemlist{};
FWidget::data_ptr source_container{nullptr}; FDataPtr source_container{nullptr};
convert_type conv_type{FListBox::no_convert}; convert_type conv_type{FListBox::no_convert};
FScrollbarPtr vbar{nullptr}; FScrollbarPtr vbar{nullptr};
FScrollbarPtr hbar{nullptr}; FScrollbarPtr hbar{nullptr};

View File

@ -81,7 +81,7 @@ class FListViewItem : public FObject
FListViewItem (const FListViewItem&); // copy constructor FListViewItem (const FListViewItem&); // copy constructor
explicit FListViewItem (FObjectIterator); explicit FListViewItem (FObjectIterator);
FListViewItem ( const FStringList& FListViewItem ( const FStringList&
, FWidget::data_ptr , FDataPtr
, FObjectIterator ); , FObjectIterator );
// Destructor // Destructor
@ -95,12 +95,12 @@ class FListViewItem : public FObject
uInt getColumnCount() const; uInt getColumnCount() const;
int getSortColumn() const; int getSortColumn() const;
FString getText (int) const; FString getText (int) const;
FWidget::data_ptr getData() const; FDataPtr getData() const;
uInt getDepth() const; uInt getDepth() const;
// Mutators // Mutators
void setText (int, const FString&); void setText (int, const FString&);
void setData (FWidget::data_ptr); void setData (FDataPtr);
void setCheckable (bool); void setCheckable (bool);
void setChecked (bool); void setChecked (bool);
@ -129,7 +129,7 @@ class FListViewItem : public FObject
// Data Members // Data Members
FStringList column_list{}; FStringList column_list{};
FWidget::data_ptr data_pointer{nullptr}; FDataPtr data_pointer{nullptr};
FObjectIterator root{}; FObjectIterator root{};
std::size_t visible_lines{1}; std::size_t visible_lines{1};
bool expandable{false}; bool expandable{false};
@ -154,11 +154,11 @@ inline uInt FListViewItem::getColumnCount() const
{ return uInt(column_list.size()); } { return uInt(column_list.size()); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FWidget::data_ptr FListViewItem::getData() const inline FDataPtr FListViewItem::getData() const
{ return data_pointer; } { return data_pointer; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListViewItem::setData (FWidget::data_ptr data) inline void FListViewItem::setData (FDataPtr data)
{ data_pointer = data; } { data_pointer = data; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -317,18 +317,18 @@ class FListView : public FWidget
FObjectIterator insert (FListViewItem*); FObjectIterator insert (FListViewItem*);
FObjectIterator insert (FListViewItem*, FObjectIterator); FObjectIterator insert (FListViewItem*, FObjectIterator);
FObjectIterator insert ( const FStringList& FObjectIterator insert ( const FStringList&
, data_ptr = nullptr ); , FDataPtr = nullptr );
FObjectIterator insert ( const FStringList& FObjectIterator insert ( const FStringList&
, FObjectIterator ); , FObjectIterator );
FObjectIterator insert ( const FStringList& FObjectIterator insert ( const FStringList&
, data_ptr , FDataPtr
, FObjectIterator ); , FObjectIterator );
FObjectIterator insert ( const std::vector<long>& FObjectIterator insert ( const std::vector<long>&
, data_ptr = nullptr ); , FDataPtr = nullptr );
FObjectIterator insert ( const std::vector<long>& FObjectIterator insert ( const std::vector<long>&
, FObjectIterator ); , FObjectIterator );
FObjectIterator insert ( const std::vector<long>& FObjectIterator insert ( const std::vector<long>&
, data_ptr , FDataPtr
, FObjectIterator ); , FObjectIterator );
FObjectIterator beginOfList(); FObjectIterator beginOfList();
FObjectIterator endOfList(); FObjectIterator endOfList();
@ -419,8 +419,8 @@ class FListView : public FWidget
bool hasCheckableItems() const; bool hasCheckableItems() const;
// Callback methods // Callback methods
void cb_VBarChange (FWidget*, data_ptr); void cb_VBarChange (FWidget*, FDataPtr);
void cb_HBarChange (FWidget*, data_ptr); void cb_HBarChange (FWidget*, FDataPtr);
// Data Members // Data Members
FObjectIterator root{}; FObjectIterator root{};
@ -526,7 +526,7 @@ inline FObject::FObjectIterator FListView::insert (FListViewItem* item)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FObject::FObjectIterator inline FObject::FObjectIterator
FListView::insert (const FStringList& cols, data_ptr d) FListView::insert (const FStringList& cols, FDataPtr d)
{ return insert (cols, d, root); } { return insert (cols, d, root); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -537,7 +537,7 @@ inline FObject::FObjectIterator
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FObject::FObjectIterator inline FObject::FObjectIterator
FListView::insert (const std::vector<long>& cols, data_ptr d) FListView::insert (const std::vector<long>& cols, FDataPtr d)
{ return insert (cols, d, root); } { return insert (cols, d, root); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -127,7 +127,7 @@ class FMenu : public FWindow, public FMenuList
virtual void onAccel (FAccelEvent*); virtual void onAccel (FAccelEvent*);
// Callback method // Callback method
void cb_menuitem_toggled (FWidget*, data_ptr); void cb_menuitem_toggled (FWidget*, FDataPtr);
private: private:
// Constants // Constants

View File

@ -104,7 +104,7 @@ class FMenuBar : public FWindow, public FMenuList
virtual void onAccel (FAccelEvent*); virtual void onAccel (FAccelEvent*);
// Callback methods // Callback methods
void cb_item_deactivated (FWidget*, data_ptr); void cb_item_deactivated (FWidget*, FDataPtr);
private: private:
// Constants // Constants

View File

@ -179,8 +179,8 @@ class FMenuItem : public FWidget
void passMouseEvent (T, FMouseEvent*, fc::events); void passMouseEvent (T, FMouseEvent*, fc::events);
// Callback methods // Callback methods
void cb_switchToDialog (FWidget*, data_ptr); void cb_switchToDialog (FWidget*, FDataPtr);
void cb_destroyDialog (FWidget*, data_ptr); void cb_destroyDialog (FWidget*, FDataPtr);
virtual void processClicked(); virtual void processClicked();

View File

@ -140,7 +140,7 @@ class FMessageBox : public FDialog
virtual void adjustSize(); virtual void adjustSize();
// Callback method // Callback method
void cb_processClick (FWidget*, data_ptr); void cb_processClick (FWidget*, FDataPtr);
private: private:
// Methods // Methods

View File

@ -175,8 +175,8 @@ class FScrollView : public FWidget
void drawVBar(); void drawVBar();
// Callback methods // Callback methods
void cb_VBarChange (FWidget*, data_ptr); void cb_VBarChange (FWidget*, FDataPtr);
void cb_HBarChange (FWidget*, data_ptr); void cb_HBarChange (FWidget*, FDataPtr);
// Data Members // Data Members
FRect scroll_geometry{1, 1, 1, 1}; FRect scroll_geometry{1, 1, 1, 1};

View File

@ -236,7 +236,7 @@ class FStatusBar : public FWindow
virtual void onMouseMove (FMouseEvent*); virtual void onMouseMove (FMouseEvent*);
// Callback method // Callback method
void cb_statuskey_activated (FWidget*, data_ptr); void cb_statuskey_activated (FWidget*, FDataPtr);
private: private:
// Typedef // Typedef

View File

@ -145,8 +145,8 @@ class FTextView : public FWidget
void drawVBar(); void drawVBar();
// Callback methods // Callback methods
void cb_VBarChange (FWidget*, data_ptr); void cb_VBarChange (FWidget*, FDataPtr);
void cb_HBarChange (FWidget*, data_ptr); void cb_HBarChange (FWidget*, FDataPtr);
// Data Members // Data Members
FStringList data{}; FStringList data{};

View File

@ -58,6 +58,7 @@ typedef long double lDouble;
typedef uInt16 FColor; typedef uInt16 FColor;
typedef uInt32 FKey; typedef uInt32 FKey;
typedef void* FDataPtr;
} // namespace } // namespace

View File

@ -138,10 +138,9 @@ class FWidget : public FVTerm, public FObject
// Typedefs // Typedefs
typedef std::vector<FWidget*> widgetList; typedef std::vector<FWidget*> widgetList;
typedef void* data_ptr;
typedef void (*FCallback)(FWidget*, data_ptr);
typedef void (FWidget::*FMemberCallback)(FWidget*, data_ptr);
typedef std::vector<accelerator> Accelerators; typedef std::vector<accelerator> Accelerators;
typedef void (*FCallback)(FWidget*, FDataPtr);
typedef void (FWidget::*FMemberCallback)(FWidget*, FDataPtr);
struct widget_flags // Properties of a widget ⚑ struct widget_flags // Properties of a widget ⚑
{ {
@ -307,11 +306,11 @@ class FWidget : public FVTerm, public FObject
void clearStatusbarMessage(); void clearStatusbarMessage();
void addCallback ( const FString& void addCallback ( const FString&
, FCallback , FCallback
, data_ptr = nullptr ); , FDataPtr = nullptr );
void addCallback ( const FString& void addCallback ( const FString&
, FWidget* , FWidget*
, FMemberCallback , FMemberCallback
, data_ptr = nullptr ); , FDataPtr = nullptr );
void delCallback (FCallback); void delCallback (FCallback);
void delCallback (FWidget*); void delCallback (FWidget*);
void delCallbacks(); void delCallbacks();
@ -347,7 +346,7 @@ class FWidget : public FVTerm, public FObject
{ {
FString cb_signal; FString cb_signal;
FCallback cb_handler; FCallback cb_handler;
data_ptr data; FDataPtr data;
}; };
struct member_callback_data struct member_callback_data
@ -355,7 +354,7 @@ class FWidget : public FVTerm, public FObject
FString cb_signal; FString cb_signal;
FWidget* cb_instance; FWidget* cb_instance;
FMemberCallback cb_handler; FMemberCallback cb_handler;
data_ptr data; FDataPtr data;
}; };
// Typedefs // Typedefs