void UndoLevels_importString( RadiantUndoSystem& undo, const char* value ){
int levels;
- Int_importString( levels, value );
+ PropertyImpl<int, const char *>::Import( levels, value );
undo.setLevels( levels );
}
-typedef ReferenceCaller1<RadiantUndoSystem, const char*, UndoLevels_importString> UndoLevelsImportStringCaller;
-void UndoLevels_exportString( const RadiantUndoSystem& undo, const StringImportCallback& importer ){
- Int_exportString( static_cast<int>( undo.getLevels() ), importer );
+typedef ReferenceCaller<RadiantUndoSystem, void(const char*), UndoLevels_importString> UndoLevelsImportStringCaller;
+void UndoLevels_exportString( const RadiantUndoSystem& undo, const Callback<void(const char *)> & importer ){
+ PropertyImpl<int, const char *>::Export( static_cast<int>( undo.getLevels() ), importer );
}
-typedef ConstReferenceCaller1<RadiantUndoSystem, const StringImportCallback&, UndoLevels_exportString> UndoLevelsExportStringCaller;
+typedef ConstReferenceCaller<RadiantUndoSystem, void(const Callback<void(const char *)> &), UndoLevels_exportString> UndoLevelsExportStringCaller;
#include "generic/callback.h"
-void UndoLevelsImport( RadiantUndoSystem& self, int value ){
- self.setLevels( value );
-}
-typedef ReferenceCaller1<RadiantUndoSystem, int, UndoLevelsImport> UndoLevelsImportCaller;
-void UndoLevelsExport( const RadiantUndoSystem& self, const IntImportCallback& importCallback ){
- importCallback( static_cast<int>( self.getLevels() ) );
-}
-typedef ConstReferenceCaller1<RadiantUndoSystem, const IntImportCallback&, UndoLevelsExport> UndoLevelsExportCaller;
+struct UndoLevels {
+ static void Export(const RadiantUndoSystem &self, const Callback<void(int)> &returnz) {
+ returnz(static_cast<int>(self.getLevels()));
+ }
+ static void Import(RadiantUndoSystem &self, int value) {
+ self.setLevels(value);
+ }
+};
void Undo_constructPreferences( RadiantUndoSystem& undo, PreferencesPage& page ){
- page.appendSpinner( "Undo Queue Size", 64, 0, 1024, IntImportCallback( UndoLevelsImportCaller( undo ) ), IntExportCallback( UndoLevelsExportCaller( undo ) ) );
+ page.appendSpinner("Undo Queue Size", 64, 0, 1024, make_property<UndoLevels>(undo));
}
void Undo_constructPage( RadiantUndoSystem& undo, PreferenceGroup& group ){
PreferencesPage page( group.createPage( "Undo", "Undo Queue Settings" ) );
Undo_constructPreferences( undo, page );
}
void Undo_registerPreferencesPage( RadiantUndoSystem& undo ){
- PreferencesDialog_addSettingsPage( ReferenceCaller1<RadiantUndoSystem, PreferenceGroup&, Undo_constructPage>( undo ) );
+ PreferencesDialog_addSettingsPage( ReferenceCaller<RadiantUndoSystem, void(PreferenceGroup&), Undo_constructPage>( undo ) );
}
class UndoSystemDependencies : public GlobalPreferenceSystemModuleRef
STRING_CONSTANT( Name, "*" );
UndoSystemAPI(){
- GlobalPreferenceSystem().registerPreference( "UndoLevels", makeIntStringImportCallback( UndoLevelsImportCaller( m_undosystem ) ), makeIntStringExportCallback( UndoLevelsExportCaller( m_undosystem ) ) );
+ GlobalPreferenceSystem().registerPreference("UndoLevels", make_property_string<UndoLevels>(m_undosystem));
Undo_registerPreferencesPage( m_undosystem );
}