@preeternal/react-native-godot 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE +22 -0
  2. package/Package.swift +106 -0
  3. package/README.md +590 -2
  4. package/android/build.gradle +291 -0
  5. package/android/consumer-rules.pro +20 -0
  6. package/android/fix-prefab.gradle +54 -0
  7. package/android/src/main/AndroidManifest.xml +2 -0
  8. package/android/src/main/cpp/CMakeLists.txt +78 -0
  9. package/android/src/main/cpp/GodotModule.cpp +764 -0
  10. package/android/src/main/cpp/OnLoad.cpp +66 -0
  11. package/android/src/main/cpp/libgodot_android.h +73 -0
  12. package/android/src/main/cpp/libgodot_jni.cpp +658 -0
  13. package/android/src/main/cpp/libgodot_jni.h +116 -0
  14. package/android/src/main/cpp/native_godot_module_jni.cpp +86 -0
  15. package/android/src/main/cpp/native_godot_module_jni.h +58 -0
  16. package/android/src/main/java/com/preeternal/reactnativegodot/NativeGodotModuleModule.kt +83 -0
  17. package/android/src/main/java/com/preeternal/reactnativegodot/NativeGodotModulePackage.kt +41 -0
  18. package/android/src/main/java/com/preeternal/reactnativegodot/NativeLibraryLoader.kt +5 -0
  19. package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotIO.kt +123 -0
  20. package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotView.kt +92 -0
  21. package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotViewManager.kt +34 -0
  22. package/android/src/main/java/com/preeternal/reactnativegodot/RTNLibGodot.kt +215 -0
  23. package/android/src/main/res/layout/downloading_expansion.xml +165 -0
  24. package/android/src/main/res/layout/godot_app_layout.xml +5 -0
  25. package/android/src/main/res/layout/snackbar.xml +27 -0
  26. package/android/src/main/res/layout/status_bar_ongoing_event_progress_bar.xml +108 -0
  27. package/android/src/main/res/mipmap/icon.png +0 -0
  28. package/android/src/main/res/mipmap/icon_background.png +0 -0
  29. package/android/src/main/res/mipmap/icon_foreground.png +0 -0
  30. package/android/src/main/res/mipmap/icon_monochrome.png +0 -0
  31. package/android/src/main/res/mipmap-anydpi-v26/icon.xml +8 -0
  32. package/android/src/main/res/mipmap-anydpi-v26/themed_icon.xml +11 -0
  33. package/android/src/main/res/mipmap-hdpi/icon.png +0 -0
  34. package/android/src/main/res/mipmap-hdpi/icon_background.png +0 -0
  35. package/android/src/main/res/mipmap-hdpi/icon_foreground.png +0 -0
  36. package/android/src/main/res/mipmap-hdpi/icon_monochrome.png +0 -0
  37. package/android/src/main/res/mipmap-mdpi/icon.png +0 -0
  38. package/android/src/main/res/mipmap-mdpi/icon_background.png +0 -0
  39. package/android/src/main/res/mipmap-mdpi/icon_foreground.png +0 -0
  40. package/android/src/main/res/mipmap-mdpi/icon_monochrome.png +0 -0
  41. package/android/src/main/res/mipmap-xhdpi/icon.png +0 -0
  42. package/android/src/main/res/mipmap-xhdpi/icon_background.png +0 -0
  43. package/android/src/main/res/mipmap-xhdpi/icon_foreground.png +0 -0
  44. package/android/src/main/res/mipmap-xhdpi/icon_monochrome.png +0 -0
  45. package/android/src/main/res/mipmap-xxhdpi/icon.png +0 -0
  46. package/android/src/main/res/mipmap-xxhdpi/icon_background.png +0 -0
  47. package/android/src/main/res/mipmap-xxhdpi/icon_foreground.png +0 -0
  48. package/android/src/main/res/mipmap-xxhdpi/icon_monochrome.png +0 -0
  49. package/android/src/main/res/mipmap-xxxhdpi/icon.png +0 -0
  50. package/android/src/main/res/mipmap-xxxhdpi/icon_background.png +0 -0
  51. package/android/src/main/res/mipmap-xxxhdpi/icon_foreground.png +0 -0
  52. package/android/src/main/res/mipmap-xxxhdpi/icon_monochrome.png +0 -0
  53. package/android/src/main/res/values/dimens.xml +9 -0
  54. package/android/src/main/res/values/strings.xml +61 -0
  55. package/android/src/main/res/values/styles.xml +25 -0
  56. package/android/src/main/res/values-fa/strings.xml +14 -0
  57. package/android/src/main/res/values-ko/strings.xml +54 -0
  58. package/android/src/main/res/xml/godot_provider_paths.xml +15 -0
  59. package/android/src/test/java/com/preeternal/reactnativegodot/NativeGodotModulePackageTest.kt +26 -0
  60. package/app.plugin.js +169 -0
  61. package/cpp/AppleRendererPolicy.h +95 -0
  62. package/cpp/GodotModule.h +126 -0
  63. package/cpp/LibGodotABI.h +52 -0
  64. package/cpp/NativeGodotModule.cpp +825 -0
  65. package/cpp/NativeGodotModule.h +45 -0
  66. package/cpp/godot-log.h +64 -0
  67. package/ios/GodotModule.mm +695 -0
  68. package/ios/NativeGodotModuleProvider.h +35 -0
  69. package/ios/NativeGodotModuleProvider.mm +42 -0
  70. package/ios/RTNGodotView.h +42 -0
  71. package/ios/RTNGodotView.mm +671 -0
  72. package/ios/log.mm +38 -0
  73. package/lib/module/NativeNativeGodotModule.js +59 -0
  74. package/lib/module/NativeNativeGodotModule.js.map +1 -0
  75. package/lib/module/RTNGodotView.js +6 -0
  76. package/lib/module/RTNGodotView.js.map +1 -0
  77. package/lib/module/RTNGodotView.native.js +5 -0
  78. package/lib/module/RTNGodotView.native.js.map +1 -0
  79. package/lib/module/RTNGodotViewNativeComponent.ts +37 -0
  80. package/lib/module/index.js +30 -0
  81. package/lib/module/index.js.map +1 -0
  82. package/lib/module/package.json +1 -0
  83. package/lib/typescript/package.json +1 -0
  84. package/lib/typescript/src/NativeNativeGodotModule.d.ts +26 -0
  85. package/lib/typescript/src/NativeNativeGodotModule.d.ts.map +1 -0
  86. package/lib/typescript/src/RTNGodotView.d.ts +7 -0
  87. package/lib/typescript/src/RTNGodotView.d.ts.map +1 -0
  88. package/lib/typescript/src/RTNGodotView.native.d.ts +3 -0
  89. package/lib/typescript/src/RTNGodotView.native.d.ts.map +1 -0
  90. package/lib/typescript/src/RTNGodotViewNativeComponent.d.ts +11 -0
  91. package/lib/typescript/src/RTNGodotViewNativeComponent.d.ts.map +1 -0
  92. package/lib/typescript/src/index.d.ts +6 -0
  93. package/lib/typescript/src/index.d.ts.map +1 -0
  94. package/package.json +282 -4
  95. package/prebuilt-utils.rb +46 -0
  96. package/react-native-godot.podspec +41 -0
  97. package/react-native.config.js +16 -0
  98. package/scripts/check-16kb.sh +136 -0
  99. package/scripts/check-packaged-artifacts.sh +156 -0
  100. package/scripts/ci/verify-ios-simulator.py +48 -0
  101. package/scripts/ci/verify-prebuilt-install.cjs +41 -0
  102. package/scripts/download-prebuilt.js +283 -0
  103. package/scripts/prebuilt-config.js +80 -0
  104. package/scripts/spm-autolinking-plugin.js +87 -0
  105. package/src/NativeNativeGodotModule.ts +90 -0
  106. package/src/RTNGodotView.native.tsx +2 -0
  107. package/src/RTNGodotView.tsx +12 -0
  108. package/src/RTNGodotViewNativeComponent.ts +37 -0
  109. package/src/index.tsx +28 -0
