From 41b9d0ede634eebf77ce8121d1cb622dafc4cd1c Mon Sep 17 00:00:00 2001 From: Ced Naru Date: Sat, 12 Oct 2024 08:20:06 +0200 Subject: [PATCH] Update JNI signatures --- .../godot-api-library/build.gradle.kts | 2 +- .../godot/gen/godot/extension/SignalsExt.kt | 2 +- .../src/main/kotlin/godot/core/TypeManager.kt | 2 +- .../kotlin/godot/core/bridge/GodotPrint.kt | 14 +++++++------- .../gradle/godot-kotlin-graal-jni-config.json | 18 +++++++++--------- src/jvm_wrapper/bootstrap.h | 2 +- src/jvm_wrapper/memory/type_manager.h | 2 +- src/jvm_wrapper/registration/kt_class.h | 10 +++++----- src/jvm_wrapper/registration/kt_constructor.h | 2 +- src/jvm_wrapper/registration/kt_function.h | 12 ++++++------ src/jvm_wrapper/registration/kt_property.h | 6 +++--- src/jvm_wrapper/registration/kt_rpc_config.h | 2 +- src/jvm_wrapper/registration/kt_signal_info.h | 4 ++-- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/kt/godot-library/godot-api-library/build.gradle.kts b/kt/godot-library/godot-api-library/build.gradle.kts index 9c19184cfc..75c1ad8579 100644 --- a/kt/godot-library/godot-api-library/build.gradle.kts +++ b/kt/godot-library/godot-api-library/build.gradle.kts @@ -55,7 +55,7 @@ tasks { val copyBootstrapJar by creating(Copy::class.java) { group = "godot-kotlin-jvm" from(shadowJar) - destinationDir = File("${projectDir.absolutePath}/../../../../bin/") + destinationDir = File("${projectDir.absolutePath}/../../../../../bin/") dependsOn(shadowJar) } diff --git a/kt/godot-library/godot-api-library/src/main/kotlin/godot/gen/godot/extension/SignalsExt.kt b/kt/godot-library/godot-api-library/src/main/kotlin/godot/gen/godot/extension/SignalsExt.kt index 4415d41775..5004b5a0d7 100644 --- a/kt/godot-library/godot-api-library/src/main/kotlin/godot/gen/godot/extension/SignalsExt.kt +++ b/kt/godot-library/godot-api-library/src/main/kotlin/godot/gen/godot/extension/SignalsExt.kt @@ -28,7 +28,7 @@ import godot.core.Signal8 import godot.core.Signal9 import godot.core.asCallable import godot.core.toGodotName -import godot.extensions.connectThreadSafe +import godot.extension.connectThreadSafe import kotlin.Any import kotlin.Int import kotlin.Suppress diff --git a/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/TypeManager.kt b/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/TypeManager.kt index 3db8fde45b..6c638f0c77 100644 --- a/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/TypeManager.kt +++ b/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/TypeManager.kt @@ -37,5 +37,5 @@ internal object TypeManager { userTypes.clear() } - internal external fun getMethodBindPtr(className: String, methodName: String, hash: Long): VoidPtr + external fun getMethodBindPtr(className: String, methodName: String, hash: Long): VoidPtr } diff --git a/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/bridge/GodotPrint.kt b/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/bridge/GodotPrint.kt index 8b9062bfd0..87fc87b74d 100644 --- a/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/bridge/GodotPrint.kt +++ b/kt/godot-library/godot-core-library/src/main/kotlin/godot/core/bridge/GodotPrint.kt @@ -40,11 +40,11 @@ object GodotPrint { pushWarning() } - internal external fun print() - internal external fun printRich() - internal external fun printVerbose() - internal external fun printErr() - internal external fun printRaw() - internal external fun pushError() - internal external fun pushWarning() + external fun print() + external fun printRich() + external fun printVerbose() + external fun printErr() + external fun printRaw() + external fun pushError() + external fun pushWarning() } diff --git a/kt/plugins/godot-gradle-plugin/src/main/resources/godot/gradle/godot-kotlin-graal-jni-config.json b/kt/plugins/godot-gradle-plugin/src/main/resources/godot/gradle/godot-kotlin-graal-jni-config.json index ce8d5ffbc1..eb3946167f 100644 --- a/kt/plugins/godot-gradle-plugin/src/main/resources/godot/gradle/godot-kotlin-graal-jni-config.json +++ b/kt/plugins/godot-gradle-plugin/src/main/resources/godot/gradle/godot-kotlin-graal-jni-config.json @@ -691,14 +691,14 @@ "name" : "godot.runtime.Bootstrap", "methods" : [ { "name" : "", "parameterTypes" : [] }, - { "name" : "loadClasses", "parameterTypes" : ["godot.core.KtClass[]"] }, + { "name" : "loadClasses", "parameterTypes" : ["godot.registration.KtClass[]"] }, { "name" : "registerManagedEngineTypes", "parameterTypes" : ["java.lang.String[]", "java.lang.String[]"] }, { "name" : "init", "parameterTypes": ["java.lang.String", "java.lang.String", "java.lang.ClassLoader"]}, { "name" : "finish", "parameterTypes" : [] } ] }, { - "name":"godot.core.KtClass", + "name":"godot.registration.KtClass", "methods":[ {"name":"getRelativeSourcePath","parameterTypes":[] }, {"name":"getCompilationTimeRelativeRegistrationFilePath","parameterTypes":[] }, @@ -714,7 +714,7 @@ ] }, { - "name": "godot.core.KtConstructor", + "name": "godot.registration.KtConstructor", "methods": [ {"name": "getParameterCount", "parameterTypes": []}, {"name": "construct", "parameterTypes": ["long", "long"]} @@ -729,7 +729,7 @@ ] }, { - "name":"godot.core.KtFunction", + "name":"godot.registration.KtFunction", "methods":[ {"name":"getFunctionInfo","parameterTypes":[] }, {"name":"getParameterCount","parameterTypes":[] }, @@ -738,7 +738,7 @@ ] }, { - "name":"godot.core.KtFunctionInfo", + "name":"godot.registration.KtFunctionInfo", "methods":[ {"name":"getArguments","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, @@ -747,7 +747,7 @@ ] }, { - "name":"godot.core.KtProperty", + "name":"godot.registration.KtProperty", "methods":[ {"name":"getKtPropertyInfo","parameterTypes":[] }, {"name":"callGet","parameterTypes":["godot.core.KtObject"] }, @@ -755,7 +755,7 @@ ] }, { - "name":"godot.core.KtPropertyInfo", + "name":"godot.registration.KtPropertyInfo", "methods":[ {"name":"getClassName","parameterTypes":[] }, {"name":"getHint","parameterTypes":[] }, @@ -766,14 +766,14 @@ ] }, { - "name":"godot.core.KtSignalInfo", + "name":"godot.registration.KtSignalInfo", "methods":[ {"name":"getArguments","parameterTypes":[] }, {"name":"getName","parameterTypes":[] } ] }, { - "name":"godot.core.KtRpcConfig", + "name":"godot.registration.KtRpcConfig", "methods":[ {"name":"getRpcModeId","parameterTypes":[] }, {"name":"getRpcCallLocal","parameterTypes":[] }, diff --git a/src/jvm_wrapper/bootstrap.h b/src/jvm_wrapper/bootstrap.h index 38c8ecc01a..3754f11166 100644 --- a/src/jvm_wrapper/bootstrap.h +++ b/src/jvm_wrapper/bootstrap.h @@ -13,7 +13,7 @@ JVM_INSTANCE_WRAPPER(Bootstrap, "godot.runtime.Bootstrap") { INIT_JNI_BINDINGS( INIT_JNI_METHOD(INIT, "init", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/ClassLoader;)V") INIT_JNI_METHOD(FINISH, "finish", "()V") - INIT_NATIVE_METHOD("loadClasses", "([Lgodot/core/KtClass;)V", Bootstrap::load_classes) + INIT_NATIVE_METHOD("loadClasses", "([Lgodot/registration/KtClass;)V", Bootstrap::load_classes) INIT_NATIVE_METHOD("registerManagedEngineTypes", "([Ljava/lang/String;[Ljava/lang/String;)V", Bootstrap::register_engine_type) ) // clang-format on diff --git a/src/jvm_wrapper/memory/type_manager.h b/src/jvm_wrapper/memory/type_manager.h index 83bcec1702..5fe14cfffe 100644 --- a/src/jvm_wrapper/memory/type_manager.h +++ b/src/jvm_wrapper/memory/type_manager.h @@ -11,7 +11,7 @@ JVM_SINGLETON_WRAPPER(TypeManager, "godot.core.TypeManager") { SINGLETON_CLASS(TypeManager) INIT_JNI_BINDINGS( - INIT_NATIVE_METHOD("getMethodBindPtr$godot_library", "(Ljava/lang/String;Ljava/lang/String;J)J",TypeManager::get_method_bind_ptr) + INIT_NATIVE_METHOD("getMethodBindPtr", "(Ljava/lang/String;Ljava/lang/String;J)J",TypeManager::get_method_bind_ptr) ) public: diff --git a/src/jvm_wrapper/registration/kt_class.h b/src/jvm_wrapper/registration/kt_class.h index cb55f84073..eed5009acd 100644 --- a/src/jvm_wrapper/registration/kt_class.h +++ b/src/jvm_wrapper/registration/kt_class.h @@ -12,7 +12,7 @@ const int MAX_CONSTRUCTOR_SIZE = MAX_CONSTRUCTOR_ARG_COUNT + 1; -JVM_INSTANCE_WRAPPER(KtClass, "godot.core.KtClass") { +JVM_INSTANCE_WRAPPER(KtClass, "godot.registration.KtClass") { JVM_CLASS(KtClass) // clang-format off @@ -34,10 +34,10 @@ JVM_INSTANCE_WRAPPER(KtClass, "godot.core.KtClass") { INIT_JNI_METHOD(GET_COMPILATION_TIME_RELATIVE_REGISTRATION_FILE_PATH, "getCompilationTimeRelativeRegistrationFilePath", "()Ljava/lang/String;") INIT_JNI_METHOD(GET_REGISTERED_SUPERTYPES, "getRegisteredSupertypes", "()[Ljava/lang/String;") INIT_JNI_METHOD(GET_BASE_GODOT_CLASS, "getBaseGodotClass", "()Ljava/lang/String;") - INIT_JNI_METHOD(GET_FUNCTIONS, "getFunctions", "()[Lgodot/core/KtFunction;") - INIT_JNI_METHOD(GET_PROPERTIES, "getProperties", "()[Lgodot/core/KtProperty;") - INIT_JNI_METHOD(GET_SIGNAL_INFOS, "getSignalInfos", "()[Lgodot/core/KtSignalInfo;") - INIT_JNI_METHOD(GET_CONSTRUCTORS, "getConstructors", "()[Lgodot/core/KtConstructor;") + INIT_JNI_METHOD(GET_FUNCTIONS, "getFunctions", "()[Lgodot/registration/KtFunction;") + INIT_JNI_METHOD(GET_PROPERTIES, "getProperties", "()[Lgodot/registration/KtProperty;") + INIT_JNI_METHOD(GET_SIGNAL_INFOS, "getSignalInfos", "()[Lgodot/registration/KtSignalInfo;") + INIT_JNI_METHOD(GET_CONSTRUCTORS, "getConstructors", "()[Lgodot/registration/KtConstructor;") INIT_JNI_METHOD(GET_HAS_NOTIFICATION, "getHasNotification", "()Z") INIT_JNI_METHOD(DO_NOTIFICATION, "doNotification", "(Lgodot/core/KtObject;)V") ) diff --git a/src/jvm_wrapper/registration/kt_constructor.h b/src/jvm_wrapper/registration/kt_constructor.h index 1da523a824..e92afb5406 100644 --- a/src/jvm_wrapper/registration/kt_constructor.h +++ b/src/jvm_wrapper/registration/kt_constructor.h @@ -4,7 +4,7 @@ #include "jvm_wrapper/jvm_instance_wrapper.h" #include "kt_object.h" -JVM_INSTANCE_WRAPPER(KtConstructor, "godot.core.KtConstructor") { +JVM_INSTANCE_WRAPPER(KtConstructor, "godot.registration.KtConstructor") { JVM_CLASS(KtConstructor) // clang-format off diff --git a/src/jvm_wrapper/registration/kt_function.h b/src/jvm_wrapper/registration/kt_function.h index 304789163b..e9ec955231 100644 --- a/src/jvm_wrapper/registration/kt_function.h +++ b/src/jvm_wrapper/registration/kt_function.h @@ -6,7 +6,7 @@ #include "kt_property.h" #include "kt_rpc_config.h" -JVM_INSTANCE_WRAPPER(KtFunctionInfo, "godot.core.KtFunctionInfo") { +JVM_INSTANCE_WRAPPER(KtFunctionInfo, "godot.registration.KtFunctionInfo") { JVM_CLASS(KtFunctionInfo) // clang-format off @@ -17,9 +17,9 @@ JVM_INSTANCE_WRAPPER(KtFunctionInfo, "godot.core.KtFunctionInfo") { INIT_JNI_BINDINGS( INIT_JNI_METHOD(GET_NAME, "getName", "()Ljava/lang/String;") - INIT_JNI_METHOD(GET_ARGUMENTS, "getArguments", "()[Lgodot/core/KtPropertyInfo;") - INIT_JNI_METHOD(GET_RETURN_VAL, "getReturnVal", "()Lgodot/core/KtPropertyInfo;") - INIT_JNI_METHOD(GET_RPC_CONFIG, "getRpcConfig", "()Lgodot/core/KtRpcConfig;") + INIT_JNI_METHOD(GET_ARGUMENTS, "getArguments", "()[Lgodot/registration/KtPropertyInfo;") + INIT_JNI_METHOD(GET_RETURN_VAL, "getReturnVal", "()Lgodot/registration/KtPropertyInfo;") + INIT_JNI_METHOD(GET_RPC_CONFIG, "getRpcConfig", "()Lgodot/registration/KtRpcConfig;") ) // clang-format on @@ -35,7 +35,7 @@ JVM_INSTANCE_WRAPPER(KtFunctionInfo, "godot.core.KtFunctionInfo") { MethodInfo to_method_info() const; }; -JVM_INSTANCE_WRAPPER(KtFunction, "godot.core.KtFunction") { +JVM_INSTANCE_WRAPPER(KtFunction, "godot.registration.KtFunction") { JVM_CLASS(KtFunction) // clang-format off @@ -45,7 +45,7 @@ JVM_INSTANCE_WRAPPER(KtFunction, "godot.core.KtFunction") { JNI_OBJECT_METHOD(INVOKE_WITH_RETURN) INIT_JNI_BINDINGS( - INIT_JNI_METHOD(GET_FUNCTION_INFO, "getFunctionInfo", "()Lgodot/core/KtFunctionInfo;") + INIT_JNI_METHOD(GET_FUNCTION_INFO, "getFunctionInfo", "()Lgodot/registration/KtFunctionInfo;") INIT_JNI_METHOD(GET_PARAMETER_COUNT, "getParameterCount", "()I") INIT_JNI_METHOD(INVOKE, "invoke", "(Lgodot/core/KtObject;)V") INIT_JNI_METHOD(INVOKE_WITH_RETURN, "invokeWithReturn", "(Lgodot/core/KtObject;)Ljava/lang/Object;") diff --git a/src/jvm_wrapper/registration/kt_property.h b/src/jvm_wrapper/registration/kt_property.h index fa00ce95c0..4d14aa161e 100644 --- a/src/jvm_wrapper/registration/kt_property.h +++ b/src/jvm_wrapper/registration/kt_property.h @@ -6,7 +6,7 @@ #include "jvm_wrapper/jvm_instance_wrapper.h" #include "kt_object.h" -JVM_INSTANCE_WRAPPER(KtPropertyInfo, "godot.core.KtPropertyInfo") { +JVM_INSTANCE_WRAPPER(KtPropertyInfo, "godot.registration.KtPropertyInfo") { JVM_CLASS(KtPropertyInfo) // clang-format off @@ -43,7 +43,7 @@ JVM_INSTANCE_WRAPPER(KtPropertyInfo, "godot.core.KtPropertyInfo") { }; -JVM_INSTANCE_WRAPPER(KtProperty, "godot.core.KtProperty") { +JVM_INSTANCE_WRAPPER(KtProperty, "godot.registration.KtProperty") { JVM_CLASS(KtProperty) // clang-format off @@ -52,7 +52,7 @@ JVM_INSTANCE_WRAPPER(KtProperty, "godot.core.KtProperty") { JNI_VOID_METHOD(CALL_SET) INIT_JNI_BINDINGS( - INIT_JNI_METHOD(GET_KT_PROPERTY_INFO, "getKtPropertyInfo", "()Lgodot/core/KtPropertyInfo;") + INIT_JNI_METHOD(GET_KT_PROPERTY_INFO, "getKtPropertyInfo", "()Lgodot/registration/KtPropertyInfo;") INIT_JNI_METHOD(CALL_GET, "callGet", "(Lgodot/core/KtObject;)V") INIT_JNI_METHOD(CALL_SET, "callSet", "(Lgodot/core/KtObject;)V") ) diff --git a/src/jvm_wrapper/registration/kt_rpc_config.h b/src/jvm_wrapper/registration/kt_rpc_config.h index f665daeaee..8890a80ea9 100644 --- a/src/jvm_wrapper/registration/kt_rpc_config.h +++ b/src/jvm_wrapper/registration/kt_rpc_config.h @@ -6,7 +6,7 @@ #include "jvm_wrapper/jvm_instance_wrapper.h" #include "scene/main/multiplayer_api.h" -JVM_INSTANCE_WRAPPER(KtRpcConfig, "godot.core.KtRpcConfig") { +JVM_INSTANCE_WRAPPER(KtRpcConfig, "godot.registration.KtRpcConfig") { JVM_CLASS(KtRpcConfig) // clang-format off diff --git a/src/jvm_wrapper/registration/kt_signal_info.h b/src/jvm_wrapper/registration/kt_signal_info.h index b21b48ff8b..2fad5a15e9 100644 --- a/src/jvm_wrapper/registration/kt_signal_info.h +++ b/src/jvm_wrapper/registration/kt_signal_info.h @@ -5,7 +5,7 @@ #include "jvm_wrapper/jvm_instance_wrapper.h" #include "kt_property.h" -JVM_INSTANCE_WRAPPER(KtSignalInfo, "godot.core.KtSignalInfo") { +JVM_INSTANCE_WRAPPER(KtSignalInfo, "godot.registration.KtSignalInfo") { JVM_CLASS(KtSignalInfo) // clang-format off @@ -14,7 +14,7 @@ JVM_INSTANCE_WRAPPER(KtSignalInfo, "godot.core.KtSignalInfo") { INIT_JNI_BINDINGS( INIT_JNI_METHOD(GET_NAME, "getName", "()Ljava/lang/String;") - INIT_JNI_METHOD(GET_ARGUMENTS, "getArguments", "()[Lgodot/core/KtPropertyInfo;") + INIT_JNI_METHOD(GET_ARGUMENTS, "getArguments", "()[Lgodot/registration/KtPropertyInfo;") ) // clang-format on