class_gdextensionmanager.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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/gdextension/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:`reload_extension<class_GDExtensionManager_method_reload_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
  36. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` | :ref:`unload_extension<class_GDExtensionManager_method_unload_extension>`\ (\ path\: :ref:`String<class_String>`\ ) |
  38. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Signals
  43. -------
  44. .. _class_GDExtensionManager_signal_extension_loaded:
  45. .. rst-class:: classref-signal
  46. **extension_loaded**\ (\ extension\: :ref:`GDExtension<class_GDExtension>`\ ) :ref:`🔗<class_GDExtensionManager_signal_extension_loaded>`
  47. Emitted after the editor has finished loading a new extension.
  48. \ **Note:** This signal is only emitted in editor builds.
  49. .. rst-class:: classref-item-separator
  50. ----
  51. .. _class_GDExtensionManager_signal_extension_unloading:
  52. .. rst-class:: classref-signal
  53. **extension_unloading**\ (\ extension\: :ref:`GDExtension<class_GDExtension>`\ ) :ref:`🔗<class_GDExtensionManager_signal_extension_unloading>`
  54. Emitted before the editor starts unloading an extension.
  55. \ **Note:** This signal is only emitted in editor builds.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_GDExtensionManager_signal_extensions_reloaded:
  59. .. rst-class:: classref-signal
  60. **extensions_reloaded**\ (\ ) :ref:`🔗<class_GDExtensionManager_signal_extensions_reloaded>`
  61. Emitted after the editor has finished reloading one or more extensions.
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Enumerations
  66. ------------
  67. .. _enum_GDExtensionManager_LoadStatus:
  68. .. rst-class:: classref-enumeration
  69. enum **LoadStatus**: :ref:`🔗<enum_GDExtensionManager_LoadStatus>`
  70. .. _class_GDExtensionManager_constant_LOAD_STATUS_OK:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_OK** = ``0``
  73. The extension has loaded successfully.
  74. .. _class_GDExtensionManager_constant_LOAD_STATUS_FAILED:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_FAILED** = ``1``
  77. The extension has failed to load, possibly because it does not exist or has missing dependencies.
  78. .. _class_GDExtensionManager_constant_LOAD_STATUS_ALREADY_LOADED:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_ALREADY_LOADED** = ``2``
  81. The extension has already been loaded.
  82. .. _class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_NOT_LOADED** = ``3``
  85. The extension has not been loaded.
  86. .. _class_GDExtensionManager_constant_LOAD_STATUS_NEEDS_RESTART:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **LOAD_STATUS_NEEDS_RESTART** = ``4``
  89. The extension requires the application to restart to fully load.
  90. .. rst-class:: classref-section-separator
  91. ----
  92. .. rst-class:: classref-descriptions-group
  93. Method Descriptions
  94. -------------------
  95. .. _class_GDExtensionManager_method_get_extension:
  96. .. rst-class:: classref-method
  97. :ref:`GDExtension<class_GDExtension>` **get_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_get_extension>`
  98. Returns the :ref:`GDExtension<class_GDExtension>` at the given file ``path``, or ``null`` if it has not been loaded or does not exist.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_GDExtensionManager_method_get_loaded_extensions:
  102. .. rst-class:: classref-method
  103. :ref:`PackedStringArray<class_PackedStringArray>` **get_loaded_extensions**\ (\ ) |const| :ref:`🔗<class_GDExtensionManager_method_get_loaded_extensions>`
  104. Returns the file paths of all currently loaded extensions.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_GDExtensionManager_method_is_extension_loaded:
  108. .. rst-class:: classref-method
  109. :ref:`bool<class_bool>` **is_extension_loaded**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_GDExtensionManager_method_is_extension_loaded>`
  110. 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>`.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_GDExtensionManager_method_load_extension:
  114. .. rst-class:: classref-method
  115. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **load_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_load_extension>`
  116. 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.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_GDExtensionManager_method_reload_extension:
  120. .. rst-class:: classref-method
  121. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **reload_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_reload_extension>`
  122. 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>`.
  123. \ **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>`.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_GDExtensionManager_method_unload_extension:
  127. .. rst-class:: classref-method
  128. :ref:`LoadStatus<enum_GDExtensionManager_LoadStatus>` **unload_extension**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GDExtensionManager_method_unload_extension>`
  129. 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>`.
  130. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  131. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  132. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  133. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  134. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  135. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  136. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  137. .. |void| replace:: :abbr:`void (No return value.)`