@@ -0,0 +1,45 @@
1
+ /**************************************************************************/
2
+ /* NativeGodotModule.h */
3
+ /**************************************************************************/
4
+ /* Copyright (c) 2024-2025 Slay GmbH */
5
+ /* */
6
+ /* Permission is hereby granted, free of charge, to any person obtaining */
7
+ /* a copy of this software and associated documentation files (the */
8
+ /* "Software"), to deal in the Software without restriction, including */
9
+ /* without limitation the rights to use, copy, modify, merge, publish, */
10
+ /* distribute, sublicense, and/or sell copies of the Software, and to */
11
+ /* permit persons to whom the Software is furnished to do so, subject to */
12
+ /* the following conditions: */
13
+ /* */
14
+ /* The above copyright notice and this permission notice shall be */
15
+ /* included in all copies or substantial portions of the Software. */
16
+ /* */
17
+ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
18
+ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
19
+ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
20
+ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
21
+ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
22
+ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
23
+ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
24
+ /**************************************************************************/
25
+
26
+ #pragma once
27
+
28
+ #include "RTNGodotSpecJSI.h"
29
+ #include <ReactCommon/CallInvoker.h>
30
+ #include <jsi/jsi.h>
31
+
32
+ using namespace facebook;
33
+
34
+ jsi::Value createNativeGodotModule(jsi::Runtime &rt, const std::shared_ptr<facebook::react::CallInvoker> &callInvoker);
35
+
36
+ namespace facebook::react {
37
+
38
+ class NativeGodotModule : public NativeNativeGodotModuleCxxSpec<NativeGodotModule> {
39
+ public:
40
+ NativeGodotModule(std::shared_ptr<CallInvoker> jsInvoker);
41
+
42
+ bool installTurboModule(jsi::Runtime &rt);
43
+ };
44
+
45
+ } // namespace facebook::react
@@ -0,0 +1,64 @@
1
+ /**************************************************************************/
2
+ /* godot-log.h */
3
+ /**************************************************************************/
4
+ /* Copyright (c) 2024-2025 Slay GmbH */
5
+ /* */
6
+ /* Permission is hereby granted, free of charge, to any person obtaining */
7
+ /* a copy of this software and associated documentation files (the */
8
+ /* "Software"), to deal in the Software without restriction, including */
9
+ /* without limitation the rights to use, copy, modify, merge, publish, */
10
+ /* distribute, sublicense, and/or sell copies of the Software, and to */
11
+ /* permit persons to whom the Software is furnished to do so, subject to */
12
+ /* the following conditions: */
13
+ /* */
14
+ /* The above copyright notice and this permission notice shall be */
15
+ /* included in all copies or substantial portions of the Software. */
16
+ /* */
17
+ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
18
+ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
19
+ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
20
+ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
21
+ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
22
+ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
23
+ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
24
+ /**************************************************************************/
25
+
26
+ #pragma once
27
+
28
+ #ifndef LOG_TAG
29
+ #error "You should define LOG_TAG before including this header"
30
+ #endif
31
+
32
+ #ifdef ANDROID
33
+
34
+ #include <android/log.h>
35
+
36
+ #define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
37
+ #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
38
+ #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
39
+ #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
40
+ #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
41
+
42
+ #else
43
+
44
+ typedef enum ios_LogPriority {
45
+ ANDROID_LOG_UNKNOWN = 0,
46
+ IOS_LOG_DEFAULT, /* only for SetMinPriority() */
47
+ IOS_LOG_VERBOSE,
48
+ IOS_LOG_DEBUG,
49
+ IOS_LOG_INFO,
50
+ IOS_LOG_WARN,
51
+ IOS_LOG_ERROR,
52
+ IOS_LOG_FATAL,
53
+ IOS_LOG_SILENT, /* only for SetMinPriority(); must be last */
54
+ } ios_LogPriority;
55
+
56
+ void __ios_log_print(ios_LogPriority prio, const char *tag, ...);
57
+
58
+ #define LOGV(...) __ios_log_print(IOS_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
59
+ #define LOGD(...) __ios_log_print(IOS_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
60
+ #define LOGI(...) __ios_log_print(IOS_LOG_INFO, LOG_TAG, __VA_ARGS__)
61
+ #define LOGW(...) __ios_log_print(IOS_LOG_WARN, LOG_TAG, __VA_ARGS__)
62
+ #define LOGE(...) __ios_log_print(IOS_LOG_ERROR, LOG_TAG, __VA_ARGS__)
63
+
64
+ #endif