diff --git a/core/crypto/aes_context.cpp b/core/crypto/aes_context.cpp index 8f91d6c759..a1fa439771 100644 --- a/core/crypto/aes_context.cpp +++ b/core/crypto/aes_context.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "core/crypto/aes_context.h" +#include "aes_context.h" #include "core/object/class_db.h" diff --git a/core/crypto/aes_context.h b/core/crypto/aes_context.h index bc13485eff..60ae26fe5e 100644 --- a/core/crypto/aes_context.h +++ b/core/crypto/aes_context.h @@ -32,6 +32,7 @@ #include "core/crypto/crypto_core.h" #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class AESContext : public RefCounted { GDCLASS(AESContext, RefCounted); diff --git a/core/crypto/hashing_context.h b/core/crypto/hashing_context.h index c441da5056..b9e600b623 100644 --- a/core/crypto/hashing_context.h +++ b/core/crypto/hashing_context.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class HashingContext : public RefCounted { GDCLASS(HashingContext, RefCounted); diff --git a/core/io/file_access.h b/core/io/file_access.h index 77fbc99925..e3302604cb 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -36,6 +36,7 @@ #include "core/os/memory.h" #include "core/string/ustring.h" #include "core/typedefs.h" +#include "core/variant/binder_common.h" /** * Multi-Platform abstraction for accessing to files. diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 7b020e142d..1ba926de08 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -30,6 +30,8 @@ #include "file_access_compressed.h" +#include "core/math/math_funcs_binary.h" + void FileAccessCompressed::configure(const String &p_magic, Compression::Mode p_mode, uint32_t p_block_size) { magic = p_magic.ascii().get_data(); magic = (magic + " ").substr(0, 4); diff --git a/core/io/ip.h b/core/io/ip.h index bab9625c7e..46a7244dbc 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -31,7 +31,7 @@ #pragma once #include "core/io/ip_address.h" -#include "core/os/os.h" +#include "core/variant/binder_common.h" template class TypedArray; diff --git a/core/io/remote_filesystem_client.cpp b/core/io/remote_filesystem_client.cpp index e542111588..f637fb6725 100644 --- a/core/io/remote_filesystem_client.cpp +++ b/core/io/remote_filesystem_client.cpp @@ -33,6 +33,7 @@ #include "core/io/dir_access.h" #include "core/io/file_access.h" #include "core/io/stream_peer_tcp.h" +#include "core/os/os.h" #include "core/string/string_builder.h" #define FILESYSTEM_CACHE_VERSION 1 diff --git a/core/io/stream_peer_socket.cpp b/core/io/stream_peer_socket.cpp index 1439447d06..1fa0b3ecfa 100644 --- a/core/io/stream_peer_socket.cpp +++ b/core/io/stream_peer_socket.cpp @@ -32,6 +32,7 @@ #include "stream_peer_socket.compat.inc" #include "core/object/class_db.h" +#include "core/os/os.h" Error StreamPeerSocket::poll() { if (status == STATUS_CONNECTED) { diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index b4071e04e0..e3b6dfb281 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -32,6 +32,7 @@ #include "core/config/project_settings.h" #include "core/object/class_db.h" +#include "core/os/os.h" void StreamPeerTCP::accept_socket(Ref p_sock, const NetSocket::Address &p_addr) { _sock = p_sock; diff --git a/core/io/stream_peer_uds.cpp b/core/io/stream_peer_uds.cpp index aa56b80575..ec70a78dce 100644 --- a/core/io/stream_peer_uds.cpp +++ b/core/io/stream_peer_uds.cpp @@ -32,6 +32,7 @@ #include "core/config/project_settings.h" #include "core/object/class_db.h" +#include "core/os/os.h" void StreamPeerUDS::_bind_methods() { ClassDB::bind_method(D_METHOD("bind", "path"), &StreamPeerUDS::bind); diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index 911d2b11b2..ce742fa7e7 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -33,6 +33,7 @@ #include "core/object/ref_counted.h" #include "core/string/ustring.h" #include "core/templates/vector.h" +#include "core/variant/binder_common.h" /* Based on irrXML (see their zlib license). Added mainly for compatibility with their Collada loader. diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h index 69b8b70334..fc12d955b1 100644 --- a/core/object/ref_counted.h +++ b/core/object/ref_counted.h @@ -30,7 +30,6 @@ #pragma once -#include "core/object/class_db.h" #include "core/object/object.h" #include "core/templates/safe_refcount.h" @@ -239,40 +238,6 @@ public: void set_ref(const Ref &p_ref); }; -template -struct PtrToArg> { - _FORCE_INLINE_ static Ref convert(const void *p_ptr) { - if (p_ptr == nullptr) { - return Ref(); - } - // p_ptr points to a RefCounted object - return Ref(*reinterpret_cast(p_ptr)); - } - - typedef Ref EncodeT; - - _FORCE_INLINE_ static void encode(Ref p_val, const void *p_ptr) { - // p_ptr points to an EncodeT object which is a Ref object. - *(const_cast *>(reinterpret_cast *>(p_ptr))) = p_val; - } -}; - -template -struct GetTypeInfo> { - static const Variant::Type VARIANT_TYPE = Variant::OBJECT; - static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; - - static inline PropertyInfo get_class_info() { - return PropertyInfo(Variant::OBJECT, String(), PROPERTY_HINT_RESOURCE_TYPE, T::get_class_static()); - } -}; - -template -struct VariantInternalAccessor> { - static _FORCE_INLINE_ Ref get(const Variant *v) { return Ref(*VariantInternal::get_object(v)); } - static _FORCE_INLINE_ void set(Variant *v, const Ref &p_ref) { VariantInternal::object_assign(v, p_ref); } -}; - // Zero-constructing Ref initializes reference to nullptr (and thus empty). template struct is_zero_constructible> : std::true_type {}; diff --git a/core/string/print_string.cpp b/core/string/print_string.cpp index 7f2607b0b3..e669cf7c7d 100644 --- a/core/string/print_string.cpp +++ b/core/string/print_string.cpp @@ -33,6 +33,8 @@ #include "core/core_globals.h" #include "core/os/os.h" +#include + static PrintHandlerList *print_handler_list = nullptr; static thread_local bool is_printing = false; diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h index ff2ae0cd94..3aa15e30dc 100644 --- a/core/variant/method_ptrcall.h +++ b/core/variant/method_ptrcall.h @@ -270,9 +270,32 @@ struct PtrToArg { } }; +// This is for Ref. + +template +struct PtrToArg> { + _FORCE_INLINE_ static Ref convert(const void *p_ptr) { + if (p_ptr == nullptr) { + return Ref(); + } + // p_ptr points to a RefCounted object + return Ref(*reinterpret_cast(p_ptr)); + } + + typedef Ref EncodeT; + + _FORCE_INLINE_ static void encode(Ref p_val, const void *p_ptr) { + // p_ptr points to an EncodeT object which is a Ref object. + *(const_cast *>(reinterpret_cast *>(p_ptr))) = p_val; + } +}; + // This is for RequiredParam. -template +template +class RequiredParam; + +template struct PtrToArg> { typedef typename RequiredParam::persistent_type EncodeT; @@ -290,7 +313,10 @@ struct PtrToArg> { // This is for RequiredResult. -template +template +class RequiredResult; + +template struct PtrToArg> { typedef typename RequiredResult::ptr_type EncodeT; diff --git a/core/variant/type_info.h b/core/variant/type_info.h index b3594d5b27..9035c4e80b 100644 --- a/core/variant/type_info.h +++ b/core/variant/type_info.h @@ -183,10 +183,20 @@ struct GetTypeInfo>> { } }; -template +template +struct GetTypeInfo> { + static const Variant::Type VARIANT_TYPE = Variant::OBJECT; + static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; + + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::OBJECT, String(), PROPERTY_HINT_RESOURCE_TYPE, T::get_class_static()); + } +}; + +template class RequiredParam; -template +template class RequiredResult; template diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 27ed7ded60..90ec4b2ffe 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -637,6 +637,12 @@ struct VariantInternalAccessor { static _FORCE_INLINE_ void set(Variant *v, const Object *p_value) { VariantInternal::object_assign(v, p_value); } }; +template +struct VariantInternalAccessor> { + static _FORCE_INLINE_ Ref get(const Variant *v) { return Ref(const_cast(*VariantInternal::get_object(v))); } + static _FORCE_INLINE_ void set(Variant *v, const Ref &p_ref) { VariantInternal::object_assign(v, p_ref); } +}; + template struct VariantInternalAccessor> { static _FORCE_INLINE_ RequiredParam get(const Variant *v) { return RequiredParam(Object::cast_to(const_cast(*VariantInternal::get_object(v)))); } diff --git a/editor/export/editor_export_preset.h b/editor/export/editor_export_preset.h index be6ec66b40..a1cc24f827 100644 --- a/editor/export/editor_export_preset.h +++ b/editor/export/editor_export_preset.h @@ -33,6 +33,7 @@ class EditorExportPlatform; #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class EditorExportPreset : public RefCounted { GDCLASS(EditorExportPreset, RefCounted); diff --git a/modules/mobile_vr/register_types.cpp b/modules/mobile_vr/register_types.cpp index 4ae0c65a22..0a55a0098e 100644 --- a/modules/mobile_vr/register_types.cpp +++ b/modules/mobile_vr/register_types.cpp @@ -32,6 +32,8 @@ #include "mobile_vr_interface.h" +#include "core/object/class_db.h" + Ref mobile_vr; void initialize_mobile_vr_module(ModuleInitializationLevel p_level) { diff --git a/modules/navigation_2d/2d/nav_map_iteration_2d.h b/modules/navigation_2d/2d/nav_map_iteration_2d.h index 313374b215..f937c2db58 100644 --- a/modules/navigation_2d/2d/nav_map_iteration_2d.h +++ b/modules/navigation_2d/2d/nav_map_iteration_2d.h @@ -35,6 +35,7 @@ #include "nav_mesh_queries_2d.h" #include "core/math/math_defs.h" +#include "core/os/rw_lock.h" #include "core/os/semaphore.h" class NavLinkIteration2D; diff --git a/modules/navigation_2d/nav_link_2d.h b/modules/navigation_2d/nav_link_2d.h index 91d0f208e5..46d74f97e8 100644 --- a/modules/navigation_2d/nav_link_2d.h +++ b/modules/navigation_2d/nav_link_2d.h @@ -31,6 +31,8 @@ #pragma once #include "2d/nav_base_iteration_2d.h" +#include "core/os/rw_lock.h" +#include "core/variant/binder_common.h" #include "nav_base_2d.h" #include "nav_utils_2d.h" diff --git a/modules/navigation_2d/nav_map_2d.h b/modules/navigation_2d/nav_map_2d.h index d1a5237271..b58be55979 100644 --- a/modules/navigation_2d/nav_map_2d.h +++ b/modules/navigation_2d/nav_map_2d.h @@ -37,6 +37,7 @@ #include "core/math/math_defs.h" #include "core/object/worker_thread_pool.h" +#include "core/os/rw_lock.h" #include "servers/navigation_2d/navigation_constants_2d.h" #include diff --git a/modules/navigation_3d/3d/nav_map_iteration_3d.h b/modules/navigation_3d/3d/nav_map_iteration_3d.h index 2efade40c8..f840215330 100644 --- a/modules/navigation_3d/3d/nav_map_iteration_3d.h +++ b/modules/navigation_3d/3d/nav_map_iteration_3d.h @@ -35,6 +35,7 @@ #include "nav_mesh_queries_3d.h" #include "core/math/math_defs.h" +#include "core/os/rw_lock.h" #include "core/os/semaphore.h" class NavLinkIteration3D; diff --git a/modules/navigation_3d/nav_link_3d.h b/modules/navigation_3d/nav_link_3d.h index e6b54d2fa8..27c654322c 100644 --- a/modules/navigation_3d/nav_link_3d.h +++ b/modules/navigation_3d/nav_link_3d.h @@ -31,6 +31,7 @@ #pragma once #include "3d/nav_base_iteration_3d.h" +#include "core/os/rw_lock.h" #include "nav_base_3d.h" #include "nav_utils_3d.h" diff --git a/modules/navigation_3d/nav_map_3d.h b/modules/navigation_3d/nav_map_3d.h index 0f18dd3454..34d11ee463 100644 --- a/modules/navigation_3d/nav_map_3d.h +++ b/modules/navigation_3d/nav_map_3d.h @@ -37,6 +37,7 @@ #include "core/math/math_defs.h" #include "core/object/worker_thread_pool.h" +#include "core/os/rw_lock.h" #include "servers/navigation_3d/navigation_constants_3d.h" #include diff --git a/modules/upnp/register_types.cpp b/modules/upnp/register_types.cpp index 49fdd331cc..7ddfdecc0f 100644 --- a/modules/upnp/register_types.cpp +++ b/modules/upnp/register_types.cpp @@ -38,6 +38,8 @@ #include "upnp_miniupnp.h" #endif +#include "core/object/class_db.h" + void initialize_upnp_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; diff --git a/modules/upnp/upnp.h b/modules/upnp/upnp.h index 00a0523f73..0b3adb185e 100644 --- a/modules/upnp/upnp.h +++ b/modules/upnp/upnp.h @@ -33,6 +33,7 @@ #include "upnp_device.h" #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class UPNP : public RefCounted { GDCLASS(UPNP, RefCounted); diff --git a/modules/upnp/upnp_device.h b/modules/upnp/upnp_device.h index 146727d93a..64602ea70b 100644 --- a/modules/upnp/upnp_device.h +++ b/modules/upnp/upnp_device.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class UPNPDevice : public RefCounted { GDCLASS(UPNPDevice, RefCounted); diff --git a/modules/upnp/upnp_device_miniupnp.cpp b/modules/upnp/upnp_device_miniupnp.cpp index a1e61df400..19a0f4bf10 100644 --- a/modules/upnp/upnp_device_miniupnp.cpp +++ b/modules/upnp/upnp_device_miniupnp.cpp @@ -34,8 +34,14 @@ #include "upnp_miniupnp.h" +#include "core/object/class_db.h" + #include +UPNPDevice *UPNPDeviceMiniUPNP::_create(bool p_notify_postinitialize) { + return static_cast(ClassDB::creator(p_notify_postinitialize)); +} + void UPNPDeviceMiniUPNP::make_default() { UPNPDevice::_create = UPNPDeviceMiniUPNP::_create; } diff --git a/modules/upnp/upnp_device_miniupnp.h b/modules/upnp/upnp_device_miniupnp.h index 616ecaa6c1..e691644706 100644 --- a/modules/upnp/upnp_device_miniupnp.h +++ b/modules/upnp/upnp_device_miniupnp.h @@ -38,7 +38,7 @@ class UPNPDeviceMiniUPNP : public UPNPDevice { GDCLASS(UPNPDeviceMiniUPNP, UPNPDevice); private: - static UPNPDevice *_create(bool p_notify_postinitialize) { return static_cast(ClassDB::creator(p_notify_postinitialize)); } + static UPNPDevice *_create(bool p_notify_postinitialize); String description_url; String service_type; diff --git a/modules/upnp/upnp_miniupnp.cpp b/modules/upnp/upnp_miniupnp.cpp index e32c19a3bb..6ef7716467 100644 --- a/modules/upnp/upnp_miniupnp.cpp +++ b/modules/upnp/upnp_miniupnp.cpp @@ -34,11 +34,17 @@ #include "upnp_device_miniupnp.h" +#include "core/object/class_db.h" + #include #include #include +UPNP *UPNPMiniUPNP::_create(bool p_notify_postinitialize) { + return static_cast(ClassDB::creator(p_notify_postinitialize)); +} + void UPNPMiniUPNP::make_default() { UPNP::_create = UPNPMiniUPNP::_create; } diff --git a/modules/upnp/upnp_miniupnp.h b/modules/upnp/upnp_miniupnp.h index d8a4cfe422..725e538e94 100644 --- a/modules/upnp/upnp_miniupnp.h +++ b/modules/upnp/upnp_miniupnp.h @@ -40,7 +40,7 @@ class UPNPMiniUPNP : public UPNP { GDCLASS(UPNPMiniUPNP, UPNP); private: - static UPNP *_create(bool p_notify_postinitialize) { return static_cast(ClassDB::creator(p_notify_postinitialize)); } + static UPNP *_create(bool p_notify_postinitialize); String discover_multicast_if = ""; int discover_local_port = 0; diff --git a/modules/webxr/register_types.cpp b/modules/webxr/register_types.cpp index 139539c24c..31207da3d3 100644 --- a/modules/webxr/register_types.cpp +++ b/modules/webxr/register_types.cpp @@ -33,6 +33,8 @@ #include "webxr_interface.h" #include "webxr_interface_js.h" +#include "core/object/class_db.h" + #ifdef WEB_ENABLED Ref webxr; #endif diff --git a/platform/android/api/api.cpp b/platform/android/api/api.cpp index aa17f78ca2..a5c7a2d272 100644 --- a/platform/android/api/api.cpp +++ b/platform/android/api/api.cpp @@ -35,6 +35,7 @@ #include "jni_singleton.h" #include "core/config/engine.h" +#include "core/object/class_db.h" #if !defined(ANDROID_ENABLED) static JavaClassWrapper *java_class_wrapper = nullptr; diff --git a/platform/android/api/jni_singleton.cpp b/platform/android/api/jni_singleton.cpp new file mode 100644 index 0000000000..ef35ea0736 --- /dev/null +++ b/platform/android/api/jni_singleton.cpp @@ -0,0 +1,77 @@ +/**************************************************************************/ +/* jni_singleton.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "jni_singleton.h" + +#include "core/object/class_db.h" + +void JNISingleton::_bind_methods() { + ClassDB::bind_method(D_METHOD("has_java_method", "method"), &JNISingleton::has_java_method); +} + +Variant JNISingleton::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { + // Godot methods take precedence. + Variant ret = Object::callp(p_method, p_args, p_argcount, r_error); + if (r_error.error == Callable::CallError::CALL_OK) { + return ret; + } + + // Check the method we're looking for is in the JNISingleton map. + // This is done because JNISingletons register methods differently than wrapped JavaClass / JavaObject to allow + // for access to private methods annotated with the @UsedByGodot annotation. + // In the future, we should remove access to private methods and require that JNISingletons' methods exposed to + // GDScript be all public, similarly to what we do for wrapped JavaClass / JavaObject methods. Doing so will + // also allow dropping and deprecating the @UsedByGodot annotation. + RBMap::Element *E = method_map.find(p_method); + if (E) { + if (wrapped_object.is_valid()) { + return wrapped_object->callp(p_method, p_args, p_argcount, r_error); + } else { + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; + } + } + return Variant(); +} + +void JNISingleton::add_method(const StringName &p_name, const Vector &p_args, Variant::Type p_ret_type) { + MethodData md; + md.argtypes = p_args; + md.ret_type = p_ret_type; + method_map[p_name] = md; +} + +void JNISingleton::add_signal(const StringName &p_name, const Vector &p_args) { + MethodInfo mi; + mi.name = p_name; + for (int i = 0; i < p_args.size(); i++) { + mi.arguments.push_back(PropertyInfo(p_args[i], "arg" + itos(i + 1))); + } + ADD_SIGNAL(mi); +} diff --git a/platform/android/api/jni_singleton.h b/platform/android/api/jni_singleton.h index 9f6b1cbc5f..f6bafce6ae 100644 --- a/platform/android/api/jni_singleton.h +++ b/platform/android/api/jni_singleton.h @@ -32,7 +32,6 @@ #include "java_class_wrapper.h" -#include "core/config/engine.h" #include "core/templates/rb_map.h" #include "core/variant/variant.h" @@ -48,34 +47,10 @@ class JNISingleton : public Object { Ref wrapped_object; protected: - static void _bind_methods() { - ClassDB::bind_method(D_METHOD("has_java_method", "method"), &JNISingleton::has_java_method); - } + static void _bind_methods(); public: - virtual Variant callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) override { - // Godot methods take precedence. - Variant ret = Object::callp(p_method, p_args, p_argcount, r_error); - if (r_error.error == Callable::CallError::CALL_OK) { - return ret; - } - - // Check the method we're looking for is in the JNISingleton map. - // This is done because JNISingletons register methods differently than wrapped JavaClass / JavaObject to allow - // for access to private methods annotated with the @UsedByGodot annotation. - // In the future, we should remove access to private methods and require that JNISingletons' methods exposed to - // GDScript be all public, similarly to what we do for wrapped JavaClass / JavaObject methods. Doing so will - // also allow dropping and deprecating the @UsedByGodot annotation. - RBMap::Element *E = method_map.find(p_method); - if (E) { - if (wrapped_object.is_valid()) { - return wrapped_object->callp(p_method, p_args, p_argcount, r_error); - } else { - r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; - } - } - return Variant(); - } + virtual Variant callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) override; Ref get_wrapped_object() const { return wrapped_object; @@ -85,21 +60,9 @@ public: return method_map.has(p_method); } - void add_method(const StringName &p_name, const Vector &p_args, Variant::Type p_ret_type) { - MethodData md; - md.argtypes = p_args; - md.ret_type = p_ret_type; - method_map[p_name] = md; - } + void add_method(const StringName &p_name, const Vector &p_args, Variant::Type p_ret_type); - void add_signal(const StringName &p_name, const Vector &p_args) { - MethodInfo mi; - mi.name = p_name; - for (int i = 0; i < p_args.size(); i++) { - mi.arguments.push_back(PropertyInfo(p_args[i], "arg" + itos(i + 1))); - } - ADD_SIGNAL(mi); - } + void add_signal(const StringName &p_name, const Vector &p_args); JNISingleton() {} diff --git a/scene/animation/tween.h b/scene/animation/tween.h index e84ead8cb5..4c0ba917c7 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class Tween; class Node; diff --git a/servers/camera/camera_server.h b/servers/camera/camera_server.h index d0bfaaf71a..a69371e9bb 100644 --- a/servers/camera/camera_server.h +++ b/servers/camera/camera_server.h @@ -34,6 +34,7 @@ #include "core/object/ref_counted.h" #include "core/os/thread_safe.h" #include "core/templates/rid.h" +#include "core/variant/binder_common.h" /** The camera server is a singleton object that gives access to the various diff --git a/servers/navigation_2d/navigation_path_query_parameters_2d.h b/servers/navigation_2d/navigation_path_query_parameters_2d.h index 11fa44abd5..c281631d97 100644 --- a/servers/navigation_2d/navigation_path_query_parameters_2d.h +++ b/servers/navigation_2d/navigation_path_query_parameters_2d.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" #include "servers/navigation_2d/navigation_constants_2d.h" class NavigationPathQueryParameters2D : public RefCounted { diff --git a/servers/navigation_2d/navigation_path_query_result_2d.h b/servers/navigation_2d/navigation_path_query_result_2d.h index 71118f4733..2529c62894 100644 --- a/servers/navigation_2d/navigation_path_query_result_2d.h +++ b/servers/navigation_2d/navigation_path_query_result_2d.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" #include "core/variant/typed_array.h" #include "servers/navigation_2d/navigation_constants_2d.h" diff --git a/servers/navigation_3d/navigation_path_query_parameters_3d.h b/servers/navigation_3d/navigation_path_query_parameters_3d.h index 760553b557..99364536ee 100644 --- a/servers/navigation_3d/navigation_path_query_parameters_3d.h +++ b/servers/navigation_3d/navigation_path_query_parameters_3d.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" #include "servers/navigation_3d/navigation_constants_3d.h" class NavigationPathQueryParameters3D : public RefCounted { diff --git a/servers/navigation_3d/navigation_path_query_result_3d.h b/servers/navigation_3d/navigation_path_query_result_3d.h index b73a16f3e9..70fdbc1868 100644 --- a/servers/navigation_3d/navigation_path_query_result_3d.h +++ b/servers/navigation_3d/navigation_path_query_result_3d.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" #include "core/variant/typed_array.h" #include "servers/navigation_3d/navigation_constants_3d.h" diff --git a/servers/xr/xr_interface.h b/servers/xr/xr_interface.h index 7e138d6023..d1c118bccc 100644 --- a/servers/xr/xr_interface.h +++ b/servers/xr/xr_interface.h @@ -32,6 +32,7 @@ #include "core/object/ref_counted.h" #include "core/os/thread_safe.h" +#include "core/variant/binder_common.h" /** The XR interface is a template class on top of which we build interface to different AR, VR and tracking SDKs. diff --git a/servers/xr/xr_pose.h b/servers/xr/xr_pose.h index 647ad1a022..25ad6f1d3a 100644 --- a/servers/xr/xr_pose.h +++ b/servers/xr/xr_pose.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/ref_counted.h" +#include "core/variant/binder_common.h" class XRPose : public RefCounted { GDCLASS(XRPose, RefCounted); diff --git a/servers/xr/xr_server.h b/servers/xr/xr_server.h index a5b50bc107..acd55a199a 100644 --- a/servers/xr/xr_server.h +++ b/servers/xr/xr_server.h @@ -32,6 +32,7 @@ #include "core/object/ref_counted.h" #include "core/os/thread_safe.h" +#include "core/variant/binder_common.h" #include "core/variant/variant.h" class XRInterface; diff --git a/tests/core/io/test_tcp_server.cpp b/tests/core/io/test_tcp_server.cpp index 0c035fc510..aa530000a4 100644 --- a/tests/core/io/test_tcp_server.cpp +++ b/tests/core/io/test_tcp_server.cpp @@ -35,6 +35,7 @@ TEST_FORCE_LINK(test_tcp_server) #include "core/config/project_settings.h" #include "core/io/stream_peer_tcp.h" #include "core/io/tcp_server.h" +#include "core/os/os.h" #include diff --git a/tests/core/io/test_udp_server.cpp b/tests/core/io/test_udp_server.cpp index fb7f08ea5c..84e8cf8157 100644 --- a/tests/core/io/test_udp_server.cpp +++ b/tests/core/io/test_udp_server.cpp @@ -34,6 +34,7 @@ TEST_FORCE_LINK(test_udp_server) #include "core/io/packet_peer_udp.h" #include "core/io/udp_server.h" +#include "core/os/os.h" #include diff --git a/tests/core/io/test_uds_server.cpp b/tests/core/io/test_uds_server.cpp index 749732b624..b796abda46 100644 --- a/tests/core/io/test_uds_server.cpp +++ b/tests/core/io/test_uds_server.cpp @@ -38,6 +38,7 @@ TEST_FORCE_LINK(test_uds_server) #include "core/io/file_access.h" #include "core/io/stream_peer_uds.h" #include "core/io/uds_server.h" +#include "core/os/os.h" #include diff --git a/tests/core/threads/test_worker_thread_pool.cpp b/tests/core/threads/test_worker_thread_pool.cpp index 7b5b2fae0e..f90e42d475 100644 --- a/tests/core/threads/test_worker_thread_pool.cpp +++ b/tests/core/threads/test_worker_thread_pool.cpp @@ -32,6 +32,7 @@ TEST_FORCE_LINK(test_worker_thread_pool) +#include "core/object/callable_method_pointer.h" #include "core/object/worker_thread_pool.h" namespace TestWorkerThreadPool {