class_gdextensionmanager.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GDExtensionManager.xml.
  6. .. _class_GDExtensionManager:
  7. GDExtensionManager
  8. ==================
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Provides access to GDExtension functionality.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The GDExtensionManager loads, initializes, and keeps track of all available :ref:`GDExtension<class_GDExtension>` libraries in the project.
  15. \ **Note:** Do not worry about GDExtension unless you know what you are doing.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`GDExtension overview <../tutorials/scripting/gdextension/what_is_gdextension>`
  20. - :doc:`GDExtension example in C++ <../tutorials/scripting/cpp/gdextension_cpp_example>`
  21. .. rst-class:: classref-reftable-group
  22. Methods
  23. -------
  24. .. table::
  25. :widths: auto
  26. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`GDExtension<class_GDExtension>` | :ref:`get_extension<class_GDExtensionManager_method_get_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
  28. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_loaded_extensions<class_GDExtensionManager_method_get_loaded_extensions>`\ (\ ) |const| |
  30. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`is_extension_loaded<class_GDExtensionManager_method_is_extension_loaded>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
  32. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`load_extension<class_GDExtensionManager_method_load_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
  34. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`load_extension_from_function<class_GDExtensionManager_method_load_extension_from_function>`\ (\ path\: :ref:`String<class_String>`, init_func\: ``const GDExtensionInitializationFunction*``\ ) |
  36. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`reload_extension<class_GDExtensionManager_method_reload_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
  38. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`unload_extension<class_GDExtensionManager_method_unload_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
  40. +-------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. .. rst-class:: classref-section-separator
  42. ----
  43. .. rst-class:: classref-descriptions-group
  44. Signals
  45. -------
  46. .. _class_GDExtensionManager_signal_extension_loaded:
  47. .. rst-class:: classref-signal
  48. **extension_loaded**\ (\ extension\: :ref:`GDExtension<class_GDExtension>`\ ) :ref:`🔗<class_GDExtensionManager_signal_extension_loaded>`
  49. Emitted after the editor has finished loading a new extension.
  50. \ **Note:** This signal is only emitted in editor builds.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_GDExtensionManager_signal_extension_unloading:
  54. .. rst-class:: classref-signal
  55. **extension_unloading**\ (\ extension\: :ref:`GDExtension<class_GDExtension>`\ ) :ref:`🔗<class_GDExtensionManager_signal_extension_unloading>`
  56. Emitted before the editor starts unloading an extension.
  57. \ **Note:** This signal is only emitted in editor builds.
  58. .. rst-class:: classref-item-separator
  59. ----
  60. .. _class_GDExtensionManager_signal_extensions_reloaded:
  61. .. rst-class:: classref-signal
  62. **extensions_reloaded**\ (\ ) :ref:`🔗<class_GDExtensionManager_signal_extensions_reloaded>`
  63. Emitted after the editor has finished reloading one or more extensions.
  64. .. rst-class:: classref-section-separator
  65. ----
  66. .. rst-class:: classref-descriptions-group
  67. Enumerations
  68. ------------
  69. .. _enum_GDExtensionManager_LoadStatus:
  70. .. rst-class:: classref-enumeration
  71. enum **LoadStatus**: :ref:`🔗<enum_GDExtensionManager_LoadStatus>`
  72. .. _class_GDExtensionManager_constant_LOAD_STATUS_OK:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_OK** = ``0``
  75. The extension has loaded successfully.
  76. .. _class_GDExtensionManager_constant_LOAD_STATUS_FAILED:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_FAILED** = ``1``
  79. The extension has failed to load, possibly because it does not exist or has missing dependencies.
  80. .. _class_GDExtensionManager_constant_LOAD_STATUS_ALREADY_LOADED:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_ALREADY_LOADED** = ``2``
  83. The extension has already been loaded.
  84. .. _class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_NOT_LOADED** = ``3``
  87. The extension has not been loaded.
  88. .. _class_GDExtensionManager_constant_LOAD_STATUS_NEEDS_RESTART:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_NEEDS_RESTART** = ``4``
  91. The extension requires the application to restart to fully load.
  92. .. rst-class:: classref-section-separator
  93. ----
  94. .. rst-class:: classref-descriptions-group
  95. Method Descriptions
  96. -------------------
  97. .. _class_GDExtensionManager_method_get_extension:
  98. .. rst-class:: classref-method
  99. :ref:`GDExtension<class_GDExtension>` **get_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_get_extension>`
  100. Returns the :ref:`GDExtension<class_GDExtension>` at the given file ``path``, or ``null`` if it has not been loaded or does not exist.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_GDExtensionManager_method_get_loaded_extensions:
  104. .. rst-class:: classref-method
  105. :ref:`PackedStringArray<class_PackedStringArray>` **get_loaded_extensions**\ (\ ) |const| :ref:`🔗<class_GDExtensionManager_method_get_loaded_extensions>`
  106. Returns the file paths of all currently loaded extensions.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_GDExtensionManager_method_is_extension_loaded:
  110. .. rst-class:: classref-method
  111. :ref:`bool<class_bool>` **is_extension_loaded**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_GDExtensionManager_method_is_extension_loaded>`
  112. 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>`.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_GDExtensionManager_method_load_extension:
  116. .. rst-class:: classref-method
  117. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **load_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_load_extension>`
  118. 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.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_GDExtensionManager_method_load_extension_from_function:
  122. .. rst-class:: classref-method
  123. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **load_extension_from_function**\ (\ path\: :ref:`String<class_String>`, init_func\: ``const GDExtensionInitializationFunction*``\ ) :ref:`🔗<class_GDExtensionManager_method_load_extension_from_function>`
  124. Loads the extension already in address space via the given path and initialization function. The ``path`` needs to be unique and start with ``"libgodot://"``. Returns :ref:`LOAD_STATUS_OK<class_GDExtensionManager_constant_LOAD_STATUS_OK>` if successful.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_GDExtensionManager_method_reload_extension:
  128. .. rst-class:: classref-method
  129. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **reload_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_reload_extension>`
  130. 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>`.
  131. \ **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>`.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_GDExtensionManager_method_unload_extension:
  135. .. rst-class:: classref-method
  136. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **unload_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_unload_extension>`
  137. 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>`.
  138. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  139. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  140. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  141. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  142. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  143. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  144. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  145. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  146. .. |void| replace:: :abbr:`void (No return value.)`