X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=include%2Fpreferencesystem.h;h=6479ec91d32e7adabafc1d654d5b85611717754c;hb=04236f5bd863c69814ee58414d99da818f62a60d;hp=45678024ffd8ec0a6df23e509a7d708fc8ed5369;hpb=dac8329952745dbb494bad1c301e44bab05ec0db;p=xonotic%2Fnetradiant.git diff --git a/include/preferencesystem.h b/include/preferencesystem.h index 45678024..6479ec91 100644 --- a/include/preferencesystem.h +++ b/include/preferencesystem.h @@ -23,20 +23,32 @@ #define INCLUDED_PREFERENCESYSTEM_H #include "generic/constant.h" -#include "generic/callbackfwd.h" +#include "generic/callback.h" +#include "property.h" -typedef Callback1 StringImportCallback; -typedef Callback1 StringExportCallback; - -class PreferenceSystem -{ +class PreferenceSystem { public: -INTEGER_CONSTANT( Version, 1 ); -STRING_CONSTANT( Name, "preferences" ); + INTEGER_CONSTANT(Version, 1); + STRING_CONSTANT(Name, "preferences"); -virtual void registerPreference( const char* name, const StringImportCallback& importer, const StringExportCallback& exporter ) = 0; + virtual void registerPreference(const char *name, const Property &cb) = 0; }; +template +Property make_property_string(Self &it) { + return make_property>(it); +} + +template +Property make_property_string(Self &it) { + return make_property_chain, const char *>, I>(it); +} + +template +Property make_property_string() { + return make_property_chain, const char *>, I>(); +} + #include "modulesystem.h" template