diff options
Diffstat (limited to 'core/extension/gdextension_interface.h')
-rw-r--r-- | core/extension/gdextension_interface.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h index 6fe6b8df20..d6c1df9c00 100644 --- a/core/extension/gdextension_interface.h +++ b/core/extension/gdextension_interface.h @@ -1582,6 +1582,7 @@ typedef void (*GDExtensionInterfaceStringNewWithLatin1CharsAndLen)(GDExtensionUn /** * @name string_new_with_utf8_chars_and_len * @since 4.1 + * @deprecated in Godot 4.3. Use `string_new_with_utf8_chars_and_len2` instead. * * Creates a String from a UTF-8 encoded C string with the given length. * @@ -1592,8 +1593,23 @@ typedef void (*GDExtensionInterfaceStringNewWithLatin1CharsAndLen)(GDExtensionUn typedef void (*GDExtensionInterfaceStringNewWithUtf8CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char *p_contents, GDExtensionInt p_size); /** + * @name string_new_with_utf8_chars_and_len2 + * @since 4.3 + * + * Creates a String from a UTF-8 encoded C string with the given length. + * + * @param r_dest A pointer to a Variant to hold the newly created String. + * @param p_contents A pointer to a UTF-8 encoded C string. + * @param p_size The number of bytes (not code units). + * + * @return Error code signifying if the operation successful. + */ +typedef GDExtensionInt (*GDExtensionInterfaceStringNewWithUtf8CharsAndLen2)(GDExtensionUninitializedStringPtr r_dest, const char *p_contents, GDExtensionInt p_size); + +/** * @name string_new_with_utf16_chars_and_len * @since 4.1 + * @deprecated in Godot 4.3. Use `string_new_with_utf16_chars_and_len2` instead. * * Creates a String from a UTF-16 encoded C string with the given length. * @@ -1604,6 +1620,21 @@ typedef void (*GDExtensionInterfaceStringNewWithUtf8CharsAndLen)(GDExtensionUnin typedef void (*GDExtensionInterfaceStringNewWithUtf16CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char16_t *p_contents, GDExtensionInt p_char_count); /** + * @name string_new_with_utf16_chars_and_len2 + * @since 4.3 + * + * Creates a String from a UTF-16 encoded C string with the given length. + * + * @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_default_little_endian If true, UTF-16 use little endian. + * + * @return Error code signifying if the operation successful. + */ +typedef GDExtensionInt (*GDExtensionInterfaceStringNewWithUtf16CharsAndLen2)(GDExtensionUninitializedStringPtr r_dest, const char16_t *p_contents, GDExtensionInt p_char_count, GDExtensionBool p_default_little_endian); + +/** * @name string_new_with_utf32_chars_and_len * @since 4.1 * @@ -1899,6 +1930,36 @@ typedef void (*GDExtensionInterfaceFileAccessStoreBuffer)(GDExtensionObjectPtr p */ typedef uint64_t (*GDExtensionInterfaceFileAccessGetBuffer)(GDExtensionConstObjectPtr p_instance, uint8_t *p_dst, uint64_t p_length); +/* INTERFACE: Image Utilities */ + +/** + * @name image_ptrw + * @since 4.3 + * + * Returns writable pointer to internal Image buffer. + * + * @param p_instance A pointer to a Image object. + * + * @return Pointer to internal Image buffer. + * + * @see Image::ptrw() + */ +typedef uint8_t *(*GDExtensionInterfaceImagePtrw)(GDExtensionObjectPtr p_instance); + +/** + * @name image_ptr + * @since 4.3 + * + * Returns read only pointer to internal Image buffer. + * + * @param p_instance A pointer to a Image object. + * + * @return Pointer to internal Image buffer. + * + * @see Image::ptr() + */ +typedef const uint8_t *(*GDExtensionInterfaceImagePtr)(GDExtensionObjectPtr p_instance); + /* INTERFACE: WorkerThreadPool Utilities */ /** |