NativeExtensionManager
Inherits: Object
Description
Section titled “Description”Provides access to NativeExtension functionality.
The NativeExtensionManager loads, initializes, and keeps track of all available NativeExtension libraries in the project.
Note: Do not worry about NativeExtension unless you know what you are doing.
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| NativeExtension | get_extension(path: String) |
| PackedStringArray | get_loaded_extensions() const |
| bool | is_extension_loaded(path: String) const |
| LoadStatus | load_extension(path: String) |
| LoadStatus | load_extension_from_function(path: String, init_func: const NativeExtensionInitializationFunction*) |
| LoadStatus | reload_extension(path: String) |
| LoadStatus | unload_extension(path: String) |
Signals
Section titled “Signals”extension_loaded
extension_loaded(extension: NativeExtension)
Emitted after the editor has finished loading a new extension.
Note: This signal is only emitted in editor builds.
extension_unloading
extension_unloading(extension: NativeExtension)
Emitted before the editor starts unloading an extension.
Note: This signal is only emitted in editor builds.
extensions_reloaded
extensions_reloaded()
Emitted after the editor has finished reloading one or more extensions.
Enumerations
Section titled “Enumerations”LoadStatus
enum LoadStatus
LOAD_STATUS_OK = 0
The extension has loaded successfully.
LOAD_STATUS_FAILED = 1
The extension has failed to load, possibly because it does not exist or has missing dependencies.
LOAD_STATUS_ALREADY_LOADED = 2
The extension has already been loaded.
LOAD_STATUS_NOT_LOADED = 3
The extension has not been loaded.
LOAD_STATUS_NEEDS_RESTART = 4
The extension requires the application to restart to fully load.
Method descriptions
Section titled “Method descriptions”get_extension
NativeExtension get_extension(path: String)
Returns the NativeExtension at the given file path, or null if it has not been loaded or does not exist.
get_loaded_extensions
PackedStringArray get_loaded_extensions() const
Returns the file paths of all currently loaded extensions.
is_extension_loaded
bool is_extension_loaded(path: String) const
Returns true if the extension at the given file path has already been loaded successfully. See also get_loaded_extensions().
load_extension
LoadStatus load_extension(path: String)
Loads an extension by absolute file path. The path needs to point to a valid NativeExtension. Returns LOAD_STATUS_OK if successful.
load_extension_from_function
LoadStatus load_extension_from_function(path: String, init_func: const NativeExtensionInitializationFunction*)
Loads the extension already in address space via the given path and initialization function. The path needs to be unique and start with "liborblit://". Returns LOAD_STATUS_OK if successful.
reload_extension
LoadStatus reload_extension(path: String)
Reloads the extension at the given file path. The path needs to point to a valid NativeExtension, otherwise this method may return either LOAD_STATUS_NOT_LOADED or LOAD_STATUS_FAILED.
Note: You can only reload extensions in the editor. In release builds, this method always fails and returns LOAD_STATUS_FAILED.
unload_extension
LoadStatus unload_extension(path: String)
Unloads an extension by file path. The path needs to point to an already loaded NativeExtension, otherwise this method returns LOAD_STATUS_NOT_LOADED.
