nitrowind-native 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/Package.swift +104 -0
- package/README.md +35 -2
- package/android/src/main/java/com/margelo/nitro/nitrowind/HybridReducedMotion.kt +79 -0
- package/android/src/main/java/com/margelo/nitro/nitrowind/HybridThemeCover.kt +38 -0
- package/android/src/main/java/com/margelo/nitro/nitrowind/NitroWindCoverLog.kt +36 -0
- package/android/src/main/java/com/margelo/nitro/nitrowind/ThemeCoverActivityInitializer.kt +11 -0
- package/android/src/main/java/com/margelo/nitro/nitrowind/ThemeCoverController.kt +619 -0
- package/ios/HybridReducedMotion.swift +50 -0
- package/ios/HybridThemeCover.swift +46 -0
- package/ios/NitroWindCoverLog.swift +40 -0
- package/ios/ThemeCoverWindow.swift +324 -0
- package/nitro.json +13 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroWindNative+autolinking.cmake +34 -0
- package/nitrogen/generated/android/NitroWindNative+autolinking.gradle +10 -0
- package/nitrogen/generated/android/NitroWindNativeOnLoad.cpp +25 -0
- package/nitrogen/generated/android/c++/JCallback_void.cpp +54 -0
- package/nitrogen/generated/android/c++/JCallback_void_bool.cpp +56 -0
- package/nitrogen/generated/android/c++/JCoverRequest.cpp +42 -0
- package/nitrogen/generated/android/c++/JHybridReducedMotionSpec.cpp +84 -0
- package/nitrogen/generated/android/c++/JHybridThemeCoverSpec.cpp +114 -0
- package/nitrogen/generated/android/c++/JListenerSubscription.cpp +34 -0
- package/nitrogen/generated/android/c++/JThemeTransitionDirection.cpp +52 -0
- package/nitrogen/generated/android/c++/JThemeTransitionStyle.cpp +58 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JCallback_void.hpp +53 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JCallback_void_bool.hpp +55 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JCoverRequest.hpp +73 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JHybridReducedMotionSpec.hpp +90 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JHybridReducedMotionSpecJavaPart.hpp +26 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JHybridThemeCoverSpec.hpp +96 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JHybridThemeCoverSpecJavaPart.hpp +26 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JListenerSubscription.hpp +49 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JThemeTransitionDirection.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroWindNative/private/JThemeTransitionStyle.hpp +82 -0
- package/nitrogen/generated/android/include/NitroWindNative/private/NitroWindNativeOnLoad.hpp +13 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/Callback_void.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/Callback_void_bool.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/CoverRequest.kt +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/HybridReducedMotionSpec.kt +89 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/HybridThemeCoverSpec.kt +107 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/ListenerSubscription.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/NitroWindNativeOnLoad.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/ThemeTransitionDirection.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrowind/ThemeTransitionStyle.kt +52 -0
- package/nitrogen/generated/apple/NitroWindNative-Swift-Cxx-Bridge.cpp +68 -0
- package/nitrogen/generated/apple/NitroWindNativeAppleCxx/NitroWindNativeAppleCxx.cpp +9 -0
- package/nitrogen/generated/apple/NitroWindNativeAppleCxx/include/NitroWindNativeAppleCxx/NitroWindNativeAppleCxx.h +64 -0
- package/nitrogen/generated/apple/NitroWindNativeAutolinking.cpp +22 -0
- package/nitrogen/generated/apple/NitroWindNativeAutolinking.mm +24 -0
- package/nitrogen/generated/apple/c++/CoverRequest-Swift.cpp +36 -0
- package/nitrogen/generated/apple/c++/HybridReducedMotionSpecSwift.cpp +62 -0
- package/nitrogen/generated/apple/c++/HybridReducedMotionSpec_cxx-Swift.cpp +28 -0
- package/nitrogen/generated/apple/c++/HybridThemeCoverSpecSwift.cpp +104 -0
- package/nitrogen/generated/apple/c++/HybridThemeCoverSpec_cxx-Swift.cpp +28 -0
- package/nitrogen/generated/apple/c++/ListenerSubscription-Swift.cpp +37 -0
- package/nitrogen/generated/apple/c++/ThemeTransitionDirection-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/ThemeTransitionStyle-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/NitroWindNativeAutolinking.hpp +13 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/CoverRequest-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/HybridReducedMotionSpecSwift.hpp +74 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/HybridReducedMotionSpec_cxx-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/HybridThemeCoverSpecSwift.hpp +79 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/HybridThemeCoverSpec_cxx-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/ListenerSubscription-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/NitroWindNative-Swift-Cxx-Umbrella.hpp +41 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/ThemeTransitionDirection-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWindNative/private/ThemeTransitionStyle-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/module.modulemap +12 -0
- package/nitrogen/generated/apple/swift/Callback_void.swift +60 -0
- package/nitrogen/generated/apple/swift/Callback_void_bool.swift +60 -0
- package/nitrogen/generated/apple/swift/CoverRequest.swift +56 -0
- package/nitrogen/generated/apple/swift/HybridReducedMotionSpec.swift +66 -0
- package/nitrogen/generated/apple/swift/HybridReducedMotionSpec_cxx.swift +164 -0
- package/nitrogen/generated/apple/swift/HybridThemeCoverSpec.swift +70 -0
- package/nitrogen/generated/apple/swift/HybridThemeCoverSpec_cxx.swift +207 -0
- package/nitrogen/generated/apple/swift/ListenerSubscription.swift +29 -0
- package/nitrogen/generated/apple/swift/Promise_bool.swift +100 -0
- package/nitrogen/generated/apple/swift/Promise_void.swift +100 -0
- package/nitrogen/generated/apple/swift/ThemeTransitionDirection.swift +54 -0
- package/nitrogen/generated/apple/swift/ThemeTransitionStyle.swift +64 -0
- package/nitrogen/generated/hybrid-classes.json +33 -0
- package/nitrogen/generated/shared/c++/NitroWindNativeCxxModule.cpp +2 -0
- package/nitrogen/generated/shared/c++/include/NitroWindNative/NitroWindNativeCxxModule.hpp +2 -0
- package/nitrogen/generated/shared/javascript/ReducedMotion.cjs +19 -0
- package/nitrogen/generated/shared/javascript/ReducedMotion.d.cts +9 -0
- package/nitrogen/generated/shared/javascript/ThemeCover.cjs +19 -0
- package/nitrogen/generated/shared/javascript/ThemeCover.d.cts +9 -0
- package/package.json +69 -4
- package/src/index.ts +59 -0
- package/src/specs/ListenerSubscription.ts +3 -0
- package/src/specs/ReducedMotion.nitro.ts +19 -0
- package/src/specs/ThemeCover.nitro.ts +49 -0
- package/src/testing.ts +18 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridReducedMotionSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <NitroWindNative/private/JHybridReducedMotionSpec.hpp>
|
|
9
|
+
#include <NitroModules/JNIConverter+Primitives.hpp>
|
|
10
|
+
#include <NitroModules/JSIConverter+JNIPrimitives.hpp>
|
|
11
|
+
#include <NitroWindNative/private/JListenerSubscription.hpp>
|
|
12
|
+
#include <NitroWindNative/private/JCallback_void_bool.hpp>
|
|
13
|
+
#include <NitroModules/JNIConverter+Callback.hpp>
|
|
14
|
+
#include <memory>
|
|
15
|
+
#include <NitroModules/JNIConverter+HybridObject.hpp>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitrowind {
|
|
18
|
+
|
|
19
|
+
JHybridReducedMotionSpec::~JHybridReducedMotionSpec() = default;
|
|
20
|
+
|
|
21
|
+
std::shared_ptr<JHybridReducedMotionSpec> JHybridReducedMotionSpec::constructor() {
|
|
22
|
+
static const auto __method = JHybridReducedMotionSpec::JavaPart::javaClassStatic()->getStaticMethod<jni::local_ref<JHybridReducedMotionSpecJavaPart>()>("constructor_cxx");
|
|
23
|
+
auto __result = __method(JHybridReducedMotionSpec::JavaPart::javaClassStatic());
|
|
24
|
+
return JNIConverter<std::shared_ptr<JHybridReducedMotionSpec>, jni::local_ref<JHybridReducedMotionSpecJavaPart>>::fromJNI(__result);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const std::shared_ptr<const HybridClass>& JHybridReducedMotionSpec::Class::get() {
|
|
28
|
+
static const auto hybridClass = HybridClass::create<Class>([](HybridClass& clazz) {
|
|
29
|
+
clazz.registerHybridMethod("isReducedMotionEnabled", &JHybridReducedMotionSpec::isReducedMotionEnabled);
|
|
30
|
+
clazz.registerHybridMethod("addOnReducedMotionChangedListener", &JHybridReducedMotionSpec::addOnReducedMotionChangedListener);
|
|
31
|
+
clazz.registerHybridConstructor(&JHybridReducedMotionSpec::constructor);
|
|
32
|
+
});
|
|
33
|
+
return hybridClass;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
std::shared_ptr<JHybridReducedMotionSpec> JHybridReducedMotionSpecJavaPart::getJHybridReducedMotionSpec() {
|
|
37
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
38
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridReducedMotionSpec>(hybridObject);
|
|
39
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
40
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridReducedMotionSpec!");
|
|
41
|
+
}
|
|
42
|
+
return castHybridObject;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
jni::local_ref<JHybridReducedMotionSpec::CxxPart::jhybriddata> JHybridReducedMotionSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
46
|
+
return makeCxxInstance(jThis);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
jni::alias_ref<jni::JClass> JHybridReducedMotionSpec::CxxPart::getClass() {
|
|
50
|
+
static const auto __field = CxxPart::javaClassStatic()->getStaticField<jni::JClass>("implementationClass_cxx");
|
|
51
|
+
static const auto __class = jni::make_global(CxxPart::javaClassStatic()->getStaticFieldValue(__field));
|
|
52
|
+
return __class;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
std::shared_ptr<JHybridObject> JHybridReducedMotionSpec::CxxPart::createHybridObject(jni::alias_ref<JHybridObject::JavaPart> javaPart) {
|
|
56
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridReducedMotionSpec::JavaPart>(javaPart);
|
|
57
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
58
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridReducedMotionSpec::JavaPart!");
|
|
59
|
+
}
|
|
60
|
+
return std::make_shared<JHybridReducedMotionSpec>(castJavaPart);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
void JHybridReducedMotionSpec::CxxPart::registerNatives() {
|
|
64
|
+
registerHybrid({
|
|
65
|
+
makeNativeMethod("initHybrid", JHybridReducedMotionSpec::CxxPart::initHybrid),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Properties
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
// Methods
|
|
73
|
+
jboolean JHybridReducedMotionSpec::isReducedMotionEnabled() {
|
|
74
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jboolean()>("isReducedMotionEnabled");
|
|
75
|
+
auto __result = __method(_javaPart, CxxPart::getClass());
|
|
76
|
+
return __result;
|
|
77
|
+
}
|
|
78
|
+
jni::local_ref<JListenerSubscription> JHybridReducedMotionSpec::addOnReducedMotionChangedListener(const jni::local_ref<JCallback<margelo::nitro::nitrowind::JCallback_void_bool::JavaPart>>& listener) {
|
|
79
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jni::local_ref<JListenerSubscription>(jni::alias_ref<JCallback<margelo::nitro::nitrowind::JCallback_void_bool::JavaPart>> /* listener */)>("addOnReducedMotionChangedListener");
|
|
80
|
+
auto __result = __method(_javaPart, CxxPart::getClass(), listener);
|
|
81
|
+
return __result;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro::nitrowind
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridThemeCoverSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <NitroWindNative/private/JHybridThemeCoverSpec.hpp>
|
|
9
|
+
#include <NitroModules/JNIConverter+Primitives.hpp>
|
|
10
|
+
#include <NitroModules/JSIConverter+JNIPrimitives.hpp>
|
|
11
|
+
#include <NitroModules/JNIConverter+Promise.hpp>
|
|
12
|
+
#include <NitroModules/JSIConverter+JTypedPromise.hpp>
|
|
13
|
+
#include <NitroModules/JNIConverter+String.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter+JString.hpp>
|
|
15
|
+
#include <NitroWindNative/private/JCoverRequest.hpp>
|
|
16
|
+
#include <memory>
|
|
17
|
+
#include <NitroModules/JNIConverter+HybridObject.hpp>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::nitrowind {
|
|
20
|
+
|
|
21
|
+
JHybridThemeCoverSpec::~JHybridThemeCoverSpec() = default;
|
|
22
|
+
|
|
23
|
+
std::shared_ptr<JHybridThemeCoverSpec> JHybridThemeCoverSpec::constructor() {
|
|
24
|
+
static const auto __method = JHybridThemeCoverSpec::JavaPart::javaClassStatic()->getStaticMethod<jni::local_ref<JHybridThemeCoverSpecJavaPart>()>("constructor_cxx");
|
|
25
|
+
auto __result = __method(JHybridThemeCoverSpec::JavaPart::javaClassStatic());
|
|
26
|
+
return JNIConverter<std::shared_ptr<JHybridThemeCoverSpec>, jni::local_ref<JHybridThemeCoverSpecJavaPart>>::fromJNI(__result);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const std::shared_ptr<const HybridClass>& JHybridThemeCoverSpec::Class::get() {
|
|
30
|
+
static const auto hybridClass = HybridClass::create<Class>([](HybridClass& clazz) {
|
|
31
|
+
clazz.registerHybridProperty("isSyncCaptureSupported", &JHybridThemeCoverSpec::getIsSyncCaptureSupported);
|
|
32
|
+
clazz.registerHybridMethod("captureCoverSync", &JHybridThemeCoverSpec::captureCoverSync);
|
|
33
|
+
clazz.registerHybridMethod("captureCoverAsync", &JHybridThemeCoverSpec::captureCoverAsync);
|
|
34
|
+
clazz.registerHybridMethod("finishCover", &JHybridThemeCoverSpec::finishCover);
|
|
35
|
+
clazz.registerHybridMethod("cancelCover", &JHybridThemeCoverSpec::cancelCover);
|
|
36
|
+
clazz.registerHybridMethod("isCoverActive", &JHybridThemeCoverSpec::isCoverActive);
|
|
37
|
+
clazz.registerHybridMethod("lastCaptureOutcome", &JHybridThemeCoverSpec::lastCaptureOutcome);
|
|
38
|
+
clazz.registerHybridConstructor(&JHybridThemeCoverSpec::constructor);
|
|
39
|
+
});
|
|
40
|
+
return hybridClass;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
std::shared_ptr<JHybridThemeCoverSpec> JHybridThemeCoverSpecJavaPart::getJHybridThemeCoverSpec() {
|
|
44
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
45
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridThemeCoverSpec>(hybridObject);
|
|
46
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
47
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridThemeCoverSpec!");
|
|
48
|
+
}
|
|
49
|
+
return castHybridObject;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
jni::local_ref<JHybridThemeCoverSpec::CxxPart::jhybriddata> JHybridThemeCoverSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
53
|
+
return makeCxxInstance(jThis);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
jni::alias_ref<jni::JClass> JHybridThemeCoverSpec::CxxPart::getClass() {
|
|
57
|
+
static const auto __field = CxxPart::javaClassStatic()->getStaticField<jni::JClass>("implementationClass_cxx");
|
|
58
|
+
static const auto __class = jni::make_global(CxxPart::javaClassStatic()->getStaticFieldValue(__field));
|
|
59
|
+
return __class;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
std::shared_ptr<JHybridObject> JHybridThemeCoverSpec::CxxPart::createHybridObject(jni::alias_ref<JHybridObject::JavaPart> javaPart) {
|
|
63
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridThemeCoverSpec::JavaPart>(javaPart);
|
|
64
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
65
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridThemeCoverSpec::JavaPart!");
|
|
66
|
+
}
|
|
67
|
+
return std::make_shared<JHybridThemeCoverSpec>(castJavaPart);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
void JHybridThemeCoverSpec::CxxPart::registerNatives() {
|
|
71
|
+
registerHybrid({
|
|
72
|
+
makeNativeMethod("initHybrid", JHybridThemeCoverSpec::CxxPart::initHybrid),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Properties
|
|
77
|
+
jboolean JHybridThemeCoverSpec::getIsSyncCaptureSupported() {
|
|
78
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jboolean()>("isSyncCaptureSupported");
|
|
79
|
+
auto __result = __method(_javaPart, CxxPart::getClass());
|
|
80
|
+
return __result;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Methods
|
|
84
|
+
jboolean JHybridThemeCoverSpec::captureCoverSync(const jni::local_ref<JCoverRequest>& request) {
|
|
85
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jboolean(jni::alias_ref<JCoverRequest> /* request */)>("captureCoverSync");
|
|
86
|
+
auto __result = __method(_javaPart, CxxPart::getClass(), request);
|
|
87
|
+
return __result;
|
|
88
|
+
}
|
|
89
|
+
jni::local_ref<JTypedPromise<jni::local_ref<jni::JBoolean>>> JHybridThemeCoverSpec::captureCoverAsync(const jni::local_ref<JCoverRequest>& request) {
|
|
90
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jni::local_ref<JTypedPromise<jni::local_ref<jni::JBoolean>>>(jni::alias_ref<JCoverRequest> /* request */)>("captureCoverAsync");
|
|
91
|
+
auto __result = __method(_javaPart, CxxPart::getClass(), request);
|
|
92
|
+
return __result;
|
|
93
|
+
}
|
|
94
|
+
jni::local_ref<JTypedPromise<void>> JHybridThemeCoverSpec::finishCover() {
|
|
95
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jni::local_ref<JTypedPromise<void>>()>("finishCover");
|
|
96
|
+
auto __result = __method(_javaPart, CxxPart::getClass());
|
|
97
|
+
return __result;
|
|
98
|
+
}
|
|
99
|
+
void JHybridThemeCoverSpec::cancelCover() {
|
|
100
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<void()>("cancelCover");
|
|
101
|
+
__method(_javaPart, CxxPart::getClass());
|
|
102
|
+
}
|
|
103
|
+
jboolean JHybridThemeCoverSpec::isCoverActive() {
|
|
104
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jboolean()>("isCoverActive");
|
|
105
|
+
auto __result = __method(_javaPart, CxxPart::getClass());
|
|
106
|
+
return __result;
|
|
107
|
+
}
|
|
108
|
+
jni::local_ref<jni::JString> JHybridThemeCoverSpec::lastCaptureOutcome() {
|
|
109
|
+
static const auto __method = CxxPart::getClass()->getNonvirtualMethod<jni::local_ref<jni::JString>()>("lastCaptureOutcome");
|
|
110
|
+
auto __result = __method(_javaPart, CxxPart::getClass());
|
|
111
|
+
return __result;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
} // namespace margelo::nitro::nitrowind
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JListenerSubscription.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <NitroWindNative/private/JListenerSubscription.hpp>
|
|
9
|
+
#include <NitroWindNative/private/JCallback_void.hpp>
|
|
10
|
+
#include <NitroModules/JNIConverter+Callback.hpp>
|
|
11
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
12
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro {
|
|
15
|
+
|
|
16
|
+
jni::local_ref<margelo::nitro::nitrowind::JListenerSubscription> JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JListenerSubscription>>::fromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
17
|
+
auto object = value.asObject(runtime);
|
|
18
|
+
return margelo::nitro::nitrowind::JListenerSubscription::create(JSIConverter<jni::local_ref<JCallback<margelo::nitro::nitrowind::JCallback_void::JavaPart>>>::fromJSI(runtime, object.getProperty(runtime, PropNameIDCache::get(runtime, "remove"))));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
jsi::Value JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JListenerSubscription>>::toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::nitrowind::JListenerSubscription> value) {
|
|
22
|
+
jsi::Object object(runtime);
|
|
23
|
+
object.setProperty(runtime, PropNameIDCache::get(runtime, "remove"), JSIConverter<jni::local_ref<JCallback<margelo::nitro::nitrowind::JCallback_void::JavaPart>>>::toJSI(runtime, value->getRemove()));
|
|
24
|
+
return object;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
bool JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JListenerSubscription>>::canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
28
|
+
if (!value.isObject()) return false;
|
|
29
|
+
auto object = value.getObject(runtime);
|
|
30
|
+
if (!isPlainObject(runtime, object)) return false;
|
|
31
|
+
return JSIConverter<jni::local_ref<JCallback<margelo::nitro::nitrowind::JCallback_void::JavaPart>>>::canConvert(runtime, object.getProperty(runtime, PropNameIDCache::get(runtime, "remove")));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JThemeTransitionDirection.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <NitroWindNative/private/JThemeTransitionDirection.hpp>
|
|
9
|
+
#include <NitroModules/NitroHash.hpp>
|
|
10
|
+
#include <NitroModules/NumberUtils.hpp>
|
|
11
|
+
#include <NitroModules/JSIString.hpp>
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro {
|
|
14
|
+
|
|
15
|
+
jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionDirection> JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionDirection>>::fromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
16
|
+
return margelo::nitro::nitrowind::JThemeTransitionDirection::fromValue(valueFromJSI(runtime, value));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
jni::alias_ref<margelo::nitro::nitrowind::JThemeTransitionDirection> JSIConverter<jni::alias_ref<margelo::nitro::nitrowind::JThemeTransitionDirection>>::fromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
20
|
+
return margelo::nitro::nitrowind::JThemeTransitionDirection::borrowedFromValue(valueFromJSI(runtime, value));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
int32_t JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionDirection>>::valueFromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
24
|
+
const auto string = value.asString(runtime).utf8(runtime);
|
|
25
|
+
switch (hashString(string)) {
|
|
26
|
+
case hashString("left"): return 0;
|
|
27
|
+
case hashString("right"): return 1;
|
|
28
|
+
default: [[unlikely]]
|
|
29
|
+
throw std::invalid_argument("Cannot convert \"" + string + "\" to enum ThemeTransitionDirection - invalid value!");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
jsi::Value JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionDirection>>::toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::nitrowind::JThemeTransitionDirection> value) {
|
|
34
|
+
switch (value->value()) {
|
|
35
|
+
case 0: return createJSIString<"left">(runtime);
|
|
36
|
+
case 1: return createJSIString<"right">(runtime);
|
|
37
|
+
default: [[unlikely]]
|
|
38
|
+
throw std::invalid_argument("Cannot convert ThemeTransitionDirection to JS - invalid value: " + std::to_string(value->value()) + "!");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
bool JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionDirection>>::canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
43
|
+
if (!value.isString()) return false;
|
|
44
|
+
const auto string = value.getString(runtime).utf8(runtime);
|
|
45
|
+
switch (hashString(string)) {
|
|
46
|
+
case hashString("left"): return true;
|
|
47
|
+
case hashString("right"): return true;
|
|
48
|
+
default: return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JThemeTransitionStyle.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <NitroWindNative/private/JThemeTransitionStyle.hpp>
|
|
9
|
+
#include <NitroModules/NitroHash.hpp>
|
|
10
|
+
#include <NitroModules/NumberUtils.hpp>
|
|
11
|
+
#include <NitroModules/JSIString.hpp>
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro {
|
|
14
|
+
|
|
15
|
+
jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionStyle> JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionStyle>>::fromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
16
|
+
return margelo::nitro::nitrowind::JThemeTransitionStyle::fromValue(valueFromJSI(runtime, value));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
jni::alias_ref<margelo::nitro::nitrowind::JThemeTransitionStyle> JSIConverter<jni::alias_ref<margelo::nitro::nitrowind::JThemeTransitionStyle>>::fromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
20
|
+
return margelo::nitro::nitrowind::JThemeTransitionStyle::borrowedFromValue(valueFromJSI(runtime, value));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
int32_t JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionStyle>>::valueFromJSI(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
24
|
+
const auto string = value.asString(runtime).utf8(runtime);
|
|
25
|
+
switch (hashString(string)) {
|
|
26
|
+
case hashString("fade"): return 0;
|
|
27
|
+
case hashString("circle"): return 1;
|
|
28
|
+
case hashString("slide"): return 2;
|
|
29
|
+
case hashString("blur"): return 3;
|
|
30
|
+
default: [[unlikely]]
|
|
31
|
+
throw std::invalid_argument("Cannot convert \"" + string + "\" to enum ThemeTransitionStyle - invalid value!");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
jsi::Value JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionStyle>>::toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::nitrowind::JThemeTransitionStyle> value) {
|
|
36
|
+
switch (value->value()) {
|
|
37
|
+
case 0: return createJSIString<"fade">(runtime);
|
|
38
|
+
case 1: return createJSIString<"circle">(runtime);
|
|
39
|
+
case 2: return createJSIString<"slide">(runtime);
|
|
40
|
+
case 3: return createJSIString<"blur">(runtime);
|
|
41
|
+
default: [[unlikely]]
|
|
42
|
+
throw std::invalid_argument("Cannot convert ThemeTransitionStyle to JS - invalid value: " + std::to_string(value->value()) + "!");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
bool JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JThemeTransitionStyle>>::canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
47
|
+
if (!value.isString()) return false;
|
|
48
|
+
const auto string = value.getString(runtime).utf8(runtime);
|
|
49
|
+
switch (hashString(string)) {
|
|
50
|
+
case hashString("fade"): return true;
|
|
51
|
+
case hashString("circle"): return true;
|
|
52
|
+
case hashString("slide"): return true;
|
|
53
|
+
case hashString("blur"): return true;
|
|
54
|
+
default: return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCallback_void.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JCallback.hpp>
|
|
11
|
+
#include <NitroModules/JNICallable.hpp>
|
|
12
|
+
#include <NitroModules/JNICallback.hpp>
|
|
13
|
+
#include <NitroModules/JSIConverter+JCallback.hpp>
|
|
14
|
+
#include <NitroModules/JNIConverter+Promise.hpp>
|
|
15
|
+
#include <NitroModules/JSIConverter+JTypedPromise.hpp>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitrowind {
|
|
18
|
+
|
|
19
|
+
namespace jni = facebook::jni;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ part of the Kotlin `Callback_void`, which holds a `Callback<...>` in `JNICallback`.
|
|
23
|
+
*/
|
|
24
|
+
class JCallback_void final : public jni::HybridClass<JCallback_void, JNICallback<void()>> {
|
|
25
|
+
public:
|
|
26
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/Callback_void;";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The Kotlin `Callback_void.Function_cxx`, which calls a Kotlin callback.
|
|
30
|
+
*/
|
|
31
|
+
struct JFunction_cxx : jni::JavaClass<JFunction_cxx> {
|
|
32
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/Callback_void$Function_cxx;";
|
|
33
|
+
static jni::local_ref<JFunction_cxx> create(jni::alias_ref<JCallback<JavaPart>> callback);
|
|
34
|
+
JNIRetainedValue<void>::Type invoke() const;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
static jni::local_ref<JavaPart> create(CallbackType callback);
|
|
39
|
+
/** Wraps a callback implemented in Kotlin in a C++ `Callback<...>`. */
|
|
40
|
+
static CallbackType fromKotlin(jni::alias_ref<JCallback<JavaPart>> callback);
|
|
41
|
+
static void registerNatives();
|
|
42
|
+
|
|
43
|
+
private:
|
|
44
|
+
void callSync_cxx();
|
|
45
|
+
jni::local_ref<JTypedPromise<void>> callAsync_cxx();
|
|
46
|
+
void callAndForget_cxx();
|
|
47
|
+
|
|
48
|
+
private:
|
|
49
|
+
friend HybridBase;
|
|
50
|
+
explicit JCallback_void(CallbackType callback);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::nitrowind
|
package/nitrogen/generated/android/c++/include/NitroWindNative/private/JCallback_void_bool.hpp
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCallback_void_bool.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JCallback.hpp>
|
|
11
|
+
#include <NitroModules/JNICallable.hpp>
|
|
12
|
+
#include <NitroModules/JNICallback.hpp>
|
|
13
|
+
#include <NitroModules/JSIConverter+JCallback.hpp>
|
|
14
|
+
#include <NitroModules/JNIConverter+Promise.hpp>
|
|
15
|
+
#include <NitroModules/JSIConverter+JTypedPromise.hpp>
|
|
16
|
+
#include <NitroModules/JNIConverter+Primitives.hpp>
|
|
17
|
+
#include <NitroModules/JSIConverter+JNIPrimitives.hpp>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::nitrowind {
|
|
20
|
+
|
|
21
|
+
namespace jni = facebook::jni;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The C++ part of the Kotlin `Callback_void_bool`, which holds a `Callback<...>` in `JNICallback`.
|
|
25
|
+
*/
|
|
26
|
+
class JCallback_void_bool final : public jni::HybridClass<JCallback_void_bool, JNICallback<void(jboolean)>> {
|
|
27
|
+
public:
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/Callback_void_bool;";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The Kotlin `Callback_void_bool.Function_cxx`, which calls a Kotlin callback.
|
|
32
|
+
*/
|
|
33
|
+
struct JFunction_cxx : jni::JavaClass<JFunction_cxx> {
|
|
34
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/Callback_void_bool$Function_cxx;";
|
|
35
|
+
static jni::local_ref<JFunction_cxx> create(jni::alias_ref<JCallback<JavaPart>> callback);
|
|
36
|
+
JNIRetainedValue<void>::Type invoke(JNIRetainedValue<jboolean>::Type reducedMotion) const;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
public:
|
|
40
|
+
static jni::local_ref<JavaPart> create(CallbackType callback);
|
|
41
|
+
/** Wraps a callback implemented in Kotlin in a C++ `Callback<...>`. */
|
|
42
|
+
static CallbackType fromKotlin(jni::alias_ref<JCallback<JavaPart>> callback);
|
|
43
|
+
static void registerNatives();
|
|
44
|
+
|
|
45
|
+
private:
|
|
46
|
+
void callSync_cxx(jboolean reducedMotion);
|
|
47
|
+
jni::local_ref<JTypedPromise<void>> callAsync_cxx(jboolean reducedMotion);
|
|
48
|
+
void callAndForget_cxx(jboolean reducedMotion);
|
|
49
|
+
|
|
50
|
+
private:
|
|
51
|
+
friend HybridBase;
|
|
52
|
+
explicit JCallback_void_bool(CallbackType callback);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::nitrowind
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCoverRequest.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#include <NitroWindNative/private/JThemeTransitionStyle.hpp>
|
|
13
|
+
#include <NitroModules/JNIConverter+Primitives.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter+JNIPrimitives.hpp>
|
|
15
|
+
#include <NitroModules/JNIConverter+Optional.hpp>
|
|
16
|
+
#include <NitroModules/JSIConverter+JOptional.hpp>
|
|
17
|
+
#include <NitroWindNative/private/JThemeTransitionDirection.hpp>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::nitrowind {
|
|
20
|
+
|
|
21
|
+
namespace jni = facebook::jni;
|
|
22
|
+
|
|
23
|
+
/** JNI access to the Kotlin data class CoverRequest. */
|
|
24
|
+
struct JCoverRequest final : public jni::JavaClass<JCoverRequest> {
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/CoverRequest;";
|
|
26
|
+
|
|
27
|
+
static jni::local_ref<JCoverRequest> create(jni::alias_ref<JThemeTransitionStyle> style, jdouble durationMs, jni::alias_ref<JOptional<jni::JDouble>> originX, jni::alias_ref<JOptional<jni::JDouble>> originY, jni::alias_ref<JOptional<JThemeTransitionDirection>> direction) {
|
|
28
|
+
static const auto clazz = javaClassStatic();
|
|
29
|
+
static const auto create = clazz->getStaticMethod<JCoverRequest(jni::alias_ref<JThemeTransitionStyle>, jdouble, jni::alias_ref<JOptional<jni::JDouble>>, jni::alias_ref<JOptional<jni::JDouble>>, jni::alias_ref<JOptional<JThemeTransitionDirection>>)>("fromCpp");
|
|
30
|
+
return create(clazz, style, durationMs, originX, originY, direction);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
jni::local_ref<JThemeTransitionStyle> getStyle() const {
|
|
34
|
+
static const auto field = javaClassStatic()->getField<JThemeTransitionStyle>("style");
|
|
35
|
+
return getFieldValue(field);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
jdouble getDurationMs() const {
|
|
39
|
+
static const auto field = javaClassStatic()->getField<jdouble>("durationMs");
|
|
40
|
+
return getFieldValue(field);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
jni::local_ref<JOptional<jni::JDouble>> getOriginX() const {
|
|
44
|
+
static const auto field = javaClassStatic()->getField<JOptional<jni::JDouble>>("originX");
|
|
45
|
+
return getFieldValue(field);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
jni::local_ref<JOptional<jni::JDouble>> getOriginY() const {
|
|
49
|
+
static const auto field = javaClassStatic()->getField<JOptional<jni::JDouble>>("originY");
|
|
50
|
+
return getFieldValue(field);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
jni::local_ref<JOptional<JThemeTransitionDirection>> getDirection() const {
|
|
54
|
+
static const auto field = javaClassStatic()->getField<JOptional<JThemeTransitionDirection>>("direction");
|
|
55
|
+
return getFieldValue(field);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
} // namespace margelo::nitro::nitrowind
|
|
60
|
+
|
|
61
|
+
namespace margelo::nitro {
|
|
62
|
+
|
|
63
|
+
namespace jni = facebook::jni;
|
|
64
|
+
namespace jsi = facebook::jsi;
|
|
65
|
+
|
|
66
|
+
template <>
|
|
67
|
+
struct JSIConverter<jni::local_ref<margelo::nitro::nitrowind::JCoverRequest>> {
|
|
68
|
+
static jni::local_ref<margelo::nitro::nitrowind::JCoverRequest> fromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
69
|
+
static jsi::Value toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::nitrowind::JCoverRequest> value);
|
|
70
|
+
static bool canConvert(jsi::Runtime& runtime, const jsi::Value& value);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace margelo::nitro
|
package/nitrogen/generated/android/c++/include/NitroWindNative/private/JHybridReducedMotionSpec.hpp
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridReducedMotionSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <NitroModules/HybridClass.hpp>
|
|
12
|
+
#include <fbjni/fbjni.h>
|
|
13
|
+
#include <stdexcept>
|
|
14
|
+
#include <NitroWindNative/private/JHybridReducedMotionSpecJavaPart.hpp>
|
|
15
|
+
#include <NitroModules/JNIConverter+Primitives.hpp>
|
|
16
|
+
#include <NitroModules/JSIConverter+JNIPrimitives.hpp>
|
|
17
|
+
#include <NitroWindNative/private/JListenerSubscription.hpp>
|
|
18
|
+
#include <NitroWindNative/private/JCallback_void_bool.hpp>
|
|
19
|
+
#include <NitroModules/JNIConverter+Callback.hpp>
|
|
20
|
+
#include <NitroWindNative/private/JHybridReducedMotionSpec.hpp>
|
|
21
|
+
#include <memory>
|
|
22
|
+
#include <NitroModules/JNIConverter+HybridObject.hpp>
|
|
23
|
+
// Forward declaration of `JHybridReducedMotionSpec` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitrowind { class JHybridReducedMotionSpec; }
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitrowind {
|
|
27
|
+
|
|
28
|
+
namespace jni = facebook::jni;
|
|
29
|
+
|
|
30
|
+
class JHybridReducedMotionSpec final : public JHybridObject {
|
|
31
|
+
public:
|
|
32
|
+
struct Class {
|
|
33
|
+
using Base = JHybridObject::Class;
|
|
34
|
+
static constexpr const char* name = "ReducedMotion";
|
|
35
|
+
static const std::shared_ptr<const HybridClass>& get();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
public:
|
|
39
|
+
using JavaPart = JHybridReducedMotionSpecJavaPart;
|
|
40
|
+
struct CxxPart : public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
41
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/HybridReducedMotionSpec$CxxPart;";
|
|
42
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
43
|
+
static void registerNatives();
|
|
44
|
+
static jni::alias_ref<jni::JClass> getClass();
|
|
45
|
+
using HybridBase::HybridBase;
|
|
46
|
+
protected:
|
|
47
|
+
std::shared_ptr<JHybridObject> createHybridObject(jni::alias_ref<JHybridObject::JavaPart> javaPart) override;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
explicit JHybridReducedMotionSpec(jni::alias_ref<JHybridReducedMotionSpec::JavaPart> javaPart):
|
|
52
|
+
JHybridObject(javaPart),
|
|
53
|
+
_javaPart(jni::static_ref_cast<JavaPart>(JHybridObject::getJavaPart())) {
|
|
54
|
+
#ifdef NITRO_DEBUG
|
|
55
|
+
if (!jni::isSameObject(_javaPart->getClass(), CxxPart::getClass())) [[unlikely]] {
|
|
56
|
+
throw std::runtime_error("ReducedMotion requires its configured implementation when inheritance and multiple implementations are disabled.");
|
|
57
|
+
}
|
|
58
|
+
#endif
|
|
59
|
+
}
|
|
60
|
+
// Defined in the owning library so RTTI has one identity across modules.
|
|
61
|
+
~JHybridReducedMotionSpec() override;
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
inline jni::alias_ref<JHybridReducedMotionSpec::JavaPart> getJavaPart() const noexcept {
|
|
65
|
+
return _javaPart;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
// Properties
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
public:
|
|
73
|
+
// Methods
|
|
74
|
+
jboolean isReducedMotionEnabled();
|
|
75
|
+
jni::local_ref<JListenerSubscription> addOnReducedMotionChangedListener(const jni::local_ref<JCallback<margelo::nitro::nitrowind::JCallback_void_bool::JavaPart>>& listener);
|
|
76
|
+
|
|
77
|
+
public:
|
|
78
|
+
// Constructor and static members
|
|
79
|
+
static std::shared_ptr<JHybridReducedMotionSpec> constructor();
|
|
80
|
+
|
|
81
|
+
protected:
|
|
82
|
+
const std::shared_ptr<const HybridClass>& getHybridClass() override {
|
|
83
|
+
return Class::get();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private:
|
|
87
|
+
jni::alias_ref<JHybridReducedMotionSpec::JavaPart> _javaPart;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
} // namespace margelo::nitro::nitrowind
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridReducedMotionSpecJavaPart.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include <memory>
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro::nitrowind {
|
|
15
|
+
|
|
16
|
+
namespace jni = facebook::jni;
|
|
17
|
+
|
|
18
|
+
class JHybridReducedMotionSpec;
|
|
19
|
+
|
|
20
|
+
struct JHybridReducedMotionSpecJavaPart : public jni::JavaClass<JHybridReducedMotionSpecJavaPart, JHybridObject::JavaPart> {
|
|
21
|
+
using HybridType = JHybridReducedMotionSpec;
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrowind/HybridReducedMotionSpec;";
|
|
23
|
+
std::shared_ptr<JHybridReducedMotionSpec> getJHybridReducedMotionSpec();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
} // namespace margelo::nitro::nitrowind
|