2021-06-19 17:58:49 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 10:08:05 +02:00
<class name= "GDExtensionManager" inherits= "Object" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2021-06-19 17:58:49 +02:00
<brief_description >
2024-01-08 15:44:06 +01:00
Provides access to GDExtension functionality.
2021-06-19 17:58:49 +02:00
</brief_description>
<description >
2024-01-08 15:44:06 +01:00
The GDExtensionManager loads, initializes, and keeps track of all available [GDExtension] libraries in the project.
[b]Note:[/b] Do not worry about GDExtension unless you know what you are doing.
2021-06-19 17:58:49 +02:00
</description>
<tutorials >
2024-01-08 15:44:06 +01:00
<link title= "GDExtension overview" > $DOCS_URL/tutorials/scripting/gdextension/what_is_gdextension.html</link>
<link title= "GDExtension example in C++" > $DOCS_URL/tutorials/scripting/gdextension/gdextension_cpp_example.html</link>
2021-06-19 17:58:49 +02:00
</tutorials>
<methods >
<method name= "get_extension" >
2022-12-07 12:11:28 +01:00
<return type= "GDExtension" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "path" type= "String" />
2021-06-19 17:58:49 +02:00
<description >
2024-01-08 15:44:06 +01:00
Returns the [GDExtension] at the given file [param path], or [code]null[/code] if it has not been loaded or does not exist.
2021-06-19 17:58:49 +02:00
</description>
</method>
<method name= "get_loaded_extensions" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PackedStringArray" />
2021-06-19 17:58:49 +02:00
<description >
2024-01-08 15:44:06 +01:00
Returns the file paths of all currently loaded extensions.
2021-06-19 17:58:49 +02:00
</description>
</method>
2021-08-20 20:32:56 +02:00
<method name= "is_extension_loaded" qualifiers= "const" >
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "path" type= "String" />
2021-08-20 20:32:56 +02:00
<description >
2024-01-08 15:44:06 +01:00
Returns [code]true[/code] if the extension at the given file [param path] has already been loaded successfully. See also [method get_loaded_extensions].
2021-08-20 20:32:56 +02:00
</description>
</method>
2021-06-19 17:58:49 +02:00
<method name= "load_extension" >
2022-12-07 12:11:28 +01:00
<return type= "int" enum= "GDExtensionManager.LoadStatus" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "path" type= "String" />
2021-06-19 17:58:49 +02:00
<description >
2024-01-08 15:44:06 +01:00
Loads an extension by absolute file path. The [param path] needs to point to a valid [GDExtension]. Returns [constant LOAD_STATUS_OK] if successful.
2021-06-19 17:58:49 +02:00
</description>
</method>
<method name= "reload_extension" >
2022-12-07 12:11:28 +01:00
<return type= "int" enum= "GDExtensionManager.LoadStatus" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "path" type= "String" />
2021-06-19 17:58:49 +02:00
<description >
2024-05-08 10:04:47 +02:00
Reloads the extension at the given file path. The [param path] needs to point to a valid [GDExtension], otherwise this method may return either [constant LOAD_STATUS_NOT_LOADED] or [constant LOAD_STATUS_FAILED].
2024-01-08 15:44:06 +01:00
[b]Note:[/b] You can only reload extensions in the editor. In release builds, this method always fails and returns [constant LOAD_STATUS_FAILED].
2021-06-19 17:58:49 +02:00
</description>
</method>
<method name= "unload_extension" >
2022-12-07 12:11:28 +01:00
<return type= "int" enum= "GDExtensionManager.LoadStatus" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "path" type= "String" />
2021-06-19 17:58:49 +02:00
<description >
2024-01-08 15:44:06 +01:00
Unloads an extension by file path. The [param path] needs to point to an already loaded [GDExtension], otherwise this method returns [constant LOAD_STATUS_NOT_LOADED].
2021-06-19 17:58:49 +02:00
</description>
</method>
</methods>
2023-08-05 03:34:14 +02:00
<signals >
2024-07-05 16:16:36 +02:00
<signal name= "extension_loaded" >
<param index= "0" name= "extension" type= "GDExtension" />
<description >
Emitted after the editor has finished loading a new extension.
[b]Note:[/b] This signal is only emitted in editor builds.
</description>
</signal>
<signal name= "extension_unloading" >
<param index= "0" name= "extension" type= "GDExtension" />
<description >
Emitted before the editor starts unloading an extension.
[b]Note:[/b] This signal is only emitted in editor builds.
</description>
</signal>
2023-08-05 03:34:14 +02:00
<signal name= "extensions_reloaded" >
<description >
2024-01-08 15:44:06 +01:00
Emitted after the editor has finished reloading one or more extensions.
2023-08-05 03:34:14 +02:00
</description>
</signal>
</signals>
2021-06-19 17:58:49 +02:00
<constants >
<constant name= "LOAD_STATUS_OK" value= "0" enum= "LoadStatus" >
2024-01-08 15:44:06 +01:00
The extension has loaded successfully.
2021-06-19 17:58:49 +02:00
</constant>
<constant name= "LOAD_STATUS_FAILED" value= "1" enum= "LoadStatus" >
2024-01-08 15:44:06 +01:00
The extension has failed to load, possibly because it does not exist or has missing dependencies.
2021-06-19 17:58:49 +02:00
</constant>
<constant name= "LOAD_STATUS_ALREADY_LOADED" value= "2" enum= "LoadStatus" >
2024-01-08 15:44:06 +01:00
The extension has already been loaded.
2021-06-19 17:58:49 +02:00
</constant>
<constant name= "LOAD_STATUS_NOT_LOADED" value= "3" enum= "LoadStatus" >
2024-01-08 15:44:06 +01:00
The extension has not been loaded.
2021-06-19 17:58:49 +02:00
</constant>
<constant name= "LOAD_STATUS_NEEDS_RESTART" value= "4" enum= "LoadStatus" >
2024-01-08 15:44:06 +01:00
The extension requires the application to restart to fully load.
2021-06-19 17:58:49 +02:00
</constant>
</constants>
</class>