libretro.drivers.options.driver¶
Protocol definition for the core options interface.
See also
libretro.api.optionsThe matching
ctypestypes and callback definitions.
Classes
Protocol for drivers that store and resolve a core's runtime options. |
- class OptionDriver[source]¶
Bases:
ProtocolProtocol for drivers that store and resolve a core’s runtime options.
See also
libretro.api.optionsThe matching
ctypestypes and callback definitions.
- abstractmethod get_variable(key)[source]¶
Return the current value of a single core option.
Corresponds to
RETRO_ENVIRONMENT_GET_VARIABLE.
- abstractmethod set_variables(variables)[source]¶
Register the v0 core option variables advertised by the core.
Corresponds to
RETRO_ENVIRONMENT_SET_VARIABLES.- Parameters:
variables (
Collection[retro_variable] |None) – The variables registered by the core, orNoneto clear the registration.- Return type:
- abstract property variable_updated¶
Whether any core option has been changed since the core last queried it.
Corresponds to
RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE. Reading this property is expected to clear the flag.
- abstract property version¶
The core options interface version this driver implements.
Corresponds to
RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION.
- abstractmethod set_options(options)[source]¶
Register the v1 core option definitions advertised by the core.
Corresponds to
RETRO_ENVIRONMENT_SET_CORE_OPTIONS.- Parameters:
options (
Collection[retro_core_option_definition] |None) – The options registered by the core, orNoneto clear the registration.- Return type:
- abstractmethod set_options_intl(options)[source]¶
Register the v1 core option definitions, with translations, advertised by the core.
Corresponds to
RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL.- Parameters:
options (
retro_core_options_intl|None) – The options registered by the core, orNoneto clear the registration.- Return type:
- abstractmethod set_display(key, visible)[source]¶
Show or hide a single core option in the frontend’s UI.
Corresponds to
RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY.
- abstractmethod set_options_v2(options)[source]¶
Register the v2 core option definitions advertised by the core.
Corresponds to
RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2.- Parameters:
options (
retro_core_options_v2|None) – The options registered by the core, orNoneto clear the registration.- Return type:
- abstractmethod set_options_v2_intl(options)[source]¶
Register the v2 core option definitions, with translations, advertised by the core.
Corresponds to
RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL.- Parameters:
options (
retro_core_options_v2_intl|None) – The options registered by the core, orNoneto clear the registration.- Return type:
- abstract property update_display_callback¶
The display-update callback registered by the core, if any.
Set via
RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK.Noneif the core has not registered one.- Parameters:
callback – The callback to register, or
Noneto clear it.- Raises:
UnsupportedEnvCall – If this driver does not support the display-update callback.
- abstractmethod set_variable(var, value)[source]¶
Set a single core option’s value.
Corresponds to
RETRO_ENVIRONMENT_SET_VARIABLE.
- abstract property supports_categories¶
Whether this driver groups core options into categories (v2 feature).
- abstract property variables¶
A live, mutable mapping of option keys to current values.
Mutating the returned mapping changes the driver’s stored option values and is the primary way to drive option changes from a Python test harness.
- abstract property visibility¶
A mapping of option keys to whether the frontend would show that option.
- abstract property categories¶
The v2 option categories registered by the core, indexed by category key.
Noneif the core has not registered any categories or this driver does not support categories.
- abstract property definitions¶
The v2 option definitions registered by the core, indexed by option key.
Noneif the core has not registered any v2 definitions.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