@onekeyfe/react-native-chart-webview 3.0.81 → 3.0.82
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.
- package/lib/nitrogen/generated/android/c++/JFunc_void.hpp +3 -3
- package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +3 -3
- package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +49 -48
- package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +20 -22
- package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +53 -53
- package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +4 -4
- package/lib/nitrogen/generated/android/chartwebview+autolinking.cmake +1 -1
- package/lib/nitrogen/generated/android/chartwebview+autolinking.gradle +1 -1
- package/lib/nitrogen/generated/android/chartwebviewOnLoad.cpp +30 -20
- package/lib/nitrogen/generated/android/chartwebviewOnLoad.hpp +14 -5
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +17 -19
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +40 -10
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +1 -1
- package/lib/nitrogen/generated/ios/ChartWebview+autolinking.rb +2 -2
- package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +1 -1
- package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +5 -5
- package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +1 -1
- package/lib/nitrogen/generated/ios/ChartWebviewAutolinking.mm +1 -1
- package/lib/nitrogen/generated/ios/ChartWebviewAutolinking.swift +9 -8
- package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +1 -1
- package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +7 -1
- package/lib/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +27 -1
- package/lib/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +3 -4
- package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +18 -2
- package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +1 -1
- package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +1 -1
- package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +10 -26
- package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +9 -6
- package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void.hpp +3 -3
- package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +3 -3
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +49 -48
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +20 -22
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +53 -53
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +4 -4
- package/lib/nitrogen/nitrogen/generated/android/chartwebview+autolinking.cmake +1 -1
- package/lib/nitrogen/nitrogen/generated/android/chartwebview+autolinking.gradle +1 -1
- package/lib/nitrogen/nitrogen/generated/android/chartwebviewOnLoad.cpp +30 -20
- package/lib/nitrogen/nitrogen/generated/android/chartwebviewOnLoad.hpp +14 -5
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +17 -19
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +40 -10
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview+autolinking.rb +2 -2
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +5 -5
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebviewAutolinking.mm +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebviewAutolinking.swift +9 -8
- package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +7 -1
- package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +27 -1
- package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +3 -4
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +18 -2
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +1 -1
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +1 -1
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +10 -26
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +9 -6
- package/nitrogen/generated/android/c++/JFunc_void.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +3 -3
- package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +49 -48
- package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +20 -22
- package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +53 -53
- package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +4 -4
- package/nitrogen/generated/android/chartwebview+autolinking.cmake +1 -1
- package/nitrogen/generated/android/chartwebview+autolinking.gradle +1 -1
- package/nitrogen/generated/android/chartwebviewOnLoad.cpp +30 -20
- package/nitrogen/generated/android/chartwebviewOnLoad.hpp +14 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +17 -19
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +40 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +1 -1
- package/nitrogen/generated/ios/ChartWebview+autolinking.rb +2 -2
- package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +5 -5
- package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/ChartWebviewAutolinking.mm +1 -1
- package/nitrogen/generated/ios/ChartWebviewAutolinking.swift +9 -8
- package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +27 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +3 -4
- package/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +18 -2
- package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +10 -26
- package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +9 -6
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -23,7 +23,7 @@ namespace margelo::nitro::chartwebview {
|
|
|
23
23
|
*/
|
|
24
24
|
struct JFunc_void: public jni::JavaClass<JFunc_void> {
|
|
25
25
|
public:
|
|
26
|
-
static auto
|
|
26
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/Func_void;";
|
|
27
27
|
|
|
28
28
|
public:
|
|
29
29
|
/**
|
|
@@ -59,7 +59,7 @@ namespace margelo::nitro::chartwebview {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
public:
|
|
62
|
-
static auto
|
|
62
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/Func_void_cxx;";
|
|
63
63
|
static void registerNatives() {
|
|
64
64
|
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_cxx::invoke_cxx)});
|
|
65
65
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void_std__string.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -24,7 +24,7 @@ namespace margelo::nitro::chartwebview {
|
|
|
24
24
|
*/
|
|
25
25
|
struct JFunc_void_std__string: public jni::JavaClass<JFunc_void_std__string> {
|
|
26
26
|
public:
|
|
27
|
-
static auto
|
|
27
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/Func_void_std__string;";
|
|
28
28
|
|
|
29
29
|
public:
|
|
30
30
|
/**
|
|
@@ -60,7 +60,7 @@ namespace margelo::nitro::chartwebview {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
public:
|
|
63
|
-
static auto
|
|
63
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/Func_void_std__string_cxx;";
|
|
64
64
|
static void registerNatives() {
|
|
65
65
|
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_cxx::invoke_cxx)});
|
|
66
66
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHybridChartWebviewSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JHybridChartWebviewSpec.hpp"
|
|
@@ -18,125 +18,126 @@
|
|
|
18
18
|
|
|
19
19
|
namespace margelo::nitro::chartwebview {
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
21
|
+
std::shared_ptr<JHybridChartWebviewSpec> JHybridChartWebviewSpec::JavaPart::getJHybridChartWebviewSpec() {
|
|
22
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
23
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridChartWebviewSpec>(hybridObject);
|
|
24
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
25
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridChartWebviewSpec!");
|
|
26
|
+
}
|
|
27
|
+
return castHybridObject;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return method(_javaPart);
|
|
30
|
+
jni::local_ref<JHybridChartWebviewSpec::CxxPart::jhybriddata> JHybridChartWebviewSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
31
|
+
return makeCxxInstance(jThis);
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
std::shared_ptr<JHybridObject> JHybridChartWebviewSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
35
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridChartWebviewSpec::JavaPart>(javaPart);
|
|
36
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
37
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridChartWebviewSpec::JavaPart!");
|
|
38
|
+
}
|
|
39
|
+
return std::make_shared<JHybridChartWebviewSpec>(castJavaPart);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
void JHybridChartWebviewSpec::CxxPart::registerNatives() {
|
|
43
|
+
registerHybrid({
|
|
44
|
+
makeNativeMethod("initHybrid", JHybridChartWebviewSpec::CxxPart::initHybrid),
|
|
45
|
+
});
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
// Properties
|
|
48
49
|
std::optional<std::string> JHybridChartWebviewSpec::getUri() {
|
|
49
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getUri");
|
|
50
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getUri");
|
|
50
51
|
auto __result = method(_javaPart);
|
|
51
52
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
52
53
|
}
|
|
53
54
|
void JHybridChartWebviewSpec::setUri(const std::optional<std::string>& uri) {
|
|
54
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* uri */)>("setUri");
|
|
55
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* uri */)>("setUri");
|
|
55
56
|
method(_javaPart, uri.has_value() ? jni::make_jstring(uri.value()) : nullptr);
|
|
56
57
|
}
|
|
57
58
|
std::optional<std::string> JHybridChartWebviewSpec::getLocalBundle() {
|
|
58
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getLocalBundle");
|
|
59
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getLocalBundle");
|
|
59
60
|
auto __result = method(_javaPart);
|
|
60
61
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
61
62
|
}
|
|
62
63
|
void JHybridChartWebviewSpec::setLocalBundle(const std::optional<std::string>& localBundle) {
|
|
63
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* localBundle */)>("setLocalBundle");
|
|
64
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* localBundle */)>("setLocalBundle");
|
|
64
65
|
method(_javaPart, localBundle.has_value() ? jni::make_jstring(localBundle.value()) : nullptr);
|
|
65
66
|
}
|
|
66
67
|
std::optional<std::string> JHybridChartWebviewSpec::getEntry() {
|
|
67
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getEntry");
|
|
68
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getEntry");
|
|
68
69
|
auto __result = method(_javaPart);
|
|
69
70
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
70
71
|
}
|
|
71
72
|
void JHybridChartWebviewSpec::setEntry(const std::optional<std::string>& entry) {
|
|
72
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* entry */)>("setEntry");
|
|
73
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* entry */)>("setEntry");
|
|
73
74
|
method(_javaPart, entry.has_value() ? jni::make_jstring(entry.value()) : nullptr);
|
|
74
75
|
}
|
|
75
76
|
std::optional<std::string> JHybridChartWebviewSpec::getParamsJson() {
|
|
76
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getParamsJson");
|
|
77
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getParamsJson");
|
|
77
78
|
auto __result = method(_javaPart);
|
|
78
79
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
79
80
|
}
|
|
80
81
|
void JHybridChartWebviewSpec::setParamsJson(const std::optional<std::string>& paramsJson) {
|
|
81
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* paramsJson */)>("setParamsJson");
|
|
82
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* paramsJson */)>("setParamsJson");
|
|
82
83
|
method(_javaPart, paramsJson.has_value() ? jni::make_jstring(paramsJson.value()) : nullptr);
|
|
83
84
|
}
|
|
84
85
|
std::optional<std::string> JHybridChartWebviewSpec::getAssetHost() {
|
|
85
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getAssetHost");
|
|
86
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getAssetHost");
|
|
86
87
|
auto __result = method(_javaPart);
|
|
87
88
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
88
89
|
}
|
|
89
90
|
void JHybridChartWebviewSpec::setAssetHost(const std::optional<std::string>& assetHost) {
|
|
90
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* assetHost */)>("setAssetHost");
|
|
91
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* assetHost */)>("setAssetHost");
|
|
91
92
|
method(_javaPart, assetHost.has_value() ? jni::make_jstring(assetHost.value()) : nullptr);
|
|
92
93
|
}
|
|
93
94
|
std::optional<std::string> JHybridChartWebviewSpec::getBridgeScript() {
|
|
94
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getBridgeScript");
|
|
95
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getBridgeScript");
|
|
95
96
|
auto __result = method(_javaPart);
|
|
96
97
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
97
98
|
}
|
|
98
99
|
void JHybridChartWebviewSpec::setBridgeScript(const std::optional<std::string>& bridgeScript) {
|
|
99
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* bridgeScript */)>("setBridgeScript");
|
|
100
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* bridgeScript */)>("setBridgeScript");
|
|
100
101
|
method(_javaPart, bridgeScript.has_value() ? jni::make_jstring(bridgeScript.value()) : nullptr);
|
|
101
102
|
}
|
|
102
103
|
std::optional<std::string> JHybridChartWebviewSpec::getReuseKey() {
|
|
103
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getReuseKey");
|
|
104
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getReuseKey");
|
|
104
105
|
auto __result = method(_javaPart);
|
|
105
106
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
106
107
|
}
|
|
107
108
|
void JHybridChartWebviewSpec::setReuseKey(const std::optional<std::string>& reuseKey) {
|
|
108
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* reuseKey */)>("setReuseKey");
|
|
109
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* reuseKey */)>("setReuseKey");
|
|
109
110
|
method(_javaPart, reuseKey.has_value() ? jni::make_jstring(reuseKey.value()) : nullptr);
|
|
110
111
|
}
|
|
111
112
|
std::optional<bool> JHybridChartWebviewSpec::getPooled() {
|
|
112
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getPooled");
|
|
113
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getPooled");
|
|
113
114
|
auto __result = method(_javaPart);
|
|
114
115
|
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
115
116
|
}
|
|
116
117
|
void JHybridChartWebviewSpec::setPooled(std::optional<bool> pooled) {
|
|
117
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* pooled */)>("setPooled");
|
|
118
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* pooled */)>("setPooled");
|
|
118
119
|
method(_javaPart, pooled.has_value() ? jni::JBoolean::valueOf(pooled.value()) : nullptr);
|
|
119
120
|
}
|
|
120
121
|
std::optional<bool> JHybridChartWebviewSpec::getActive() {
|
|
121
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getActive");
|
|
122
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getActive");
|
|
122
123
|
auto __result = method(_javaPart);
|
|
123
124
|
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
124
125
|
}
|
|
125
126
|
void JHybridChartWebviewSpec::setActive(std::optional<bool> active) {
|
|
126
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* active */)>("setActive");
|
|
127
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* active */)>("setActive");
|
|
127
128
|
method(_javaPart, active.has_value() ? jni::JBoolean::valueOf(active.value()) : nullptr);
|
|
128
129
|
}
|
|
129
130
|
std::optional<bool> JHybridChartWebviewSpec::getWebviewDebuggingEnabled() {
|
|
130
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getWebviewDebuggingEnabled");
|
|
131
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getWebviewDebuggingEnabled");
|
|
131
132
|
auto __result = method(_javaPart);
|
|
132
133
|
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
133
134
|
}
|
|
134
135
|
void JHybridChartWebviewSpec::setWebviewDebuggingEnabled(std::optional<bool> webviewDebuggingEnabled) {
|
|
135
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* webviewDebuggingEnabled */)>("setWebviewDebuggingEnabled");
|
|
136
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* webviewDebuggingEnabled */)>("setWebviewDebuggingEnabled");
|
|
136
137
|
method(_javaPart, webviewDebuggingEnabled.has_value() ? jni::JBoolean::valueOf(webviewDebuggingEnabled.value()) : nullptr);
|
|
137
138
|
}
|
|
138
139
|
std::optional<std::function<void(const std::string& /* message */)>> JHybridChartWebviewSpec::getOnMessage() {
|
|
139
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnMessage_cxx");
|
|
140
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnMessage_cxx");
|
|
140
141
|
auto __result = method(_javaPart);
|
|
141
142
|
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* message */)> {
|
|
142
143
|
if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
|
|
@@ -149,11 +150,11 @@ namespace margelo::nitro::chartwebview {
|
|
|
149
150
|
}()) : std::nullopt;
|
|
150
151
|
}
|
|
151
152
|
void JHybridChartWebviewSpec::setOnMessage(const std::optional<std::function<void(const std::string& /* message */)>>& onMessage) {
|
|
152
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onMessage */)>("setOnMessage_cxx");
|
|
153
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onMessage */)>("setOnMessage_cxx");
|
|
153
154
|
method(_javaPart, onMessage.has_value() ? JFunc_void_std__string_cxx::fromCpp(onMessage.value()) : nullptr);
|
|
154
155
|
}
|
|
155
156
|
std::optional<std::function<void()>> JHybridChartWebviewSpec::getOnLoadEnd() {
|
|
156
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnLoadEnd_cxx");
|
|
157
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnLoadEnd_cxx");
|
|
157
158
|
auto __result = method(_javaPart);
|
|
158
159
|
return __result != nullptr ? std::make_optional([&]() -> std::function<void()> {
|
|
159
160
|
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
@@ -166,11 +167,11 @@ namespace margelo::nitro::chartwebview {
|
|
|
166
167
|
}()) : std::nullopt;
|
|
167
168
|
}
|
|
168
169
|
void JHybridChartWebviewSpec::setOnLoadEnd(const std::optional<std::function<void()>>& onLoadEnd) {
|
|
169
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onLoadEnd */)>("setOnLoadEnd_cxx");
|
|
170
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onLoadEnd */)>("setOnLoadEnd_cxx");
|
|
170
171
|
method(_javaPart, onLoadEnd.has_value() ? JFunc_void_cxx::fromCpp(onLoadEnd.value()) : nullptr);
|
|
171
172
|
}
|
|
172
173
|
std::optional<std::function<void(const std::string& /* message */)>> JHybridChartWebviewSpec::getOnError() {
|
|
173
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnError_cxx");
|
|
174
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnError_cxx");
|
|
174
175
|
auto __result = method(_javaPart);
|
|
175
176
|
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* message */)> {
|
|
176
177
|
if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
|
|
@@ -183,21 +184,21 @@ namespace margelo::nitro::chartwebview {
|
|
|
183
184
|
}()) : std::nullopt;
|
|
184
185
|
}
|
|
185
186
|
void JHybridChartWebviewSpec::setOnError(const std::optional<std::function<void(const std::string& /* message */)>>& onError) {
|
|
186
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onError */)>("setOnError_cxx");
|
|
187
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onError */)>("setOnError_cxx");
|
|
187
188
|
method(_javaPart, onError.has_value() ? JFunc_void_std__string_cxx::fromCpp(onError.value()) : nullptr);
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
// Methods
|
|
191
192
|
void JHybridChartWebviewSpec::postMessage(const std::string& message) {
|
|
192
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* message */)>("postMessage");
|
|
193
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* message */)>("postMessage");
|
|
193
194
|
method(_javaPart, jni::make_jstring(message));
|
|
194
195
|
}
|
|
195
196
|
void JHybridChartWebviewSpec::reload() {
|
|
196
|
-
static const auto method = javaClassStatic()->getMethod<void()>("reload");
|
|
197
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void()>("reload");
|
|
197
198
|
method(_javaPart);
|
|
198
199
|
}
|
|
199
200
|
void JHybridChartWebviewSpec::clearSnapshot() {
|
|
200
|
-
static const auto method = javaClassStatic()->getMethod<void()>("clearSnapshot");
|
|
201
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void()>("clearSnapshot");
|
|
201
202
|
method(_javaPart);
|
|
202
203
|
}
|
|
203
204
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridChartWebviewSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -18,33 +18,33 @@ namespace margelo::nitro::chartwebview {
|
|
|
18
18
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
21
|
-
class JHybridChartWebviewSpec: public
|
|
22
|
-
public virtual HybridChartWebviewSpec {
|
|
21
|
+
class JHybridChartWebviewSpec: public virtual HybridChartWebviewSpec, public virtual JHybridObject {
|
|
23
22
|
public:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
HybridBase
|
|
33
|
-
|
|
23
|
+
struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/HybridChartWebviewSpec;";
|
|
25
|
+
std::shared_ptr<JHybridChartWebviewSpec> getJHybridChartWebviewSpec();
|
|
26
|
+
};
|
|
27
|
+
struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/HybridChartWebviewSpec$CxxPart;";
|
|
29
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
30
|
+
static void registerNatives();
|
|
31
|
+
using HybridBase::HybridBase;
|
|
32
|
+
protected:
|
|
33
|
+
std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
|
|
34
|
+
};
|
|
34
35
|
|
|
35
36
|
public:
|
|
37
|
+
explicit JHybridChartWebviewSpec(const jni::local_ref<JHybridChartWebviewSpec::JavaPart>& javaPart):
|
|
38
|
+
HybridObject(HybridChartWebviewSpec::TAG),
|
|
39
|
+
JHybridObject(javaPart),
|
|
40
|
+
_javaPart(jni::make_global(javaPart)) {}
|
|
36
41
|
~JHybridChartWebviewSpec() override {
|
|
37
42
|
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
43
|
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
public:
|
|
42
|
-
|
|
43
|
-
void dispose() noexcept override;
|
|
44
|
-
std::string toString() override;
|
|
45
|
-
|
|
46
|
-
public:
|
|
47
|
-
inline const jni::global_ref<JHybridChartWebviewSpec::javaobject>& getJavaPart() const noexcept {
|
|
47
|
+
inline const jni::global_ref<JHybridChartWebviewSpec::JavaPart>& getJavaPart() const noexcept {
|
|
48
48
|
return _javaPart;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -84,9 +84,7 @@ namespace margelo::nitro::chartwebview {
|
|
|
84
84
|
void clearSnapshot() override;
|
|
85
85
|
|
|
86
86
|
private:
|
|
87
|
-
|
|
88
|
-
using HybridBase::HybridBase;
|
|
89
|
-
jni::global_ref<JHybridChartWebviewSpec::javaobject> _javaPart;
|
|
87
|
+
jni::global_ref<JHybridChartWebviewSpec::JavaPart> _javaPart;
|
|
90
88
|
};
|
|
91
89
|
|
|
92
90
|
} // namespace margelo::nitro::chartwebview
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
/// JHybridChartWebviewStateUpdater.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JHybridChartWebviewStateUpdater.hpp"
|
|
9
9
|
#include "views/HybridChartWebviewComponent.hpp"
|
|
10
10
|
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
#include <react/fabric/StateWrapperImpl.h>
|
|
11
12
|
|
|
12
13
|
namespace margelo::nitro::chartwebview::views {
|
|
13
14
|
|
|
@@ -15,89 +16,88 @@ using namespace facebook;
|
|
|
15
16
|
using ConcreteStateData = react::ConcreteState<HybridChartWebviewState>;
|
|
16
17
|
|
|
17
18
|
void JHybridChartWebviewStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
18
|
-
jni::alias_ref<JHybridChartWebviewSpec::
|
|
19
|
+
jni::alias_ref<JHybridChartWebviewSpec::JavaPart> javaView,
|
|
19
20
|
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
|
|
20
|
-
JHybridChartWebviewSpec
|
|
21
|
+
std::shared_ptr<JHybridChartWebviewSpec> hybridView = javaView->getJHybridChartWebviewSpec();
|
|
21
22
|
|
|
22
23
|
// Get concrete StateWrapperImpl from passed StateWrapper interface object
|
|
23
24
|
jobject rawStateWrapper = stateWrapperInterface.get();
|
|
24
|
-
if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
|
|
25
|
+
if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) [[unlikely]] {
|
|
25
26
|
throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
|
|
26
27
|
}
|
|
27
28
|
auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
|
|
28
29
|
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
29
|
-
|
|
30
30
|
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
31
|
-
auto concreteState = std::
|
|
31
|
+
auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
|
|
32
32
|
const HybridChartWebviewState& data = concreteState->getData();
|
|
33
|
-
const std::
|
|
34
|
-
if (
|
|
33
|
+
const std::shared_ptr<HybridChartWebviewProps>& props = data.getProps();
|
|
34
|
+
if (props == nullptr) [[unlikely]] {
|
|
35
35
|
// Props aren't set yet!
|
|
36
36
|
throw std::runtime_error("HybridChartWebviewState's data doesn't contain any props!");
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
|
|
39
|
+
// Update all props if they are dirty
|
|
40
|
+
if (props->uri.isDirty) {
|
|
41
|
+
hybridView->setUri(props->uri.value);
|
|
42
|
+
props->uri.isDirty = false;
|
|
42
43
|
}
|
|
43
|
-
if (props
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if (props->localBundle.isDirty) {
|
|
45
|
+
hybridView->setLocalBundle(props->localBundle.value);
|
|
46
|
+
props->localBundle.isDirty = false;
|
|
46
47
|
}
|
|
47
|
-
if (props
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
if (props->entry.isDirty) {
|
|
49
|
+
hybridView->setEntry(props->entry.value);
|
|
50
|
+
props->entry.isDirty = false;
|
|
50
51
|
}
|
|
51
|
-
if (props
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if (props->paramsJson.isDirty) {
|
|
53
|
+
hybridView->setParamsJson(props->paramsJson.value);
|
|
54
|
+
props->paramsJson.isDirty = false;
|
|
54
55
|
}
|
|
55
|
-
if (props
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
if (props->assetHost.isDirty) {
|
|
57
|
+
hybridView->setAssetHost(props->assetHost.value);
|
|
58
|
+
props->assetHost.isDirty = false;
|
|
58
59
|
}
|
|
59
|
-
if (props
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
if (props->bridgeScript.isDirty) {
|
|
61
|
+
hybridView->setBridgeScript(props->bridgeScript.value);
|
|
62
|
+
props->bridgeScript.isDirty = false;
|
|
62
63
|
}
|
|
63
|
-
if (props
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
if (props->reuseKey.isDirty) {
|
|
65
|
+
hybridView->setReuseKey(props->reuseKey.value);
|
|
66
|
+
props->reuseKey.isDirty = false;
|
|
66
67
|
}
|
|
67
|
-
if (props
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
if (props->pooled.isDirty) {
|
|
69
|
+
hybridView->setPooled(props->pooled.value);
|
|
70
|
+
props->pooled.isDirty = false;
|
|
70
71
|
}
|
|
71
|
-
if (props
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
if (props->active.isDirty) {
|
|
73
|
+
hybridView->setActive(props->active.value);
|
|
74
|
+
props->active.isDirty = false;
|
|
74
75
|
}
|
|
75
|
-
if (props
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
if (props->webviewDebuggingEnabled.isDirty) {
|
|
77
|
+
hybridView->setWebviewDebuggingEnabled(props->webviewDebuggingEnabled.value);
|
|
78
|
+
props->webviewDebuggingEnabled.isDirty = false;
|
|
78
79
|
}
|
|
79
|
-
if (props
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
if (props->onMessage.isDirty) {
|
|
81
|
+
hybridView->setOnMessage(props->onMessage.value);
|
|
82
|
+
props->onMessage.isDirty = false;
|
|
82
83
|
}
|
|
83
|
-
if (props
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
if (props->onLoadEnd.isDirty) {
|
|
85
|
+
hybridView->setOnLoadEnd(props->onLoadEnd.value);
|
|
86
|
+
props->onLoadEnd.isDirty = false;
|
|
86
87
|
}
|
|
87
|
-
if (props
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
if (props->onError.isDirty) {
|
|
89
|
+
hybridView->setOnError(props->onError.value);
|
|
90
|
+
props->onError.isDirty = false;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
// Update hybridRef if it changed
|
|
93
|
-
if (props
|
|
94
|
+
if (props->hybridRef.isDirty) {
|
|
94
95
|
// hybridRef changed - call it with new this
|
|
95
|
-
const auto& maybeFunc = props
|
|
96
|
+
const auto& maybeFunc = props->hybridRef.value;
|
|
96
97
|
if (maybeFunc.has_value()) {
|
|
97
|
-
|
|
98
|
-
maybeFunc.value()(shared);
|
|
98
|
+
maybeFunc.value()(hybridView);
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
props->hybridRef.isDirty = false;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHybridChartWebviewStateUpdater.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
#endif
|
|
13
13
|
|
|
14
14
|
#include <fbjni/fbjni.h>
|
|
15
|
-
#include <react/fabric/StateWrapperImpl.h>
|
|
16
15
|
#include <react/fabric/CoreComponentsRegistry.h>
|
|
16
|
+
#include <react/fabric/StateWrapperImpl.h>
|
|
17
17
|
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
18
18
|
#include <NitroModules/NitroDefines.hpp>
|
|
19
19
|
#include <NitroModules/JStateWrapper.hpp>
|
|
@@ -24,13 +24,13 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
24
24
|
|
|
25
25
|
using namespace facebook;
|
|
26
26
|
|
|
27
|
-
class JHybridChartWebviewStateUpdater: public jni::JavaClass<JHybridChartWebviewStateUpdater> {
|
|
27
|
+
class JHybridChartWebviewStateUpdater final: public jni::JavaClass<JHybridChartWebviewStateUpdater> {
|
|
28
28
|
public:
|
|
29
29
|
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater;";
|
|
30
30
|
|
|
31
31
|
public:
|
|
32
32
|
static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
33
|
-
jni::alias_ref<JHybridChartWebviewSpec::
|
|
33
|
+
jni::alias_ref<JHybridChartWebviewSpec::JavaPart> view,
|
|
34
34
|
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
|
|
35
35
|
|
|
36
36
|
public:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# chartwebview+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a CMake file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// chartwebview+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// chartwebviewOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_CHARTWEBVIEW_WITH_GENERATED_CMAKE_PROJECT
|
|
@@ -24,27 +24,37 @@
|
|
|
24
24
|
namespace margelo::nitro::chartwebview {
|
|
25
25
|
|
|
26
26
|
int initialize(JavaVM* vm) {
|
|
27
|
+
return facebook::jni::initialize(vm, []() {
|
|
28
|
+
::margelo::nitro::chartwebview::registerAllNatives();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
struct JHybridChartWebviewSpecImpl: public jni::JavaClass<JHybridChartWebviewSpecImpl, JHybridChartWebviewSpec::JavaPart> {
|
|
33
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/chartwebview/HybridChartWebview;";
|
|
34
|
+
static std::shared_ptr<JHybridChartWebviewSpec> create() {
|
|
35
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridChartWebviewSpecImpl::javaobject()>();
|
|
36
|
+
jni::local_ref<JHybridChartWebviewSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
37
|
+
return javaPart->getJHybridChartWebviewSpec();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
void registerAllNatives() {
|
|
27
42
|
using namespace margelo::nitro;
|
|
28
43
|
using namespace margelo::nitro::chartwebview;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
auto instance = object.create();
|
|
44
|
-
return instance->cthis()->shared();
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
});
|
|
44
|
+
|
|
45
|
+
// Register native JNI methods
|
|
46
|
+
margelo::nitro::chartwebview::JHybridChartWebviewSpec::CxxPart::registerNatives();
|
|
47
|
+
margelo::nitro::chartwebview::JFunc_void_std__string_cxx::registerNatives();
|
|
48
|
+
margelo::nitro::chartwebview::JFunc_void_cxx::registerNatives();
|
|
49
|
+
margelo::nitro::chartwebview::views::JHybridChartWebviewStateUpdater::registerNatives();
|
|
50
|
+
|
|
51
|
+
// Register Nitro Hybrid Objects
|
|
52
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
53
|
+
"ChartWebview",
|
|
54
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
55
|
+
return JHybridChartWebviewSpecImpl::create();
|
|
56
|
+
}
|
|
57
|
+
);
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
} // namespace margelo::nitro::chartwebview
|