-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRNRive-Swift-Cxx-Bridge.cpp
More file actions
301 lines (276 loc) · 17.5 KB
/
RNRive-Swift-Cxx-Bridge.cpp
File metadata and controls
301 lines (276 loc) · 17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
///
/// RNRive-Swift-Cxx-Bridge.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///
#include "RNRive-Swift-Cxx-Bridge.hpp"
// Include C++ implementation defined types
#include "HybridRiveFileFactorySpecSwift.hpp"
#include "HybridRiveFileSpecSwift.hpp"
#include "HybridRiveSpecSwift.hpp"
#include "HybridRiveViewSpecSwift.hpp"
#include "HybridViewModelBooleanPropertySpecSwift.hpp"
#include "HybridViewModelColorPropertySpecSwift.hpp"
#include "HybridViewModelEnumPropertySpecSwift.hpp"
#include "HybridViewModelInstanceSpecSwift.hpp"
#include "HybridViewModelNumberPropertySpecSwift.hpp"
#include "HybridViewModelPropertySpecSwift.hpp"
#include "HybridViewModelSpecSwift.hpp"
#include "HybridViewModelStringPropertySpecSwift.hpp"
#include "HybridViewModelTriggerPropertySpecSwift.hpp"
#include "RNRive-Swift-Cxx-Umbrella.hpp"
#include <NitroModules/NitroDefines.hpp>
namespace margelo::nitro::rive::bridge::swift {
// pragma MARK: std::shared_ptr<HybridRiveSpec>
std::shared_ptr<HybridRiveSpec> create_std__shared_ptr_HybridRiveSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridRiveSpec_cxx swiftPart = RNRive::HybridRiveSpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridRiveSpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridRiveSpec_(std__shared_ptr_HybridRiveSpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridRiveSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridRiveSpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridRiveSpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridRiveSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelSpec>
std::shared_ptr<HybridViewModelSpec> create_std__shared_ptr_HybridViewModelSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelSpec_cxx swiftPart = RNRive::HybridViewModelSpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelSpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelSpec_(std__shared_ptr_HybridViewModelSpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelSpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelSpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridRiveFileSpec>
std::shared_ptr<HybridRiveFileSpec> create_std__shared_ptr_HybridRiveFileSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridRiveFileSpec_cxx swiftPart = RNRive::HybridRiveFileSpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridRiveFileSpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridRiveFileSpec_(std__shared_ptr_HybridRiveFileSpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridRiveFileSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridRiveFileSpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridRiveFileSpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridRiveFileSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::function<void(const std::shared_ptr<HybridRiveFileSpec>& /* result */)>
Func_void_std__shared_ptr_HybridRiveFileSpec_ create_Func_void_std__shared_ptr_HybridRiveFileSpec_(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_std__shared_ptr_HybridRiveFileSpec_::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr<HybridRiveFileSpec>& result) mutable -> void {
swiftClosure.call(result);
};
}
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
swiftClosure.call(error);
};
}
// pragma MARK: std::shared_ptr<HybridRiveFileFactorySpec>
std::shared_ptr<HybridRiveFileFactorySpec> create_std__shared_ptr_HybridRiveFileFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridRiveFileFactorySpec_cxx swiftPart = RNRive::HybridRiveFileFactorySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridRiveFileFactorySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridRiveFileFactorySpec_(std__shared_ptr_HybridRiveFileFactorySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridRiveFileFactorySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridRiveFileFactorySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridRiveFileFactorySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridRiveFileFactorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelInstanceSpec>
std::shared_ptr<HybridViewModelInstanceSpec> create_std__shared_ptr_HybridViewModelInstanceSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelInstanceSpec_cxx swiftPart = RNRive::HybridViewModelInstanceSpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelInstanceSpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelInstanceSpec_(std__shared_ptr_HybridViewModelInstanceSpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelInstanceSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelInstanceSpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelInstanceSpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelInstanceSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::function<void(const RiveError& /* error */)>
Func_void_RiveError create_Func_void_RiveError(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_RiveError::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](const RiveError& error) mutable -> void {
swiftClosure.call(error);
};
}
// pragma MARK: std::function<void(bool /* result */)>
Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_bool::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
swiftClosure.call(result);
};
}
// pragma MARK: std::function<void()>
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
swiftClosure.call();
};
}
// pragma MARK: std::function<void(const UnifiedRiveEvent& /* event */)>
Func_void_UnifiedRiveEvent create_Func_void_UnifiedRiveEvent(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_UnifiedRiveEvent::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](const UnifiedRiveEvent& event) mutable -> void {
swiftClosure.call(event);
};
}
// pragma MARK: std::shared_ptr<HybridRiveViewSpec>
std::shared_ptr<HybridRiveViewSpec> create_std__shared_ptr_HybridRiveViewSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridRiveViewSpec_cxx swiftPart = RNRive::HybridRiveViewSpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridRiveViewSpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridRiveViewSpec_(std__shared_ptr_HybridRiveViewSpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridRiveViewSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridRiveViewSpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridRiveViewSpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridRiveViewSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelPropertySpec>
std::shared_ptr<HybridViewModelPropertySpec> create_std__shared_ptr_HybridViewModelPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelPropertySpec_cxx swiftPart = RNRive::HybridViewModelPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelPropertySpec_(std__shared_ptr_HybridViewModelPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelNumberPropertySpec>
std::shared_ptr<HybridViewModelNumberPropertySpec> create_std__shared_ptr_HybridViewModelNumberPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelNumberPropertySpec_cxx swiftPart = RNRive::HybridViewModelNumberPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelNumberPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelNumberPropertySpec_(std__shared_ptr_HybridViewModelNumberPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelNumberPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelNumberPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelNumberPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelNumberPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelStringPropertySpec>
std::shared_ptr<HybridViewModelStringPropertySpec> create_std__shared_ptr_HybridViewModelStringPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelStringPropertySpec_cxx swiftPart = RNRive::HybridViewModelStringPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelStringPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelStringPropertySpec_(std__shared_ptr_HybridViewModelStringPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelStringPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelStringPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelStringPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelStringPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelBooleanPropertySpec>
std::shared_ptr<HybridViewModelBooleanPropertySpec> create_std__shared_ptr_HybridViewModelBooleanPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelBooleanPropertySpec_cxx swiftPart = RNRive::HybridViewModelBooleanPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelBooleanPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelBooleanPropertySpec_(std__shared_ptr_HybridViewModelBooleanPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelBooleanPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelBooleanPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelBooleanPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelBooleanPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelColorPropertySpec>
std::shared_ptr<HybridViewModelColorPropertySpec> create_std__shared_ptr_HybridViewModelColorPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelColorPropertySpec_cxx swiftPart = RNRive::HybridViewModelColorPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelColorPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelColorPropertySpec_(std__shared_ptr_HybridViewModelColorPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelColorPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelColorPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelColorPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelColorPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelEnumPropertySpec>
std::shared_ptr<HybridViewModelEnumPropertySpec> create_std__shared_ptr_HybridViewModelEnumPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelEnumPropertySpec_cxx swiftPart = RNRive::HybridViewModelEnumPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelEnumPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelEnumPropertySpec_(std__shared_ptr_HybridViewModelEnumPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelEnumPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelEnumPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelEnumPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelEnumPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::shared_ptr<HybridViewModelTriggerPropertySpec>
std::shared_ptr<HybridViewModelTriggerPropertySpec> create_std__shared_ptr_HybridViewModelTriggerPropertySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
RNRive::HybridViewModelTriggerPropertySpec_cxx swiftPart = RNRive::HybridViewModelTriggerPropertySpec_cxx::fromUnsafe(swiftUnsafePointer);
return std::make_shared<margelo::nitro::rive::HybridViewModelTriggerPropertySpecSwift>(swiftPart);
}
void* NON_NULL get_std__shared_ptr_HybridViewModelTriggerPropertySpec_(std__shared_ptr_HybridViewModelTriggerPropertySpec_ cppType) {
std::shared_ptr<margelo::nitro::rive::HybridViewModelTriggerPropertySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rive::HybridViewModelTriggerPropertySpecSwift>(cppType);
#ifdef NITRO_DEBUG
if (swiftWrapper == nullptr) [[unlikely]] {
throw std::runtime_error("Class \"HybridViewModelTriggerPropertySpec\" is not implemented in Swift!");
}
#endif
RNRive::HybridViewModelTriggerPropertySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
return swiftPart.toUnsafe();
}
// pragma MARK: std::function<void(double /* value */)>
Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_double::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](double value) mutable -> void {
swiftClosure.call(value);
};
}
// pragma MARK: std::function<void(const std::string& /* value */)>
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
auto swiftClosure = RNRive::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
return [swiftClosure = std::move(swiftClosure)](const std::string& value) mutable -> void {
swiftClosure.call(value);
};
}
} // namespace margelo::nitro::rive::bridge::swift