Files
godot-docs/classes/class_gdextensionmanager.rst
2024-10-04 02:15:35 +00:00

216 lines
9.4 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/GDExtensionManager.xml.
.. _class_GDExtensionManager:
GDExtensionManager
==================
**Inherits:** :ref:`Object<class_Object>`
Provides access to GDExtension functionality.
.. rst-class:: classref-introduction-group
Description
-----------
The GDExtensionManager loads, initializes, and keeps track of all available :ref:`GDExtension<class_GDExtension>` libraries in the project.
\ **Note:** Do not worry about GDExtension unless you know what you are doing.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`GDExtension overview <../tutorials/scripting/gdextension/what_is_gdextension>`
- :doc:`GDExtension example in C++ <../tutorials/scripting/gdextension/gdextension_cpp_example>`
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| :ref:`GDExtension<class_GDExtension>` | :ref:`get_extension<class_GDExtensionManager_method_get_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_loaded_extensions<class_GDExtensionManager_method_get_loaded_extensions>`\ (\ ) |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_extension_loaded<class_GDExtensionManager_method_is_extension_loaded>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`load_extension<class_GDExtensionManager_method_load_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`reload_extension<class_GDExtensionManager_method_reload_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`unload_extension<class_GDExtensionManager_method_unload_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_GDExtensionManager_signal_extensions_reloaded:
.. rst-class:: classref-signal
**extensions_reloaded**\ (\ ) :ref:`🔗<class_GDExtensionManager_signal_extensions_reloaded>`
Emitted after the editor has finished reloading one or more extensions.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_GDExtensionManager_LoadStatus:
.. rst-class:: classref-enumeration
enum **LoadStatus**: :ref:`🔗<enum_GDExtensionManager_LoadStatus>`
.. _class_GDExtensionManager_constant_LOAD_STATUS_OK:
.. rst-class:: classref-enumeration-constant
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_OK** = ``0``
The extension has loaded successfully.
.. _class_GDExtensionManager_constant_LOAD_STATUS_FAILED:
.. rst-class:: classref-enumeration-constant
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_FAILED** = ``1``
The extension has failed to load, possibly because it does not exist or has missing dependencies.
.. _class_GDExtensionManager_constant_LOAD_STATUS_ALREADY_LOADED:
.. rst-class:: classref-enumeration-constant
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_ALREADY_LOADED** = ``2``
The extension has already been loaded.
.. _class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED:
.. rst-class:: classref-enumeration-constant
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_NOT_LOADED** = ``3``
The extension has not been loaded.
.. _class_GDExtensionManager_constant_LOAD_STATUS_NEEDS_RESTART:
.. rst-class:: classref-enumeration-constant
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_NEEDS_RESTART** = ``4``
The extension requires the application to restart to fully load.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_GDExtensionManager_method_get_extension:
.. rst-class:: classref-method
:ref:`GDExtension<class_GDExtension>` **get_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_get_extension>`
Returns the :ref:`GDExtension<class_GDExtension>` at the given file ``path``, or ``null`` if it has not been loaded or does not exist.
.. rst-class:: classref-item-separator
----
.. _class_GDExtensionManager_method_get_loaded_extensions:
.. rst-class:: classref-method
:ref:`PackedStringArray<class_PackedStringArray>` **get_loaded_extensions**\ (\ ) |const| :ref:`🔗<class_GDExtensionManager_method_get_loaded_extensions>`
Returns the file paths of all currently loaded extensions.
.. rst-class:: classref-item-separator
----
.. _class_GDExtensionManager_method_is_extension_loaded:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_extension_loaded**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_GDExtensionManager_method_is_extension_loaded>`
Returns ``true`` if the extension at the given file ``path`` has already been loaded successfully. See also :ref:`get_loaded_extensions<class_GDExtensionManager_method_get_loaded_extensions>`.
.. rst-class:: classref-item-separator
----
.. _class_GDExtensionManager_method_load_extension:
.. rst-class:: classref-method
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **load_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_load_extension>`
Loads an extension by absolute file path. The ``path`` needs to point to a valid :ref:`GDExtension<class_GDExtension>`. Returns :ref:`LOAD_STATUS_OK<class_GDExtensionManager_constant_LOAD_STATUS_OK>` if successful.
.. rst-class:: classref-item-separator
----
.. _class_GDExtensionManager_method_reload_extension:
.. rst-class:: classref-method
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **reload_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_reload_extension>`
Reloads the extension at the given file path. The ``path`` needs to point to a valid :ref:`GDExtension<class_GDExtension>`, otherwise this method may return either :ref:`LOAD_STATUS_NOT_LOADED<class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED>` or :ref:`LOAD_STATUS_FAILED<class_GDExtensionManager_constant_LOAD_STATUS_FAILED>`.
\ **Note:** You can only reload extensions in the editor. In release builds, this method always fails and returns :ref:`LOAD_STATUS_FAILED<class_GDExtensionManager_constant_LOAD_STATUS_FAILED>`.
.. rst-class:: classref-item-separator
----
.. _class_GDExtensionManager_method_unload_extension:
.. rst-class:: classref-method
:ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **unload_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_unload_extension>`
Unloads an extension by file path. The ``path`` needs to point to an already loaded :ref:`GDExtension<class_GDExtension>`, otherwise this method returns :ref:`LOAD_STATUS_NOT_LOADED<class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED>`.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
.. |void| replace:: :abbr:`void (No return value.)`