mirror of
https://github.com/godotengine/godot-headers.git
synced 2026-02-24 10:33:43 +03:00
Compare commits
2 Commits
4.3
...
godot-4.5-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c30ca5e32e | ||
|
|
678fb7aeaf |
35630
extension_api.json
35630
extension_api.json
File diff suppressed because it is too large
Load Diff
@@ -28,22 +28,22 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef GDEXTENSION_INTERFACE_H
|
||||
#define GDEXTENSION_INTERFACE_H
|
||||
#pragma once
|
||||
|
||||
/* This is a C class header, you can copy it and use it directly in your own binders.
|
||||
* Together with the JSON file, you should be able to generate any binder.
|
||||
*/
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef uint32_t char32_t;
|
||||
typedef uint16_t char16_t;
|
||||
#endif
|
||||
#else
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -198,6 +198,7 @@ typedef struct {
|
||||
|
||||
typedef void (*GDExtensionVariantFromTypeConstructorFunc)(GDExtensionUninitializedVariantPtr, GDExtensionTypePtr);
|
||||
typedef void (*GDExtensionTypeFromVariantConstructorFunc)(GDExtensionUninitializedTypePtr, GDExtensionVariantPtr);
|
||||
typedef void *(*GDExtensionVariantGetInternalPtrFunc)(GDExtensionVariantPtr);
|
||||
typedef void (*GDExtensionPtrOperatorEvaluator)(GDExtensionConstTypePtr p_left, GDExtensionConstTypePtr p_right, GDExtensionTypePtr r_result);
|
||||
typedef void (*GDExtensionPtrBuiltInMethod)(GDExtensionTypePtr p_base, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_return, int p_argument_count);
|
||||
typedef void (*GDExtensionPtrConstructor)(GDExtensionUninitializedTypePtr p_base, const GDExtensionConstTypePtr *p_args);
|
||||
@@ -268,10 +269,13 @@ typedef void (*GDExtensionClassReference)(GDExtensionClassInstancePtr p_instance
|
||||
typedef void (*GDExtensionClassUnreference)(GDExtensionClassInstancePtr p_instance);
|
||||
typedef void (*GDExtensionClassCallVirtual)(GDExtensionClassInstancePtr p_instance, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_ret);
|
||||
typedef GDExtensionObjectPtr (*GDExtensionClassCreateInstance)(void *p_class_userdata);
|
||||
typedef GDExtensionObjectPtr (*GDExtensionClassCreateInstance2)(void *p_class_userdata, GDExtensionBool p_notify_postinitialize);
|
||||
typedef void (*GDExtensionClassFreeInstance)(void *p_class_userdata, GDExtensionClassInstancePtr p_instance);
|
||||
typedef GDExtensionClassInstancePtr (*GDExtensionClassRecreateInstance)(void *p_class_userdata, GDExtensionObjectPtr p_object);
|
||||
typedef GDExtensionClassCallVirtual (*GDExtensionClassGetVirtual)(void *p_class_userdata, GDExtensionConstStringNamePtr p_name);
|
||||
typedef GDExtensionClassCallVirtual (*GDExtensionClassGetVirtual2)(void *p_class_userdata, GDExtensionConstStringNamePtr p_name, uint32_t p_hash);
|
||||
typedef void *(*GDExtensionClassGetVirtualCallData)(void *p_class_userdata, GDExtensionConstStringNamePtr p_name);
|
||||
typedef void *(*GDExtensionClassGetVirtualCallData2)(void *p_class_userdata, GDExtensionConstStringNamePtr p_name, uint32_t p_hash);
|
||||
typedef void (*GDExtensionClassCallVirtualWithData)(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name, void *p_virtual_call_userdata, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_ret);
|
||||
|
||||
typedef struct {
|
||||
@@ -292,7 +296,7 @@ typedef struct {
|
||||
GDExtensionClassGetVirtual get_virtual_func; // Queries a virtual function by name and returns a callback to invoke the requested virtual function.
|
||||
GDExtensionClassGetRID get_rid_func;
|
||||
void *class_userdata; // Per-class user data, later accessible in instance bindings.
|
||||
} GDExtensionClassCreationInfo; // Deprecated. Use GDExtensionClassCreationInfo3 instead.
|
||||
} GDExtensionClassCreationInfo; // Deprecated. Use GDExtensionClassCreationInfo4 instead.
|
||||
|
||||
typedef struct {
|
||||
GDExtensionBool is_virtual;
|
||||
@@ -325,7 +329,7 @@ typedef struct {
|
||||
GDExtensionClassCallVirtualWithData call_virtual_with_data_func;
|
||||
GDExtensionClassGetRID get_rid_func;
|
||||
void *class_userdata; // Per-class user data, later accessible in instance bindings.
|
||||
} GDExtensionClassCreationInfo2; // Deprecated. Use GDExtensionClassCreationInfo3 instead.
|
||||
} GDExtensionClassCreationInfo2; // Deprecated. Use GDExtensionClassCreationInfo4 instead.
|
||||
|
||||
typedef struct {
|
||||
GDExtensionBool is_virtual;
|
||||
@@ -359,10 +363,49 @@ typedef struct {
|
||||
GDExtensionClassCallVirtualWithData call_virtual_with_data_func;
|
||||
GDExtensionClassGetRID get_rid_func;
|
||||
void *class_userdata; // Per-class user data, later accessible in instance bindings.
|
||||
} GDExtensionClassCreationInfo3;
|
||||
} GDExtensionClassCreationInfo3; // Deprecated. Use GDExtensionClassCreationInfo4 instead.
|
||||
|
||||
typedef struct {
|
||||
GDExtensionBool is_virtual;
|
||||
GDExtensionBool is_abstract;
|
||||
GDExtensionBool is_exposed;
|
||||
GDExtensionBool is_runtime;
|
||||
GDExtensionConstStringPtr icon_path;
|
||||
GDExtensionClassSet set_func;
|
||||
GDExtensionClassGet get_func;
|
||||
GDExtensionClassGetPropertyList get_property_list_func;
|
||||
GDExtensionClassFreePropertyList2 free_property_list_func;
|
||||
GDExtensionClassPropertyCanRevert property_can_revert_func;
|
||||
GDExtensionClassPropertyGetRevert property_get_revert_func;
|
||||
GDExtensionClassValidateProperty validate_property_func;
|
||||
GDExtensionClassNotification2 notification_func;
|
||||
GDExtensionClassToString to_string_func;
|
||||
GDExtensionClassReference reference_func;
|
||||
GDExtensionClassUnreference unreference_func;
|
||||
GDExtensionClassCreateInstance2 create_instance_func; // (Default) constructor; mandatory. If the class is not instantiable, consider making it virtual or abstract.
|
||||
GDExtensionClassFreeInstance free_instance_func; // Destructor; mandatory.
|
||||
GDExtensionClassRecreateInstance recreate_instance_func;
|
||||
// Queries a virtual function by name and returns a callback to invoke the requested virtual function.
|
||||
GDExtensionClassGetVirtual2 get_virtual_func;
|
||||
// Paired with `call_virtual_with_data_func`, this is an alternative to `get_virtual_func` for extensions that
|
||||
// need or benefit from extra data when calling virtual functions.
|
||||
// Returns user data that will be passed to `call_virtual_with_data_func`.
|
||||
// Returning `NULL` from this function signals to Godot that the virtual function is not overridden.
|
||||
// Data returned from this function should be managed by the extension and must be valid until the extension is deinitialized.
|
||||
// You should supply either `get_virtual_func`, or `get_virtual_call_data_func` with `call_virtual_with_data_func`.
|
||||
GDExtensionClassGetVirtualCallData2 get_virtual_call_data_func;
|
||||
// Used to call virtual functions when `get_virtual_call_data_func` is not null.
|
||||
GDExtensionClassCallVirtualWithData call_virtual_with_data_func;
|
||||
void *class_userdata; // Per-class user data, later accessible in instance bindings.
|
||||
} GDExtensionClassCreationInfo4;
|
||||
|
||||
typedef GDExtensionClassCreationInfo4 GDExtensionClassCreationInfo5;
|
||||
|
||||
typedef void *GDExtensionClassLibraryPtr;
|
||||
|
||||
/* Passed a pointer to a PackedStringArray that should be filled with the classes that may be used by the GDExtension. */
|
||||
typedef void (*GDExtensionEditorGetClassesUsedCallback)(GDExtensionTypePtr p_packed_string_array);
|
||||
|
||||
/* Method */
|
||||
|
||||
typedef enum {
|
||||
@@ -386,7 +429,9 @@ typedef enum {
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT32,
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT64,
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_FLOAT,
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_DOUBLE
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_DOUBLE,
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_CHAR16,
|
||||
GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_CHAR32,
|
||||
} GDExtensionClassMethodArgumentMetadata;
|
||||
|
||||
typedef void (*GDExtensionClassMethodCall)(void *method_userdata, GDExtensionClassInstancePtr p_instance, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError *r_error);
|
||||
@@ -681,6 +726,9 @@ typedef struct {
|
||||
|
||||
} GDExtensionScriptInstanceInfo3;
|
||||
|
||||
typedef void (*GDExtensionWorkerThreadPoolGroupTask)(void *, uint32_t);
|
||||
typedef void (*GDExtensionWorkerThreadPoolTask)(void *);
|
||||
|
||||
/* INITIALIZATION */
|
||||
|
||||
typedef enum {
|
||||
@@ -691,6 +739,9 @@ typedef enum {
|
||||
GDEXTENSION_MAX_INITIALIZATION_LEVEL,
|
||||
} GDExtensionInitializationLevel;
|
||||
|
||||
typedef void (*GDExtensionInitializeCallback)(void *p_userdata, GDExtensionInitializationLevel p_level);
|
||||
typedef void (*GDExtensionDeinitializeCallback)(void *p_userdata, GDExtensionInitializationLevel p_level);
|
||||
|
||||
typedef struct {
|
||||
/* Minimum initialization level required.
|
||||
* If Core or Servers, the extension needs editor or game restart to take effect */
|
||||
@@ -698,8 +749,8 @@ typedef struct {
|
||||
/* Up to the user to supply when initializing */
|
||||
void *userdata;
|
||||
/* This function will be called multiple times for each initialization level. */
|
||||
void (*initialize)(void *userdata, GDExtensionInitializationLevel p_level);
|
||||
void (*deinitialize)(void *userdata, GDExtensionInitializationLevel p_level);
|
||||
GDExtensionInitializeCallback initialize;
|
||||
GDExtensionDeinitializeCallback deinitialize;
|
||||
} GDExtensionInitialization;
|
||||
|
||||
typedef void (*GDExtensionInterfaceFunctionPtr)();
|
||||
@@ -750,9 +801,41 @@ typedef struct {
|
||||
const char *string;
|
||||
} GDExtensionGodotVersion;
|
||||
|
||||
typedef struct {
|
||||
uint32_t major;
|
||||
uint32_t minor;
|
||||
uint32_t patch;
|
||||
uint32_t hex; // Full version encoded as hexadecimal with one byte (2 hex digits) per number (e.g. for "3.1.12" it would be 0x03010C)
|
||||
const char *status; // (e.g. "stable", "beta", "rc1", "rc2")
|
||||
const char *build; // (e.g. "custom_build")
|
||||
const char *hash; // Full Git commit hash.
|
||||
uint64_t timestamp; // Git commit date UNIX timestamp in seconds, or 0 if unavailable.
|
||||
const char *string; // (e.g. "Godot v3.1.4.stable.official.mono")
|
||||
} GDExtensionGodotVersion2;
|
||||
|
||||
/* Called when starting the main loop. */
|
||||
typedef void (*GDExtensionMainLoopStartupCallback)();
|
||||
|
||||
/* Called when shutting down the main loop. */
|
||||
typedef void (*GDExtensionMainLoopShutdownCallback)();
|
||||
|
||||
/* Called for every frame iteration of the main loop. */
|
||||
typedef void (*GDExtensionMainLoopFrameCallback)();
|
||||
|
||||
typedef struct {
|
||||
// Will be called after Godot is started and is fully initialized.
|
||||
GDExtensionMainLoopStartupCallback startup_func;
|
||||
// Will be called before Godot is shutdown when it is still fully initialized.
|
||||
GDExtensionMainLoopShutdownCallback shutdown_func;
|
||||
// Will be called for each process frame. This will run after all `_process()` methods on Node, and before `ScriptServer::frame()`.
|
||||
// This is intended to be the equivalent of `ScriptLanguage::frame()` for GDExtension language bindings that don't use the script API.
|
||||
GDExtensionMainLoopFrameCallback frame_func;
|
||||
} GDExtensionMainLoopCallbacks;
|
||||
|
||||
/**
|
||||
* @name get_godot_version
|
||||
* @since 4.1
|
||||
* @deprecated in Godot 4.5. Use `get_godot_version2` instead.
|
||||
*
|
||||
* Gets the Godot version that the GDExtension was loaded into.
|
||||
*
|
||||
@@ -760,6 +843,16 @@ typedef struct {
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceGetGodotVersion)(GDExtensionGodotVersion *r_godot_version);
|
||||
|
||||
/**
|
||||
* @name get_godot_version2
|
||||
* @since 4.5
|
||||
*
|
||||
* Gets the Godot version that the GDExtension was loaded into.
|
||||
*
|
||||
* @param r_godot_version A pointer to the structure to write the version information into.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceGetGodotVersion2)(GDExtensionGodotVersion2 *r_godot_version);
|
||||
|
||||
/* INTERFACE: Memory */
|
||||
|
||||
/**
|
||||
@@ -805,7 +898,7 @@ typedef void (*GDExtensionInterfaceMemFree)(void *p_ptr);
|
||||
*
|
||||
* Logs an error to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
* @param p_line The line where the error occurred.
|
||||
@@ -819,7 +912,7 @@ typedef void (*GDExtensionInterfacePrintError)(const char *p_description, const
|
||||
*
|
||||
* Logs an error with a message to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_message The message to show along with the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
@@ -834,7 +927,7 @@ typedef void (*GDExtensionInterfacePrintErrorWithMessage)(const char *p_descript
|
||||
*
|
||||
* Logs a warning to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the warning.
|
||||
* @param p_description The code triggering the warning.
|
||||
* @param p_function The function name where the warning occurred.
|
||||
* @param p_file The file where the warning occurred.
|
||||
* @param p_line The line where the warning occurred.
|
||||
@@ -848,7 +941,7 @@ typedef void (*GDExtensionInterfacePrintWarning)(const char *p_description, cons
|
||||
*
|
||||
* Logs a warning with a message to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the warning.
|
||||
* @param p_description The code triggering the warning.
|
||||
* @param p_message The message to show along with the warning.
|
||||
* @param p_function The function name where the warning occurred.
|
||||
* @param p_file The file where the warning occurred.
|
||||
@@ -863,7 +956,7 @@ typedef void (*GDExtensionInterfacePrintWarningWithMessage)(const char *p_descri
|
||||
*
|
||||
* Logs a script error to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
* @param p_line The line where the error occurred.
|
||||
@@ -877,7 +970,7 @@ typedef void (*GDExtensionInterfacePrintScriptError)(const char *p_description,
|
||||
*
|
||||
* Logs a script error with a message to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_message The message to show along with the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
@@ -954,7 +1047,7 @@ typedef void (*GDExtensionInterfaceVariantCall)(GDExtensionVariantPtr p_self, GD
|
||||
*
|
||||
* Calls a static method on a Variant.
|
||||
*
|
||||
* @param p_self A pointer to the Variant.
|
||||
* @param p_type The variant type.
|
||||
* @param p_method A pointer to a StringName identifying the method.
|
||||
* @param p_args A pointer to a C array of Variant.
|
||||
* @param p_argument_count The number of arguments.
|
||||
@@ -1240,7 +1333,7 @@ typedef GDExtensionVariantType (*GDExtensionInterfaceVariantGetType)(GDExtension
|
||||
* @param p_self A pointer to the Variant.
|
||||
* @param p_method A pointer to a StringName with the method name.
|
||||
*
|
||||
* @return
|
||||
* @return true if the variant has the given method; otherwise false.
|
||||
*/
|
||||
typedef GDExtensionBool (*GDExtensionInterfaceVariantHasMethod)(GDExtensionConstVariantPtr p_self, GDExtensionConstStringNamePtr p_method);
|
||||
|
||||
@@ -1253,7 +1346,7 @@ typedef GDExtensionBool (*GDExtensionInterfaceVariantHasMethod)(GDExtensionConst
|
||||
* @param p_type The Variant type.
|
||||
* @param p_member A pointer to a StringName with the member name.
|
||||
*
|
||||
* @return
|
||||
* @return true if the variant has the given method; otherwise false.
|
||||
*/
|
||||
typedef GDExtensionBool (*GDExtensionInterfaceVariantHasMember)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_member);
|
||||
|
||||
@@ -1271,6 +1364,21 @@ typedef GDExtensionBool (*GDExtensionInterfaceVariantHasMember)(GDExtensionVaria
|
||||
*/
|
||||
typedef GDExtensionBool (*GDExtensionInterfaceVariantHasKey)(GDExtensionConstVariantPtr p_self, GDExtensionConstVariantPtr p_key, GDExtensionBool *r_valid);
|
||||
|
||||
/**
|
||||
* @name variant_get_object_instance_id
|
||||
* @since 4.4
|
||||
*
|
||||
* Gets the object instance ID from a variant of type GDEXTENSION_VARIANT_TYPE_OBJECT.
|
||||
*
|
||||
* If the variant isn't of type GDEXTENSION_VARIANT_TYPE_OBJECT, then zero will be returned.
|
||||
* The instance ID will be returned even if the object is no longer valid - use `object_get_instance_by_id()` to check if the object is still valid.
|
||||
*
|
||||
* @param p_self A pointer to the Variant.
|
||||
*
|
||||
* @return The instance ID for the contained object.
|
||||
*/
|
||||
typedef GDObjectInstanceID (*GDExtensionInterfaceVariantGetObjectInstanceId)(GDExtensionConstVariantPtr p_self);
|
||||
|
||||
/**
|
||||
* @name variant_get_type_name
|
||||
* @since 4.1
|
||||
@@ -1332,6 +1440,23 @@ typedef GDExtensionVariantFromTypeConstructorFunc (*GDExtensionInterfaceGetVaria
|
||||
*/
|
||||
typedef GDExtensionTypeFromVariantConstructorFunc (*GDExtensionInterfaceGetVariantToTypeConstructor)(GDExtensionVariantType p_type);
|
||||
|
||||
/**
|
||||
* @name variant_get_ptr_internal_getter
|
||||
* @since 4.4
|
||||
*
|
||||
* Provides a function pointer for retrieving a pointer to a variant's internal value.
|
||||
* Access to a variant's internal value can be used to modify it in-place, or to retrieve its value without the overhead of variant conversion functions.
|
||||
* It is recommended to cache the getter for all variant types in a function table to avoid retrieval overhead upon use.
|
||||
*
|
||||
* @note Each function assumes the variant's type has already been determined and matches the function.
|
||||
* Invoking the function with a variant of a mismatched type has undefined behavior, and may lead to a segmentation fault.
|
||||
*
|
||||
* @param p_type The Variant type.
|
||||
*
|
||||
* @return A pointer to a type-specific function that returns a pointer to the internal value of a variant. Check the implementation of this function (gdextension_variant_get_ptr_internal_getter) for pointee type info of each variant type.
|
||||
*/
|
||||
typedef GDExtensionVariantGetInternalPtrFunc (*GDExtensionInterfaceGetVariantGetInternalPtrFunc)(GDExtensionVariantType p_type);
|
||||
|
||||
/**
|
||||
* @name variant_get_ptr_operator_evaluator
|
||||
* @since 4.1
|
||||
@@ -1392,7 +1517,7 @@ typedef GDExtensionPtrDestructor (*GDExtensionInterfaceVariantGetPtrDestructor)(
|
||||
* Constructs a Variant of the given type, using the first constructor that matches the given arguments.
|
||||
*
|
||||
* @param p_type The Variant type.
|
||||
* @param p_base A pointer to a Variant to store the constructed value.
|
||||
* @param r_base A pointer to a Variant to store the constructed value.
|
||||
* @param p_args A pointer to a C array of Variant pointers representing the arguments for the constructor.
|
||||
* @param p_argument_count The number of arguments to pass to the constructor.
|
||||
* @param r_error A pointer the structure which will be updated with error information.
|
||||
@@ -1615,7 +1740,7 @@ typedef GDExtensionInt (*GDExtensionInterfaceStringNewWithUtf8CharsAndLen2)(GDEx
|
||||
*
|
||||
* @param r_dest A pointer to a Variant to hold the newly created String.
|
||||
* @param p_contents A pointer to a UTF-16 encoded C string.
|
||||
* @param p_size The number of characters (not bytes).
|
||||
* @param p_char_count The number of characters (not bytes).
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceStringNewWithUtf16CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char16_t *p_contents, GDExtensionInt p_char_count);
|
||||
|
||||
@@ -1627,7 +1752,7 @@ typedef void (*GDExtensionInterfaceStringNewWithUtf16CharsAndLen)(GDExtensionUni
|
||||
*
|
||||
* @param r_dest A pointer to a Variant to hold the newly created String.
|
||||
* @param p_contents A pointer to a UTF-16 encoded C string.
|
||||
* @param p_size The number of characters (not bytes).
|
||||
* @param p_char_count The number of characters (not bytes).
|
||||
* @param p_default_little_endian If true, UTF-16 use little endian.
|
||||
*
|
||||
* @return Error code signifying if the operation successful.
|
||||
@@ -1642,7 +1767,7 @@ typedef GDExtensionInt (*GDExtensionInterfaceStringNewWithUtf16CharsAndLen2)(GDE
|
||||
*
|
||||
* @param r_dest A pointer to a Variant to hold the newly created String.
|
||||
* @param p_contents A pointer to a UTF-32 encoded C string.
|
||||
* @param p_size The number of characters (not bytes).
|
||||
* @param p_char_count The number of characters (not bytes).
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceStringNewWithUtf32CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char32_t *p_contents, GDExtensionInt p_char_count);
|
||||
|
||||
@@ -1654,7 +1779,7 @@ typedef void (*GDExtensionInterfaceStringNewWithUtf32CharsAndLen)(GDExtensionUni
|
||||
*
|
||||
* @param r_dest A pointer to a Variant to hold the newly created String.
|
||||
* @param p_contents A pointer to a wide C string.
|
||||
* @param p_size The number of characters (not bytes).
|
||||
* @param p_char_count The number of characters (not bytes).
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceStringNewWithWideCharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const wchar_t *p_contents, GDExtensionInt p_char_count);
|
||||
|
||||
@@ -1971,6 +2096,7 @@ typedef const uint8_t *(*GDExtensionInterfaceImagePtr)(GDExtensionObjectPtr p_in
|
||||
* @param p_instance A pointer to a WorkerThreadPool object.
|
||||
* @param p_func A pointer to a function to run in the thread pool.
|
||||
* @param p_userdata A pointer to arbitrary data which will be passed to p_func.
|
||||
* @param p_elements The number of element needed in the group.
|
||||
* @param p_tasks The number of tasks needed in the group.
|
||||
* @param p_high_priority Whether or not this is a high priority task.
|
||||
* @param p_description A pointer to a String with the task description.
|
||||
@@ -1979,7 +2105,7 @@ typedef const uint8_t *(*GDExtensionInterfaceImagePtr)(GDExtensionObjectPtr p_in
|
||||
*
|
||||
* @see WorkerThreadPool::add_group_task()
|
||||
*/
|
||||
typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeGroupTask)(GDExtensionObjectPtr p_instance, void (*p_func)(void *, uint32_t), void *p_userdata, int p_elements, int p_tasks, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description);
|
||||
typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeGroupTask)(GDExtensionObjectPtr p_instance, GDExtensionWorkerThreadPoolGroupTask p_func, void *p_userdata, int p_elements, int p_tasks, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description);
|
||||
|
||||
/**
|
||||
* @name worker_thread_pool_add_native_task
|
||||
@@ -1995,7 +2121,7 @@ typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeGroupTask)(GDExte
|
||||
*
|
||||
* @return The task ID.
|
||||
*/
|
||||
typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeTask)(GDExtensionObjectPtr p_instance, void (*p_func)(void *), void *p_userdata, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description);
|
||||
typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeTask)(GDExtensionObjectPtr p_instance, GDExtensionWorkerThreadPoolTask p_func, void *p_userdata, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description);
|
||||
|
||||
/* INTERFACE: Packed Array */
|
||||
|
||||
@@ -2288,6 +2414,7 @@ typedef GDExtensionVariantPtr (*GDExtensionInterfaceArrayOperatorIndexConst)(GDE
|
||||
/**
|
||||
* @name array_ref
|
||||
* @since 4.1
|
||||
* @deprecated in Godot 4.5. use `Array::operator=` instead.
|
||||
*
|
||||
* Sets an Array to be a reference to another Array object.
|
||||
*
|
||||
@@ -2337,6 +2464,22 @@ typedef GDExtensionVariantPtr (*GDExtensionInterfaceDictionaryOperatorIndex)(GDE
|
||||
*/
|
||||
typedef GDExtensionVariantPtr (*GDExtensionInterfaceDictionaryOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionConstVariantPtr p_key);
|
||||
|
||||
/**
|
||||
* @name dictionary_set_typed
|
||||
* @since 4.4
|
||||
*
|
||||
* Makes a Dictionary into a typed Dictionary.
|
||||
*
|
||||
* @param p_self A pointer to the Dictionary.
|
||||
* @param p_key_type The type of Variant the Dictionary key will store.
|
||||
* @param p_key_class_name A pointer to a StringName with the name of the object (if p_key_type is GDEXTENSION_VARIANT_TYPE_OBJECT).
|
||||
* @param p_key_script A pointer to a Script object (if p_key_type is GDEXTENSION_VARIANT_TYPE_OBJECT and the base class is extended by a script).
|
||||
* @param p_value_type The type of Variant the Dictionary value will store.
|
||||
* @param p_value_class_name A pointer to a StringName with the name of the object (if p_value_type is GDEXTENSION_VARIANT_TYPE_OBJECT).
|
||||
* @param p_value_script A pointer to a Script object (if p_value_type is GDEXTENSION_VARIANT_TYPE_OBJECT and the base class is extended by a script).
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceDictionarySetTyped)(GDExtensionTypePtr p_self, GDExtensionVariantType p_key_type, GDExtensionConstStringNamePtr p_key_class_name, GDExtensionConstVariantPtr p_key_script, GDExtensionVariantType p_value_type, GDExtensionConstStringNamePtr p_value_class_name, GDExtensionConstVariantPtr p_value_script);
|
||||
|
||||
/* INTERFACE: Object */
|
||||
|
||||
/**
|
||||
@@ -2396,10 +2539,10 @@ typedef GDExtensionObjectPtr (*GDExtensionInterfaceGlobalGetSingleton)(GDExtensi
|
||||
* Gets a pointer representing an Object's instance binding.
|
||||
*
|
||||
* @param p_o A pointer to the Object.
|
||||
* @param p_library A token the library received by the GDExtension's entry point function.
|
||||
* @param p_token A token the library received by the GDExtension's entry point function.
|
||||
* @param p_callbacks A pointer to a GDExtensionInstanceBindingCallbacks struct.
|
||||
*
|
||||
* @return
|
||||
* @return A pointer to the instance binding.
|
||||
*/
|
||||
typedef void *(*GDExtensionInterfaceObjectGetInstanceBinding)(GDExtensionObjectPtr p_o, void *p_token, const GDExtensionInstanceBindingCallbacks *p_callbacks);
|
||||
|
||||
@@ -2410,7 +2553,7 @@ typedef void *(*GDExtensionInterfaceObjectGetInstanceBinding)(GDExtensionObjectP
|
||||
* Sets an Object's instance binding.
|
||||
*
|
||||
* @param p_o A pointer to the Object.
|
||||
* @param p_library A token the library received by the GDExtension's entry point function.
|
||||
* @param p_token A token the library received by the GDExtension's entry point function.
|
||||
* @param p_binding A pointer to the instance binding.
|
||||
* @param p_callbacks A pointer to a GDExtensionInstanceBindingCallbacks struct.
|
||||
*/
|
||||
@@ -2423,7 +2566,7 @@ typedef void (*GDExtensionInterfaceObjectSetInstanceBinding)(GDExtensionObjectPt
|
||||
* Free an Object's instance binding.
|
||||
*
|
||||
* @param p_o A pointer to the Object.
|
||||
* @param p_library A token the library received by the GDExtension's entry point function.
|
||||
* @param p_token A token the library received by the GDExtension's entry point function.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceObjectFreeInstanceBinding)(GDExtensionObjectPtr p_o, void *p_token);
|
||||
|
||||
@@ -2433,11 +2576,13 @@ typedef void (*GDExtensionInterfaceObjectFreeInstanceBinding)(GDExtensionObjectP
|
||||
*
|
||||
* Sets an extension class instance on a Object.
|
||||
*
|
||||
* `p_classname` should be a registered extension class and should extend the `p_o` Object's class.
|
||||
*
|
||||
* @param p_o A pointer to the Object.
|
||||
* @param p_classname A pointer to a StringName with the registered extension class's name.
|
||||
* @param p_instance A pointer to the extension class instance.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceObjectSetInstance)(GDExtensionObjectPtr p_o, GDExtensionConstStringNamePtr p_classname, GDExtensionClassInstancePtr p_instance); /* p_classname should be a registered extension class and should extend the p_o object's class. */
|
||||
typedef void (*GDExtensionInterfaceObjectSetInstance)(GDExtensionObjectPtr p_o, GDExtensionConstStringNamePtr p_classname, GDExtensionClassInstancePtr p_instance);
|
||||
|
||||
/**
|
||||
* @name object_get_class_name
|
||||
@@ -2502,7 +2647,7 @@ typedef GDObjectInstanceID (*GDExtensionInterfaceObjectGetInstanceId)(GDExtensio
|
||||
* @param p_object A pointer to the Object.
|
||||
* @param p_method A pointer to a StringName identifying the method.
|
||||
*
|
||||
* @returns true if the object has a script and that script has a method with the given name. Returns false if the object has no script.
|
||||
* @return true if the object has a script and that script has a method with the given name. Returns false if the object has no script.
|
||||
*/
|
||||
typedef GDExtensionBool (*GDExtensionInterfaceObjectHasScriptMethod)(GDExtensionConstObjectPtr p_object, GDExtensionConstStringNamePtr p_method);
|
||||
|
||||
@@ -2633,6 +2778,17 @@ typedef void (*GDExtensionInterfacePlaceHolderScriptInstanceUpdate)(GDExtensionS
|
||||
*/
|
||||
typedef GDExtensionScriptInstanceDataPtr (*GDExtensionInterfaceObjectGetScriptInstance)(GDExtensionConstObjectPtr p_object, GDExtensionObjectPtr p_language);
|
||||
|
||||
/**
|
||||
* @name object_set_script_instance
|
||||
* @since 4.5
|
||||
*
|
||||
* Set the script instance data attached to this object.
|
||||
*
|
||||
* @param p_object A pointer to the Object.
|
||||
* @param p_script_instance A pointer to the script instance data to attach to this object.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceObjectSetScriptInstance)(GDExtensionObjectPtr p_object, GDExtensionScriptInstanceDataPtr p_script_instance);
|
||||
|
||||
/* INTERFACE: Callable */
|
||||
|
||||
/**
|
||||
@@ -2672,6 +2828,8 @@ typedef void (*GDExtensionInterfaceCallableCustomCreate2)(GDExtensionUninitializ
|
||||
*
|
||||
* @param p_callable A pointer to a Callable.
|
||||
* @param p_token A pointer to an address that uniquely identifies the GDExtension.
|
||||
*
|
||||
* @return The userdata pointer given when creating this custom Callable.
|
||||
*/
|
||||
typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstTypePtr p_callable, void *p_token);
|
||||
|
||||
@@ -2680,6 +2838,7 @@ typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstT
|
||||
/**
|
||||
* @name classdb_construct_object
|
||||
* @since 4.1
|
||||
* @deprecated in Godot 4.4. Use `classdb_construct_object2` instead.
|
||||
*
|
||||
* Constructs an Object of the requested class.
|
||||
*
|
||||
@@ -2691,6 +2850,22 @@ typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstT
|
||||
*/
|
||||
typedef GDExtensionObjectPtr (*GDExtensionInterfaceClassdbConstructObject)(GDExtensionConstStringNamePtr p_classname);
|
||||
|
||||
/**
|
||||
* @name classdb_construct_object2
|
||||
* @since 4.4
|
||||
*
|
||||
* Constructs an Object of the requested class.
|
||||
*
|
||||
* The passed class must be a built-in godot class, or an already-registered extension class. In both cases, object_set_instance() should be called to fully initialize the object.
|
||||
*
|
||||
* "NOTIFICATION_POSTINITIALIZE" must be sent after construction.
|
||||
*
|
||||
* @param p_classname A pointer to a StringName with the class name.
|
||||
*
|
||||
* @return A pointer to the newly created Object.
|
||||
*/
|
||||
typedef GDExtensionObjectPtr (*GDExtensionInterfaceClassdbConstructObject2)(GDExtensionConstStringNamePtr p_classname);
|
||||
|
||||
/**
|
||||
* @name classdb_get_method_bind
|
||||
* @since 4.1
|
||||
@@ -2722,7 +2897,7 @@ typedef void *(*GDExtensionInterfaceClassdbGetClassTag)(GDExtensionConstStringNa
|
||||
/**
|
||||
* @name classdb_register_extension_class
|
||||
* @since 4.1
|
||||
* @deprecated in Godot 4.2. Use `classdb_register_extension_class3` instead.
|
||||
* @deprecated in Godot 4.2. Use `classdb_register_extension_class4` instead.
|
||||
*
|
||||
* Registers an extension class in the ClassDB.
|
||||
*
|
||||
@@ -2738,7 +2913,7 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass)(GDExtensionCla
|
||||
/**
|
||||
* @name classdb_register_extension_class2
|
||||
* @since 4.2
|
||||
* @deprecated in Godot 4.3. Use `classdb_register_extension_class3` instead.
|
||||
* @deprecated in Godot 4.3. Use `classdb_register_extension_class4` instead.
|
||||
*
|
||||
* Registers an extension class in the ClassDB.
|
||||
*
|
||||
@@ -2754,6 +2929,7 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass2)(GDExtensionCl
|
||||
/**
|
||||
* @name classdb_register_extension_class3
|
||||
* @since 4.3
|
||||
* @deprecated in Godot 4.4. Use `classdb_register_extension_class4` instead.
|
||||
*
|
||||
* Registers an extension class in the ClassDB.
|
||||
*
|
||||
@@ -2762,10 +2938,41 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass2)(GDExtensionCl
|
||||
* @param p_library A pointer the library received by the GDExtension's entry point function.
|
||||
* @param p_class_name A pointer to a StringName with the class name.
|
||||
* @param p_parent_class_name A pointer to a StringName with the parent class name.
|
||||
* @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo2 struct.
|
||||
* @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo3 struct.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass3)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_parent_class_name, const GDExtensionClassCreationInfo3 *p_extension_funcs);
|
||||
|
||||
/**
|
||||
* @name classdb_register_extension_class4
|
||||
* @since 4.4
|
||||
* @deprecated in Godot 4.5. Use `classdb_register_extension_class5` instead.
|
||||
*
|
||||
* Registers an extension class in the ClassDB.
|
||||
*
|
||||
* Provided struct can be safely freed once the function returns.
|
||||
*
|
||||
* @param p_library A pointer the library received by the GDExtension's entry point function.
|
||||
* @param p_class_name A pointer to a StringName with the class name.
|
||||
* @param p_parent_class_name A pointer to a StringName with the parent class name.
|
||||
* @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo4 struct.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass4)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_parent_class_name, const GDExtensionClassCreationInfo4 *p_extension_funcs);
|
||||
|
||||
/**
|
||||
* @name classdb_register_extension_class5
|
||||
* @since 4.5
|
||||
*
|
||||
* Registers an extension class in the ClassDB.
|
||||
*
|
||||
* Provided struct can be safely freed once the function returns.
|
||||
*
|
||||
* @param p_library A pointer the library received by the GDExtension's entry point function.
|
||||
* @param p_class_name A pointer to a StringName with the class name.
|
||||
* @param p_parent_class_name A pointer to a StringName with the parent class name.
|
||||
* @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo5 struct.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass5)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_parent_class_name, const GDExtensionClassCreationInfo5 *p_extension_funcs);
|
||||
|
||||
/**
|
||||
* @name classdb_register_extension_class_method
|
||||
* @since 4.1
|
||||
@@ -2894,10 +3101,12 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassSignal)(GDExtens
|
||||
*
|
||||
* Unregisters an extension class in the ClassDB.
|
||||
*
|
||||
* Unregistering a parent class before a class that inherits it will result in failure. Inheritors must be unregistered first.
|
||||
*
|
||||
* @param p_library A pointer the library received by the GDExtension's entry point function.
|
||||
* @param p_class_name A pointer to a StringName with the class name.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceClassdbUnregisterExtensionClass)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name); /* Unregistering a parent class before a class that inherits it will result in failure. Inheritors must be unregistered first. */
|
||||
typedef void (*GDExtensionInterfaceClassdbUnregisterExtensionClass)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name);
|
||||
|
||||
/**
|
||||
* @name get_library_path
|
||||
@@ -2957,8 +3166,33 @@ typedef void (*GDExtensionsInterfaceEditorHelpLoadXmlFromUtf8Chars)(const char *
|
||||
*/
|
||||
typedef void (*GDExtensionsInterfaceEditorHelpLoadXmlFromUtf8CharsAndLen)(const char *p_data, GDExtensionInt p_size);
|
||||
|
||||
/**
|
||||
* @name editor_register_get_classes_used_callback
|
||||
* @since 4.5
|
||||
*
|
||||
* Registers a callback that Godot can call to get the list of all classes (from ClassDB) that may be used by the calling GDExtension.
|
||||
*
|
||||
* This is used by the editor to generate a build profile (in "Tools" > "Engine Compilation Configuration Editor..." > "Detect from project"),
|
||||
* in order to recompile Godot with only the classes used.
|
||||
* In the provided callback, the GDExtension should provide the list of classes that _may_ be used statically, thus the time of invocation shouldn't matter.
|
||||
* If a GDExtension doesn't register a callback, Godot will assume that it could be using any classes.
|
||||
*
|
||||
* @param p_library A pointer the library received by the GDExtension's entry point function.
|
||||
* @param p_callback The callback to retrieve the list of classes used.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceEditorRegisterGetClassesUsedCallback)(GDExtensionClassLibraryPtr p_library, GDExtensionEditorGetClassesUsedCallback p_callback);
|
||||
|
||||
/**
|
||||
* @name register_main_loop_callbacks
|
||||
* @since 4.5
|
||||
*
|
||||
* Registers callbacks to be called at different phases of the main loop.
|
||||
*
|
||||
* @param p_library A pointer the library received by the GDExtension's entry point function.
|
||||
* @param p_callbacks A pointer to the structure that contains the callbacks.
|
||||
*/
|
||||
typedef void (*GDExtensionInterfaceRegisterMainLoopCallbacks)(GDExtensionClassLibraryPtr p_library, const GDExtensionMainLoopCallbacks *p_callbacks);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GDEXTENSION_INTERFACE_H
|
||||
|
||||
Reference in New Issue
Block a user