openMSX
|
#include <Setting.hh>
Public Member Functions | |
const TclObject & | getFullNameObj () const |
Get the name of this setting. | |
const TclObject & | getBaseNameObj () const |
std::string_view | getFullName () const |
std::string_view | getBaseName () const |
void | setPrefix (std::string_view prefix) |
Set a machine specific prefix. | |
void | info (TclObject &result) const |
For SettingInfo. | |
virtual std::string_view | getDescription () const =0 |
pure virtual methods /// | |
virtual std::string_view | getTypeString () const =0 |
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget. | |
virtual void | additionalInfo (TclObject &result) const =0 |
Helper method for info(). | |
virtual void | tabCompletion (std::vector< std::string > &tokens) const =0 |
Complete a partly typed value. | |
virtual const TclObject & | getValue () const =0 |
Get current value as a TclObject. | |
virtual std::optional< TclObject > | getOptionalValue () const =0 |
Like getValue(), but in case of error returns an empty optional instead of throwing an exception. | |
virtual TclObject | getDefaultValue () const =0 |
Get the default value of this setting. | |
virtual void | setValue (const TclObject &value)=0 |
Change the value of this setting to the given value. | |
virtual void | setValueDirect (const TclObject &value)=0 |
Similar to setValue(), but doesn't trigger Tcl traces. | |
virtual bool | needLoadSave () const =0 |
Does this setting need to be loaded or saved (settings.xml). | |
virtual bool | needTransfer () const =0 |
Does this setting need to be transfered on reverse. | |
Protected Member Functions | |
BaseSetting (std::string_view name) | |
BaseSetting (TclObject name) | |
~BaseSetting ()=default | |
Definition at line 20 of file Setting.hh.
|
explicitprotected |
Definition at line 15 of file Setting.cc.
|
explicitprotected |
Definition at line 21 of file Setting.cc.
|
protecteddefault |
|
pure virtual |
Helper method for info().
Implemented in openmsx::EnumSetting< T >, openmsx::EnumSetting< Accuracy >, openmsx::EnumSetting< bool >, openmsx::EnumSetting< DirAsDSK::BootSectorType >, openmsx::EnumSetting< DirAsDSK::SyncMode >, openmsx::EnumSetting< DisplayDeform >, openmsx::EnumSetting< int >, openmsx::EnumSetting< KpEnterMode >, openmsx::EnumSetting< MappingMode >, openmsx::EnumSetting< Mode >, openmsx::EnumSetting< RendererID >, openmsx::EnumSetting< ResampledSoundDevice::ResampleType >, openmsx::EnumSetting< ResampleType >, openmsx::EnumSetting< RTCMode >, openmsx::EnumSetting< ScaleAlgorithm >, openmsx::EnumSetting< SDL_Keycode >, openmsx::EnumSetting< SoundDriverType >, openmsx::FloatSetting, openmsx::IntegerSetting, openmsx::ProxySetting, openmsx::Setting, and openmsx::VideoSourceSetting.
Referenced by info().
|
inline |
Definition at line 38 of file Setting.hh.
References openmsx::TclObject::getString().
Referenced by openmsx::Checkbox(), openmsx::Checkbox(), openmsx::MSXCommandController::findSetting(), openmsx::Setting::init(), openmsx::InputText(), openmsx::Setting::notifyPropertyChange(), setPrefix(), openmsx::ImGuiSettings::showMenu(), openmsx::SliderFloat(), and openmsx::SliderInt().
|
inline |
Definition at line 36 of file Setting.hh.
Referenced by openmsx::Setting::setValueDirect().
|
pure virtual |
Get the default value of this setting.
This is the initial value of the setting. Default values don't get saved in 'settings.xml'. This is also the value used for a Tcl 'unset' command.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
Referenced by info().
|
pure virtual |
pure virtual methods ///
Get a description of this setting that can be presented to the user.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
|
inline |
Definition at line 37 of file Setting.hh.
References openmsx::TclObject::getString().
Referenced by openmsx::ProxySetting::getTypeString(), openmsx::ProxySetting::getValue(), openmsx::ProxySetting::setValueDirect(), and openmsx::Interpreter::unregisterSetting().
|
inline |
Get the name of this setting.
For global settings 'fullName' and 'baseName' are the same. For machine specific settings 'fullName' is the fully qualified name, and 'baseName' is the name without machine-prefix. For example: fullName = "::machine1::PSG_volume" baseName = "PSG_volume"
Definition at line 35 of file Setting.hh.
Referenced by openmsx::Interpreter::registerSetting(), and openmsx::Setting::setValue().
|
pure virtual |
Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
|
pure virtual |
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget.
Implemented in openmsx::BooleanSetting, openmsx::EnumSetting< T >, openmsx::EnumSetting< Accuracy >, openmsx::EnumSetting< bool >, openmsx::EnumSetting< DirAsDSK::BootSectorType >, openmsx::EnumSetting< DirAsDSK::SyncMode >, openmsx::EnumSetting< DisplayDeform >, openmsx::EnumSetting< int >, openmsx::EnumSetting< KpEnterMode >, openmsx::EnumSetting< MappingMode >, openmsx::EnumSetting< Mode >, openmsx::EnumSetting< RendererID >, openmsx::EnumSetting< ResampledSoundDevice::ResampleType >, openmsx::EnumSetting< ResampleType >, openmsx::EnumSetting< RTCMode >, openmsx::EnumSetting< ScaleAlgorithm >, openmsx::EnumSetting< SDL_Keycode >, openmsx::EnumSetting< SoundDriverType >, openmsx::FilenameSetting, openmsx::FloatSetting, openmsx::IntegerSetting, openmsx::KeyCodeSetting, openmsx::ProxySetting, openmsx::ReadOnlySetting, openmsx::StringSetting, and openmsx::VideoSourceSetting.
Referenced by info().
|
pure virtual |
Get current value as a TclObject.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
Referenced by openmsx::ComboBox(), and openmsx::InputText().
void openmsx::BaseSetting::info | ( | TclObject & | result | ) | const |
For SettingInfo.
Definition at line 27 of file Setting.cc.
References additionalInfo(), openmsx::TclObject::addListElement(), getDefaultValue(), and getTypeString().
Referenced by openmsx::Setting::notifyPropertyChange().
|
pure virtual |
Does this setting need to be loaded or saved (settings.xml).
Implemented in openmsx::Setting, and openmsx::ProxySetting.
|
pure virtual |
Does this setting need to be transfered on reverse.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
|
inline |
Set a machine specific prefix.
Definition at line 42 of file Setting.hh.
References getBaseName(), and tmpStrCat().
|
pure virtual |
Change the value of this setting to the given value.
This method will trigger Tcl traces. This value still passes via the 'checker-callback' (see below), so the value may be adjusted. Or in case of an invalid value this method may throw.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
Referenced by openmsx::InputText(), and openmsx::ProxySetting::setValue().
|
pure virtual |
Similar to setValue(), but doesn't trigger Tcl traces.
Like setValue(), the given value may be adjusted or rejected. Should only be used by the Interpreter class.
Implemented in openmsx::Setting, and openmsx::ProxySetting.
Referenced by openmsx::Interpreter::registerSetting().
|
pure virtual |
Complete a partly typed value.
Default implementation does not complete anything, subclasses can override this to complete according to their specific value type.
Implemented in openmsx::BooleanSetting, openmsx::EnumSetting< T >, openmsx::EnumSetting< Accuracy >, openmsx::EnumSetting< bool >, openmsx::EnumSetting< DirAsDSK::BootSectorType >, openmsx::EnumSetting< DirAsDSK::SyncMode >, openmsx::EnumSetting< DisplayDeform >, openmsx::EnumSetting< int >, openmsx::EnumSetting< KpEnterMode >, openmsx::EnumSetting< MappingMode >, openmsx::EnumSetting< Mode >, openmsx::EnumSetting< RendererID >, openmsx::EnumSetting< ResampledSoundDevice::ResampleType >, openmsx::EnumSetting< ResampleType >, openmsx::EnumSetting< RTCMode >, openmsx::EnumSetting< ScaleAlgorithm >, openmsx::EnumSetting< SDL_Keycode >, openmsx::EnumSetting< SoundDriverType >, openmsx::FilenameSetting, openmsx::ProxySetting, openmsx::Setting, and openmsx::VideoSourceSetting.