]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/dialog.cpp
Callback: remove fixed-arity wrappers
[xonotic/netradiant.git] / radiant / dialog.cpp
index c6672ae4c5af9564077f857399b8aa28883b7892..bb8705f2446191bbf78b4a431c9bf6586d471938 100644 (file)
@@ -90,7 +90,7 @@ ui::SpinButton DialogSpinner_new( double value, double lower, double upper, int
 class DialogSpinnerRow
 {
 public:
-DialogSpinnerRow( ui::Widget row, GtkSpinButton* spin ) : m_row( row ), m_spin( spin ){
+DialogSpinnerRow( ui::Widget row, ui::SpinButton spin ) : m_row( row ), m_spin( spin ){
 }
 ui::Widget m_row;
 ui::SpinButton m_spin;
@@ -112,7 +112,7 @@ template<
        typename Type_,
        typename Other_,
        void( *Import ) ( Type_&, Other_ ),
-       void( *Export ) ( Type_&, const Callback1<Other_>& )
+       void( *Export ) ( Type_&, const Callback<void(Other_)>& )
        >
 class ImportExport
 {
@@ -120,8 +120,8 @@ public:
 typedef Type_ Type;
 typedef Other_ Other;
 
-typedef ReferenceCaller1<Type, Other, Import> ImportCaller;
-typedef ReferenceCaller1<Type, const Callback1<Other>&, Export> ExportCaller;
+typedef ReferenceCaller<Type, void(Other), Import> ImportCaller;
+typedef ReferenceCaller<Type, void(const Callback<void(Other)>&), Export> ExportCaller;
 };
 
 typedef ImportExport<bool, bool, BoolImport, BoolExport> BoolImportExport;
@@ -229,8 +229,8 @@ template<typename FirstArgument>
 class CallbackDialogData : public DLG_DATA
 {
 public:
-typedef Callback1<FirstArgument> ImportCallback;
-typedef Callback1<const ImportCallback&> ExportCallback;
+typedef Callback<void(FirstArgument)> ImportCallback;
+typedef Callback<void(const ImportCallback&)> ExportCallback;
 
 private:
 ImportCallback m_importWidget;
@@ -281,8 +281,8 @@ AddCustomData( DialogDataList& data ) : m_data( data ){
 }
 void apply(
        typename Widget::Type& widget,
-       const Callback1<typename Widget::Other>& importViewer,
-       const Callback1<const Callback1<typename Widget::Other>&>& exportViewer
+       const Callback<void(typename Widget::Other)>& importViewer,
+       const Callback<void(const Callback<void(typename Widget::Other)>&)>& exportViewer
        ) const {
        m_data.push_back(
                new CallbackDialogData<typename Widget::Other>(