aix 0.6.0 → 0.6.1
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/ios/EditMenuDefaultActions.swift +70 -0
- package/ios/HybridAix.swift +28 -3
- package/ios/HybridAixCellView.swift +0 -1
- package/ios/HybridAixComposer.swift +82 -0
- package/ios/HybridAixDropzone.swift +104 -0
- package/ios/HybridAixInputWrapper.swift +447 -0
- package/ios/InputType.swift +40 -0
- package/ios/PasteFileManager.swift +92 -0
- package/nitro.json +8 -0
- package/nitrogen/generated/android/Aix+autolinking.cmake +8 -0
- package/nitrogen/generated/android/AixOnLoad.cpp +26 -0
- package/nitrogen/generated/android/c++/JAixInputWrapperOnPasteEvent.hpp +70 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_AixInputWrapperOnPasteEvent_.hpp +98 -0
- package/nitrogen/generated/android/c++/JHybridAixComposerSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridAixComposerSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridAixDropzoneSpec.cpp +72 -0
- package/nitrogen/generated/android/c++/JHybridAixDropzoneSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JHybridAixInputWrapperSpec.cpp +144 -0
- package/nitrogen/generated/android/c++/JHybridAixInputWrapperSpec.hpp +74 -0
- package/nitrogen/generated/android/c++/views/JHybridAixComposerStateUpdater.cpp +4 -0
- package/nitrogen/generated/android/c++/views/JHybridAixDropzoneStateUpdater.cpp +56 -0
- package/nitrogen/generated/android/c++/views/JHybridAixDropzoneStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/c++/views/JHybridAixInputWrapperStateUpdater.cpp +72 -0
- package/nitrogen/generated/android/c++/views/JHybridAixInputWrapperStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixInputWrapperOnPasteEvent.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/Func_void_std__vector_AixInputWrapperOnPasteEvent_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixComposerSpec.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixDropzoneSpec.kt +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixInputWrapperSpec.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixDropzoneManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixDropzoneStateUpdater.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixInputWrapperManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixInputWrapperStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.cpp +42 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.hpp +112 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Umbrella.hpp +14 -0
- package/nitrogen/generated/ios/AixAutolinking.mm +16 -0
- package/nitrogen/generated/ios/AixAutolinking.swift +30 -0
- package/nitrogen/generated/ios/c++/HybridAixComposerSpecSwift.hpp +7 -0
- package/nitrogen/generated/ios/c++/HybridAixDropzoneSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixDropzoneSpecSwift.hpp +80 -0
- package/nitrogen/generated/ios/c++/HybridAixInputWrapperSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixInputWrapperSpecSwift.hpp +108 -0
- package/nitrogen/generated/ios/c++/views/HybridAixComposerComponent.mm +5 -0
- package/nitrogen/generated/ios/c++/views/HybridAixDropzoneComponent.mm +96 -0
- package/nitrogen/generated/ios/c++/views/HybridAixInputWrapperComponent.mm +116 -0
- package/nitrogen/generated/ios/swift/AixInputWrapperOnPasteEvent.swift +107 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AixInputWrapperOnPasteEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridAixComposerSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridAixComposerSpec_cxx.swift +24 -0
- package/nitrogen/generated/ios/swift/HybridAixDropzoneSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridAixDropzoneSpec_cxx.swift +167 -0
- package/nitrogen/generated/ios/swift/HybridAixInputWrapperSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridAixInputWrapperSpec_cxx.swift +261 -0
- package/nitrogen/generated/shared/c++/AixInputWrapperOnPasteEvent.hpp +88 -0
- package/nitrogen/generated/shared/c++/HybridAixComposerSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridAixComposerSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/HybridAixDropzoneSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridAixDropzoneSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridAixInputWrapperSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridAixInputWrapperSpec.hpp +76 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.hpp +1 -0
- package/nitrogen/generated/shared/c++/views/HybridAixDropzoneComponent.cpp +87 -0
- package/nitrogen/generated/shared/c++/views/HybridAixDropzoneComponent.hpp +109 -0
- package/nitrogen/generated/shared/c++/views/HybridAixInputWrapperComponent.cpp +135 -0
- package/nitrogen/generated/shared/c++/views/HybridAixInputWrapperComponent.hpp +114 -0
- package/nitrogen/generated/shared/json/AixComposerConfig.json +1 -0
- package/nitrogen/generated/shared/json/AixDropzoneConfig.json +10 -0
- package/nitrogen/generated/shared/json/AixInputWrapperConfig.json +14 -0
- package/package.json +1 -1
- package/src/dropzone.ios.tsx +27 -0
- package/src/dropzone.tsx +10 -0
- package/src/index.ts +3 -0
- package/src/input-wrapper.ios.tsx +30 -0
- package/src/input-wrapper.tsx +17 -0
- package/src/views/aix.nitro.ts +33 -19
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAixInputWrapperOnPasteEvent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "AixInputWrapperOnPasteEvent.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::aix {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "AixInputWrapperOnPasteEvent" and the the Kotlin data class "AixInputWrapperOnPasteEvent".
|
|
22
|
+
*/
|
|
23
|
+
struct JAixInputWrapperOnPasteEvent final: public jni::JavaClass<JAixInputWrapperOnPasteEvent> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/AixInputWrapperOnPasteEvent;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct AixInputWrapperOnPasteEvent by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
AixInputWrapperOnPasteEvent toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldType = clazz->getField<jni::JString>("type");
|
|
36
|
+
jni::local_ref<jni::JString> type = this->getFieldValue(fieldType);
|
|
37
|
+
static const auto fieldFilePath = clazz->getField<jni::JString>("filePath");
|
|
38
|
+
jni::local_ref<jni::JString> filePath = this->getFieldValue(fieldFilePath);
|
|
39
|
+
static const auto fieldFileExtension = clazz->getField<jni::JString>("fileExtension");
|
|
40
|
+
jni::local_ref<jni::JString> fileExtension = this->getFieldValue(fieldFileExtension);
|
|
41
|
+
static const auto fieldFileName = clazz->getField<jni::JString>("fileName");
|
|
42
|
+
jni::local_ref<jni::JString> fileName = this->getFieldValue(fieldFileName);
|
|
43
|
+
return AixInputWrapperOnPasteEvent(
|
|
44
|
+
type->toStdString(),
|
|
45
|
+
filePath->toStdString(),
|
|
46
|
+
fileExtension != nullptr ? std::make_optional(fileExtension->toStdString()) : std::nullopt,
|
|
47
|
+
fileName != nullptr ? std::make_optional(fileName->toStdString()) : std::nullopt
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
/**
|
|
53
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
54
|
+
*/
|
|
55
|
+
[[maybe_unused]]
|
|
56
|
+
static jni::local_ref<JAixInputWrapperOnPasteEvent::javaobject> fromCpp(const AixInputWrapperOnPasteEvent& value) {
|
|
57
|
+
using JSignature = JAixInputWrapperOnPasteEvent(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
58
|
+
static const auto clazz = javaClassStatic();
|
|
59
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
60
|
+
return create(
|
|
61
|
+
clazz,
|
|
62
|
+
jni::make_jstring(value.type),
|
|
63
|
+
jni::make_jstring(value.filePath),
|
|
64
|
+
value.fileExtension.has_value() ? jni::make_jstring(value.fileExtension.value()) : nullptr,
|
|
65
|
+
value.fileName.has_value() ? jni::make_jstring(value.fileName.value()) : nullptr
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::aix
|
package/nitrogen/generated/android/c++/JFunc_void_std__vector_AixInputWrapperOnPasteEvent_.hpp
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__vector_AixInputWrapperOnPasteEvent_.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "AixInputWrapperOnPasteEvent.hpp"
|
|
14
|
+
#include <vector>
|
|
15
|
+
#include <functional>
|
|
16
|
+
#include <NitroModules/JNICallable.hpp>
|
|
17
|
+
#include "JAixInputWrapperOnPasteEvent.hpp"
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <optional>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::aix {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Represents the Java/Kotlin callback `(events: Array<AixInputWrapperOnPasteEvent>) -> Unit`.
|
|
27
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
28
|
+
*/
|
|
29
|
+
struct JFunc_void_std__vector_AixInputWrapperOnPasteEvent_: public jni::JavaClass<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_> {
|
|
30
|
+
public:
|
|
31
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/Func_void_std__vector_AixInputWrapperOnPasteEvent_;";
|
|
32
|
+
|
|
33
|
+
public:
|
|
34
|
+
/**
|
|
35
|
+
* Invokes the function this `JFunc_void_std__vector_AixInputWrapperOnPasteEvent_` instance holds through JNI.
|
|
36
|
+
*/
|
|
37
|
+
void invoke(const std::vector<AixInputWrapperOnPasteEvent>& events) const {
|
|
38
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<JAixInputWrapperOnPasteEvent>> /* events */)>("invoke");
|
|
39
|
+
method(self(), [&]() {
|
|
40
|
+
size_t __size = events.size();
|
|
41
|
+
jni::local_ref<jni::JArrayClass<JAixInputWrapperOnPasteEvent>> __array = jni::JArrayClass<JAixInputWrapperOnPasteEvent>::newArray(__size);
|
|
42
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
43
|
+
const auto& __element = events[__i];
|
|
44
|
+
auto __elementJni = JAixInputWrapperOnPasteEvent::fromCpp(__element);
|
|
45
|
+
__array->setElement(__i, *__elementJni);
|
|
46
|
+
}
|
|
47
|
+
return __array;
|
|
48
|
+
}());
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* An implementation of Func_void_std__vector_AixInputWrapperOnPasteEvent_ that is backed by a C++ implementation (using `std::function<...>`)
|
|
54
|
+
*/
|
|
55
|
+
class JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx final: public jni::HybridClass<JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx, JFunc_void_std__vector_AixInputWrapperOnPasteEvent_> {
|
|
56
|
+
public:
|
|
57
|
+
static jni::local_ref<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_::javaobject> fromCpp(const std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>& func) {
|
|
58
|
+
return JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::newObjectCxxArgs(func);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
/**
|
|
63
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx` instance holds.
|
|
64
|
+
*/
|
|
65
|
+
void invoke_cxx(jni::alias_ref<jni::JArrayClass<JAixInputWrapperOnPasteEvent>> events) {
|
|
66
|
+
_func([&]() {
|
|
67
|
+
size_t __size = events->size();
|
|
68
|
+
std::vector<AixInputWrapperOnPasteEvent> __vector;
|
|
69
|
+
__vector.reserve(__size);
|
|
70
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
71
|
+
auto __element = events->getElement(__i);
|
|
72
|
+
__vector.push_back(__element->toCpp());
|
|
73
|
+
}
|
|
74
|
+
return __vector;
|
|
75
|
+
}());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public:
|
|
79
|
+
[[nodiscard]]
|
|
80
|
+
inline const std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>& getFunction() const {
|
|
81
|
+
return _func;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public:
|
|
85
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/Func_void_std__vector_AixInputWrapperOnPasteEvent__cxx;";
|
|
86
|
+
static void registerNatives() {
|
|
87
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::invoke_cxx)});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private:
|
|
91
|
+
explicit JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx(const std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>& func): _func(func) { }
|
|
92
|
+
|
|
93
|
+
private:
|
|
94
|
+
friend HybridBase;
|
|
95
|
+
std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)> _func;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro::aix
|
|
@@ -56,6 +56,15 @@ namespace margelo::nitro::aix {
|
|
|
56
56
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JAixStickToKeyboard> /* stickToKeyboard */)>("setStickToKeyboard");
|
|
57
57
|
method(_javaPart, stickToKeyboard.has_value() ? JAixStickToKeyboard::fromCpp(stickToKeyboard.value()) : nullptr);
|
|
58
58
|
}
|
|
59
|
+
std::optional<bool> JHybridAixComposerSpec::getFixInput() {
|
|
60
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getFixInput");
|
|
61
|
+
auto __result = method(_javaPart);
|
|
62
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
63
|
+
}
|
|
64
|
+
void JHybridAixComposerSpec::setFixInput(std::optional<bool> fixInput) {
|
|
65
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* fixInput */)>("setFixInput");
|
|
66
|
+
method(_javaPart, fixInput.has_value() ? jni::JBoolean::valueOf(fixInput.value()) : nullptr);
|
|
67
|
+
}
|
|
59
68
|
|
|
60
69
|
// Methods
|
|
61
70
|
|
|
@@ -52,6 +52,8 @@ namespace margelo::nitro::aix {
|
|
|
52
52
|
// Properties
|
|
53
53
|
std::optional<AixStickToKeyboard> getStickToKeyboard() override;
|
|
54
54
|
void setStickToKeyboard(const std::optional<AixStickToKeyboard>& stickToKeyboard) override;
|
|
55
|
+
std::optional<bool> getFixInput() override;
|
|
56
|
+
void setFixInput(std::optional<bool> fixInput) override;
|
|
55
57
|
|
|
56
58
|
public:
|
|
57
59
|
// Methods
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixDropzoneSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridAixDropzoneSpec.hpp"
|
|
9
|
+
|
|
10
|
+
// Forward declaration of `AixInputWrapperOnPasteEvent` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::aix { struct AixInputWrapperOnPasteEvent; }
|
|
12
|
+
|
|
13
|
+
#include "AixInputWrapperOnPasteEvent.hpp"
|
|
14
|
+
#include <vector>
|
|
15
|
+
#include <functional>
|
|
16
|
+
#include <optional>
|
|
17
|
+
#include "JFunc_void_std__vector_AixInputWrapperOnPasteEvent_.hpp"
|
|
18
|
+
#include <NitroModules/JNICallable.hpp>
|
|
19
|
+
#include "JAixInputWrapperOnPasteEvent.hpp"
|
|
20
|
+
#include <string>
|
|
21
|
+
|
|
22
|
+
namespace margelo::nitro::aix {
|
|
23
|
+
|
|
24
|
+
jni::local_ref<JHybridAixDropzoneSpec::jhybriddata> JHybridAixDropzoneSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
25
|
+
return makeCxxInstance(jThis);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
void JHybridAixDropzoneSpec::registerNatives() {
|
|
29
|
+
registerHybrid({
|
|
30
|
+
makeNativeMethod("initHybrid", JHybridAixDropzoneSpec::initHybrid),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
size_t JHybridAixDropzoneSpec::getExternalMemorySize() noexcept {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
36
|
+
return method(_javaPart);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void JHybridAixDropzoneSpec::dispose() noexcept {
|
|
40
|
+
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
41
|
+
method(_javaPart);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
std::string JHybridAixDropzoneSpec::toString() {
|
|
45
|
+
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
46
|
+
auto javaString = method(_javaPart);
|
|
47
|
+
return javaString->toStdString();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Properties
|
|
51
|
+
std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>> JHybridAixDropzoneSpec::getOnDrop() {
|
|
52
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_::javaobject>()>("getOnDrop_cxx");
|
|
53
|
+
auto __result = method(_javaPart);
|
|
54
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)> {
|
|
55
|
+
if (__result->isInstanceOf(JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::javaClassStatic())) [[likely]] {
|
|
56
|
+
auto downcast = jni::static_ref_cast<JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::javaobject>(__result);
|
|
57
|
+
return downcast->cthis()->getFunction();
|
|
58
|
+
} else {
|
|
59
|
+
auto __resultRef = jni::make_global(__result);
|
|
60
|
+
return JNICallable<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_, void(std::vector<AixInputWrapperOnPasteEvent>)>(std::move(__resultRef));
|
|
61
|
+
}
|
|
62
|
+
}()) : std::nullopt;
|
|
63
|
+
}
|
|
64
|
+
void JHybridAixDropzoneSpec::setOnDrop(const std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>>& onDrop) {
|
|
65
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_::javaobject> /* onDrop */)>("setOnDrop_cxx");
|
|
66
|
+
method(_javaPart, onDrop.has_value() ? JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::fromCpp(onDrop.value()) : nullptr);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Methods
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixDropzoneSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridAixDropzoneSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::aix {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridAixDropzoneSpec: public jni::HybridClass<JHybridAixDropzoneSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridAixDropzoneSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/HybridAixDropzoneSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridAixDropzoneSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridAixDropzoneSpec::TAG),
|
|
32
|
+
HybridBase(jThis),
|
|
33
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
~JHybridAixDropzoneSpec() override {
|
|
37
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridAixDropzoneSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>> getOnDrop() override;
|
|
54
|
+
void setOnDrop(const std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>>& onDrop) override;
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
// Methods
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
private:
|
|
61
|
+
friend HybridBase;
|
|
62
|
+
using HybridBase::HybridBase;
|
|
63
|
+
jni::global_ref<JHybridAixDropzoneSpec::javaobject> _javaPart;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixInputWrapperSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridAixInputWrapperSpec.hpp"
|
|
9
|
+
|
|
10
|
+
// Forward declaration of `AixInputWrapperOnPasteEvent` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::aix { struct AixInputWrapperOnPasteEvent; }
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
#include <vector>
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include "AixInputWrapperOnPasteEvent.hpp"
|
|
17
|
+
#include <functional>
|
|
18
|
+
#include "JFunc_void_std__vector_AixInputWrapperOnPasteEvent_.hpp"
|
|
19
|
+
#include <NitroModules/JNICallable.hpp>
|
|
20
|
+
#include "JAixInputWrapperOnPasteEvent.hpp"
|
|
21
|
+
|
|
22
|
+
namespace margelo::nitro::aix {
|
|
23
|
+
|
|
24
|
+
jni::local_ref<JHybridAixInputWrapperSpec::jhybriddata> JHybridAixInputWrapperSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
25
|
+
return makeCxxInstance(jThis);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
void JHybridAixInputWrapperSpec::registerNatives() {
|
|
29
|
+
registerHybrid({
|
|
30
|
+
makeNativeMethod("initHybrid", JHybridAixInputWrapperSpec::initHybrid),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
size_t JHybridAixInputWrapperSpec::getExternalMemorySize() noexcept {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
36
|
+
return method(_javaPart);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void JHybridAixInputWrapperSpec::dispose() noexcept {
|
|
40
|
+
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
41
|
+
method(_javaPart);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
std::string JHybridAixInputWrapperSpec::toString() {
|
|
45
|
+
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
46
|
+
auto javaString = method(_javaPart);
|
|
47
|
+
return javaString->toStdString();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Properties
|
|
51
|
+
std::optional<std::vector<std::string>> JHybridAixInputWrapperSpec::getPasteConfiguration() {
|
|
52
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<jni::JString>>()>("getPasteConfiguration");
|
|
53
|
+
auto __result = method(_javaPart);
|
|
54
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
55
|
+
size_t __size = __result->size();
|
|
56
|
+
std::vector<std::string> __vector;
|
|
57
|
+
__vector.reserve(__size);
|
|
58
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
59
|
+
auto __element = __result->getElement(__i);
|
|
60
|
+
__vector.push_back(__element->toStdString());
|
|
61
|
+
}
|
|
62
|
+
return __vector;
|
|
63
|
+
}()) : std::nullopt;
|
|
64
|
+
}
|
|
65
|
+
void JHybridAixInputWrapperSpec::setPasteConfiguration(const std::optional<std::vector<std::string>>& pasteConfiguration) {
|
|
66
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<jni::JString>> /* pasteConfiguration */)>("setPasteConfiguration");
|
|
67
|
+
method(_javaPart, pasteConfiguration.has_value() ? [&]() {
|
|
68
|
+
size_t __size = pasteConfiguration.value().size();
|
|
69
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
70
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
71
|
+
const auto& __element = pasteConfiguration.value()[__i];
|
|
72
|
+
auto __elementJni = jni::make_jstring(__element);
|
|
73
|
+
__array->setElement(__i, *__elementJni);
|
|
74
|
+
}
|
|
75
|
+
return __array;
|
|
76
|
+
}() : nullptr);
|
|
77
|
+
}
|
|
78
|
+
std::optional<std::vector<std::string>> JHybridAixInputWrapperSpec::getEditMenuDefaultActions() {
|
|
79
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<jni::JString>>()>("getEditMenuDefaultActions");
|
|
80
|
+
auto __result = method(_javaPart);
|
|
81
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
82
|
+
size_t __size = __result->size();
|
|
83
|
+
std::vector<std::string> __vector;
|
|
84
|
+
__vector.reserve(__size);
|
|
85
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
86
|
+
auto __element = __result->getElement(__i);
|
|
87
|
+
__vector.push_back(__element->toStdString());
|
|
88
|
+
}
|
|
89
|
+
return __vector;
|
|
90
|
+
}()) : std::nullopt;
|
|
91
|
+
}
|
|
92
|
+
void JHybridAixInputWrapperSpec::setEditMenuDefaultActions(const std::optional<std::vector<std::string>>& editMenuDefaultActions) {
|
|
93
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<jni::JString>> /* editMenuDefaultActions */)>("setEditMenuDefaultActions");
|
|
94
|
+
method(_javaPart, editMenuDefaultActions.has_value() ? [&]() {
|
|
95
|
+
size_t __size = editMenuDefaultActions.value().size();
|
|
96
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
97
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
98
|
+
const auto& __element = editMenuDefaultActions.value()[__i];
|
|
99
|
+
auto __elementJni = jni::make_jstring(__element);
|
|
100
|
+
__array->setElement(__i, *__elementJni);
|
|
101
|
+
}
|
|
102
|
+
return __array;
|
|
103
|
+
}() : nullptr);
|
|
104
|
+
}
|
|
105
|
+
std::optional<double> JHybridAixInputWrapperSpec::getMaxLines() {
|
|
106
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxLines");
|
|
107
|
+
auto __result = method(_javaPart);
|
|
108
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
109
|
+
}
|
|
110
|
+
void JHybridAixInputWrapperSpec::setMaxLines(std::optional<double> maxLines) {
|
|
111
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxLines */)>("setMaxLines");
|
|
112
|
+
method(_javaPart, maxLines.has_value() ? jni::JDouble::valueOf(maxLines.value()) : nullptr);
|
|
113
|
+
}
|
|
114
|
+
std::optional<double> JHybridAixInputWrapperSpec::getMaxChars() {
|
|
115
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxChars");
|
|
116
|
+
auto __result = method(_javaPart);
|
|
117
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
118
|
+
}
|
|
119
|
+
void JHybridAixInputWrapperSpec::setMaxChars(std::optional<double> maxChars) {
|
|
120
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxChars */)>("setMaxChars");
|
|
121
|
+
method(_javaPart, maxChars.has_value() ? jni::JDouble::valueOf(maxChars.value()) : nullptr);
|
|
122
|
+
}
|
|
123
|
+
std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>> JHybridAixInputWrapperSpec::getOnPaste() {
|
|
124
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_::javaobject>()>("getOnPaste_cxx");
|
|
125
|
+
auto __result = method(_javaPart);
|
|
126
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)> {
|
|
127
|
+
if (__result->isInstanceOf(JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::javaClassStatic())) [[likely]] {
|
|
128
|
+
auto downcast = jni::static_ref_cast<JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::javaobject>(__result);
|
|
129
|
+
return downcast->cthis()->getFunction();
|
|
130
|
+
} else {
|
|
131
|
+
auto __resultRef = jni::make_global(__result);
|
|
132
|
+
return JNICallable<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_, void(std::vector<AixInputWrapperOnPasteEvent>)>(std::move(__resultRef));
|
|
133
|
+
}
|
|
134
|
+
}()) : std::nullopt;
|
|
135
|
+
}
|
|
136
|
+
void JHybridAixInputWrapperSpec::setOnPaste(const std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>>& onPaste) {
|
|
137
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__vector_AixInputWrapperOnPasteEvent_::javaobject> /* onPaste */)>("setOnPaste_cxx");
|
|
138
|
+
method(_javaPart, onPaste.has_value() ? JFunc_void_std__vector_AixInputWrapperOnPasteEvent__cxx::fromCpp(onPaste.value()) : nullptr);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Methods
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixInputWrapperSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridAixInputWrapperSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::aix {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridAixInputWrapperSpec: public jni::HybridClass<JHybridAixInputWrapperSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridAixInputWrapperSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/HybridAixInputWrapperSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridAixInputWrapperSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridAixInputWrapperSpec::TAG),
|
|
32
|
+
HybridBase(jThis),
|
|
33
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
~JHybridAixInputWrapperSpec() override {
|
|
37
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridAixInputWrapperSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
std::optional<std::vector<std::string>> getPasteConfiguration() override;
|
|
54
|
+
void setPasteConfiguration(const std::optional<std::vector<std::string>>& pasteConfiguration) override;
|
|
55
|
+
std::optional<std::vector<std::string>> getEditMenuDefaultActions() override;
|
|
56
|
+
void setEditMenuDefaultActions(const std::optional<std::vector<std::string>>& editMenuDefaultActions) override;
|
|
57
|
+
std::optional<double> getMaxLines() override;
|
|
58
|
+
void setMaxLines(std::optional<double> maxLines) override;
|
|
59
|
+
std::optional<double> getMaxChars() override;
|
|
60
|
+
void setMaxChars(std::optional<double> maxChars) override;
|
|
61
|
+
std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>> getOnPaste() override;
|
|
62
|
+
void setOnPaste(const std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>>& onPaste) override;
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
// Methods
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
friend HybridBase;
|
|
70
|
+
using HybridBase::HybridBase;
|
|
71
|
+
jni::global_ref<JHybridAixInputWrapperSpec::javaobject> _javaPart;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::aix
|
|
@@ -40,6 +40,10 @@ void JHybridAixComposerStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
|
|
|
40
40
|
view->setStickToKeyboard(props.stickToKeyboard.value);
|
|
41
41
|
// TODO: Set isDirty = false
|
|
42
42
|
}
|
|
43
|
+
if (props.fixInput.isDirty) {
|
|
44
|
+
view->setFixInput(props.fixInput.value);
|
|
45
|
+
// TODO: Set isDirty = false
|
|
46
|
+
}
|
|
43
47
|
|
|
44
48
|
// Update hybridRef if it changed
|
|
45
49
|
if (props.hybridRef.isDirty) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixDropzoneStateUpdater.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridAixDropzoneStateUpdater.hpp"
|
|
9
|
+
#include "views/HybridAixDropzoneComponent.hpp"
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::aix::views {
|
|
13
|
+
|
|
14
|
+
using namespace facebook;
|
|
15
|
+
using ConcreteStateData = react::ConcreteState<HybridAixDropzoneState>;
|
|
16
|
+
|
|
17
|
+
void JHybridAixDropzoneStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
18
|
+
jni::alias_ref<JHybridAixDropzoneSpec::javaobject> javaView,
|
|
19
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
|
|
20
|
+
JHybridAixDropzoneSpec* view = javaView->cthis();
|
|
21
|
+
|
|
22
|
+
// Get concrete StateWrapperImpl from passed StateWrapper interface object
|
|
23
|
+
jobject rawStateWrapper = stateWrapperInterface.get();
|
|
24
|
+
if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
|
|
25
|
+
throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
|
|
26
|
+
}
|
|
27
|
+
auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
|
|
28
|
+
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
29
|
+
|
|
30
|
+
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
31
|
+
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
|
|
32
|
+
const HybridAixDropzoneState& data = concreteState->getData();
|
|
33
|
+
const std::optional<HybridAixDropzoneProps>& maybeProps = data.getProps();
|
|
34
|
+
if (!maybeProps.has_value()) {
|
|
35
|
+
// Props aren't set yet!
|
|
36
|
+
throw std::runtime_error("HybridAixDropzoneState's data doesn't contain any props!");
|
|
37
|
+
}
|
|
38
|
+
const HybridAixDropzoneProps& props = maybeProps.value();
|
|
39
|
+
if (props.onDrop.isDirty) {
|
|
40
|
+
view->setOnDrop(props.onDrop.value);
|
|
41
|
+
// TODO: Set isDirty = false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Update hybridRef if it changed
|
|
45
|
+
if (props.hybridRef.isDirty) {
|
|
46
|
+
// hybridRef changed - call it with new this
|
|
47
|
+
const auto& maybeFunc = props.hybridRef.value;
|
|
48
|
+
if (maybeFunc.has_value()) {
|
|
49
|
+
std::shared_ptr<JHybridAixDropzoneSpec> shared = javaView->cthis()->shared_cast<JHybridAixDropzoneSpec>();
|
|
50
|
+
maybeFunc.value()(shared);
|
|
51
|
+
}
|
|
52
|
+
// TODO: Set isDirty = false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
} // namespace margelo::nitro::aix::views
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixDropzoneStateUpdater.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#ifndef RN_SERIALIZABLE_STATE
|
|
11
|
+
#error Aix was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#include <fbjni/fbjni.h>
|
|
15
|
+
#include <react/fabric/StateWrapperImpl.h>
|
|
16
|
+
#include <react/fabric/CoreComponentsRegistry.h>
|
|
17
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
18
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
19
|
+
#include <NitroModules/JStateWrapper.hpp>
|
|
20
|
+
#include "JHybridAixDropzoneSpec.hpp"
|
|
21
|
+
#include "views/HybridAixDropzoneComponent.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::aix::views {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
class JHybridAixDropzoneStateUpdater: public jni::JavaClass<JHybridAixDropzoneStateUpdater> {
|
|
28
|
+
public:
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/aix/views/HybridAixDropzoneStateUpdater;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
33
|
+
jni::alias_ref<JHybridAixDropzoneSpec::javaobject> view,
|
|
34
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
static void registerNatives() {
|
|
38
|
+
// Register JNI calls
|
|
39
|
+
javaClassStatic()->registerNatives({
|
|
40
|
+
makeNativeMethod("updateViewProps", JHybridAixDropzoneStateUpdater::updateViewProps),
|
|
41
|
+
});
|
|
42
|
+
// Register React Native view component descriptor
|
|
43
|
+
auto provider = react::concreteComponentDescriptorProvider<HybridAixDropzoneComponentDescriptor>();
|
|
44
|
+
auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
|
|
45
|
+
providerRegistry->add(provider);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::aix::views
|