react-native-nitro-input 0.3.0 → 0.3.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/CHANGELOG.md +49 -0
- package/README.md +90 -2
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +42 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
- package/cpp/RollingEngine.cpp +92 -8
- package/cpp/RollingEngine.hpp +36 -2
- package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
- package/ios/HybridNitroNumberView.swift +82 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroNumberView.swift +368 -135
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroNumber.js +52 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/formatProps.js +76 -16
- package/lib/commonjs/src/index.js +6 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroNumber.js +53 -4
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/formatProps.js +76 -17
- package/lib/module/src/index.js +2 -0
- package/lib/module/src/specs/NitroText.nitro.js +1 -0
- package/lib/typescript/src/NitroNumber.d.ts +79 -1
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/formatProps.d.ts +30 -4
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +132 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +1 -1
- package/src/NitroNumber.tsx +183 -9
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/formatProps.ts +108 -18
- package/src/index.ts +5 -0
- package/src/specs/NitroNumber.nitro.ts +69 -0
- package/src/specs/NitroText.nitro.ts +65 -0
|
@@ -47,4 +47,28 @@ public final class NitroInputAutolinking {
|
|
|
47
47
|
public static func isNitroNumberFormatPlatformRecyclable() -> Bool {
|
|
48
48
|
return HybridNitroNumberFormatPlatform.self is any RecyclableView.Type
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
public static func createNitroTextView() -> bridge.std__shared_ptr_HybridNitroTextViewSpec_ {
|
|
52
|
+
let hybridObject = HybridNitroTextView()
|
|
53
|
+
return { () -> bridge.std__shared_ptr_HybridNitroTextViewSpec_ in
|
|
54
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
55
|
+
return __cxxWrapped.getCxxPart()
|
|
56
|
+
}()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public static func isNitroTextViewRecyclable() -> Bool {
|
|
60
|
+
return HybridNitroTextView.self is any RecyclableView.Type
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static func createNitroTextMeasure() -> bridge.std__shared_ptr_HybridNitroTextMeasureSpec_ {
|
|
64
|
+
let hybridObject = HybridNitroTextMeasure()
|
|
65
|
+
return { () -> bridge.std__shared_ptr_HybridNitroTextMeasureSpec_ in
|
|
66
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
67
|
+
return __cxxWrapped.getCxxPart()
|
|
68
|
+
}()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public static func isNitroTextMeasureRecyclable() -> Bool {
|
|
72
|
+
return HybridNitroTextMeasure.self is any RecyclableView.Type
|
|
73
|
+
}
|
|
50
74
|
}
|
|
@@ -20,8 +20,12 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
|
|
|
20
20
|
namespace margelo::nitro::nitroinput { enum class NitroNumberDirection; }
|
|
21
21
|
// Forward declaration of `NitroNumberRevealStyle` to properly resolve imports.
|
|
22
22
|
namespace margelo::nitro::nitroinput { enum class NitroNumberRevealStyle; }
|
|
23
|
+
// Forward declaration of `NitroNumberShimmerDirection` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberShimmerDirection; }
|
|
23
25
|
// Forward declaration of `NitroNumberAffixAlign` to properly resolve imports.
|
|
24
26
|
namespace margelo::nitro::nitroinput { enum class NitroNumberAffixAlign; }
|
|
27
|
+
// Forward declaration of `NitroNumberSignDisplay` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberSignDisplay; }
|
|
25
29
|
// Forward declaration of `NitroNumberTextAlign` to properly resolve imports.
|
|
26
30
|
namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
27
31
|
|
|
@@ -32,7 +36,9 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
|
32
36
|
#include "NitroNumberDirection.hpp"
|
|
33
37
|
#include "NitroNumberRevealStyle.hpp"
|
|
34
38
|
#include <vector>
|
|
39
|
+
#include "NitroNumberShimmerDirection.hpp"
|
|
35
40
|
#include "NitroNumberAffixAlign.hpp"
|
|
41
|
+
#include "NitroNumberSignDisplay.hpp"
|
|
36
42
|
#include "NitroNumberTextAlign.hpp"
|
|
37
43
|
#include <functional>
|
|
38
44
|
|
|
@@ -277,6 +283,41 @@ namespace margelo::nitro::nitroinput {
|
|
|
277
283
|
inline void setShimmerDuration(std::optional<double> shimmerDuration) noexcept override {
|
|
278
284
|
_swiftPart.setShimmerDuration(shimmerDuration);
|
|
279
285
|
}
|
|
286
|
+
inline std::optional<double> getShimmerAngle() noexcept override {
|
|
287
|
+
auto __result = _swiftPart.getShimmerAngle();
|
|
288
|
+
return __result;
|
|
289
|
+
}
|
|
290
|
+
inline void setShimmerAngle(std::optional<double> shimmerAngle) noexcept override {
|
|
291
|
+
_swiftPart.setShimmerAngle(shimmerAngle);
|
|
292
|
+
}
|
|
293
|
+
inline std::optional<double> getShimmerWidth() noexcept override {
|
|
294
|
+
auto __result = _swiftPart.getShimmerWidth();
|
|
295
|
+
return __result;
|
|
296
|
+
}
|
|
297
|
+
inline void setShimmerWidth(std::optional<double> shimmerWidth) noexcept override {
|
|
298
|
+
_swiftPart.setShimmerWidth(shimmerWidth);
|
|
299
|
+
}
|
|
300
|
+
inline std::optional<double> getShimmerBaseColor() noexcept override {
|
|
301
|
+
auto __result = _swiftPart.getShimmerBaseColor();
|
|
302
|
+
return __result;
|
|
303
|
+
}
|
|
304
|
+
inline void setShimmerBaseColor(std::optional<double> shimmerBaseColor) noexcept override {
|
|
305
|
+
_swiftPart.setShimmerBaseColor(shimmerBaseColor);
|
|
306
|
+
}
|
|
307
|
+
inline std::optional<NitroNumberShimmerDirection> getShimmerDirection() noexcept override {
|
|
308
|
+
auto __result = _swiftPart.getShimmerDirection();
|
|
309
|
+
return __result;
|
|
310
|
+
}
|
|
311
|
+
inline void setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) noexcept override {
|
|
312
|
+
_swiftPart.setShimmerDirection(shimmerDirection);
|
|
313
|
+
}
|
|
314
|
+
inline std::optional<double> getShimmerDelay() noexcept override {
|
|
315
|
+
auto __result = _swiftPart.getShimmerDelay();
|
|
316
|
+
return __result;
|
|
317
|
+
}
|
|
318
|
+
inline void setShimmerDelay(std::optional<double> shimmerDelay) noexcept override {
|
|
319
|
+
_swiftPart.setShimmerDelay(shimmerDelay);
|
|
320
|
+
}
|
|
280
321
|
inline std::optional<double> getFontSize() noexcept override {
|
|
281
322
|
auto __result = _swiftPart.getFontSize();
|
|
282
323
|
return __result;
|
|
@@ -361,6 +402,97 @@ namespace margelo::nitro::nitroinput {
|
|
|
361
402
|
inline void setTabularNums(std::optional<bool> tabularNums) noexcept override {
|
|
362
403
|
_swiftPart.setTabularNums(tabularNums);
|
|
363
404
|
}
|
|
405
|
+
inline std::optional<NitroNumberSignDisplay> getSignDisplay() noexcept override {
|
|
406
|
+
auto __result = _swiftPart.getSignDisplay();
|
|
407
|
+
return __result;
|
|
408
|
+
}
|
|
409
|
+
inline void setSignDisplay(std::optional<NitroNumberSignDisplay> signDisplay) noexcept override {
|
|
410
|
+
_swiftPart.setSignDisplay(signDisplay);
|
|
411
|
+
}
|
|
412
|
+
inline std::optional<std::string> getPlusSign() noexcept override {
|
|
413
|
+
auto __result = _swiftPart.getPlusSign();
|
|
414
|
+
return __result;
|
|
415
|
+
}
|
|
416
|
+
inline void setPlusSign(const std::optional<std::string>& plusSign) noexcept override {
|
|
417
|
+
_swiftPart.setPlusSign(plusSign);
|
|
418
|
+
}
|
|
419
|
+
inline std::optional<std::string> getMinusSign() noexcept override {
|
|
420
|
+
auto __result = _swiftPart.getMinusSign();
|
|
421
|
+
return __result;
|
|
422
|
+
}
|
|
423
|
+
inline void setMinusSign(const std::optional<std::string>& minusSign) noexcept override {
|
|
424
|
+
_swiftPart.setMinusSign(minusSign);
|
|
425
|
+
}
|
|
426
|
+
inline std::optional<std::vector<std::string>> getDigitGlyphs() noexcept override {
|
|
427
|
+
auto __result = _swiftPart.getDigitGlyphs();
|
|
428
|
+
return __result;
|
|
429
|
+
}
|
|
430
|
+
inline void setDigitGlyphs(const std::optional<std::vector<std::string>>& digitGlyphs) noexcept override {
|
|
431
|
+
_swiftPart.setDigitGlyphs(digitGlyphs);
|
|
432
|
+
}
|
|
433
|
+
inline std::optional<std::vector<double>> getGroupingSizes() noexcept override {
|
|
434
|
+
auto __result = _swiftPart.getGroupingSizes();
|
|
435
|
+
return __result;
|
|
436
|
+
}
|
|
437
|
+
inline void setGroupingSizes(const std::optional<std::vector<double>>& groupingSizes) noexcept override {
|
|
438
|
+
_swiftPart.setGroupingSizes(groupingSizes);
|
|
439
|
+
}
|
|
440
|
+
inline std::optional<std::vector<double>> getDigitMax() noexcept override {
|
|
441
|
+
auto __result = _swiftPart.getDigitMax();
|
|
442
|
+
return __result;
|
|
443
|
+
}
|
|
444
|
+
inline void setDigitMax(const std::optional<std::vector<double>>& digitMax) noexcept override {
|
|
445
|
+
_swiftPart.setDigitMax(digitMax);
|
|
446
|
+
}
|
|
447
|
+
inline std::optional<bool> getContinuous() noexcept override {
|
|
448
|
+
auto __result = _swiftPart.getContinuous();
|
|
449
|
+
return __result;
|
|
450
|
+
}
|
|
451
|
+
inline void setContinuous(std::optional<bool> continuous) noexcept override {
|
|
452
|
+
_swiftPart.setContinuous(continuous);
|
|
453
|
+
}
|
|
454
|
+
inline std::optional<double> getPrefixColor() noexcept override {
|
|
455
|
+
auto __result = _swiftPart.getPrefixColor();
|
|
456
|
+
return __result;
|
|
457
|
+
}
|
|
458
|
+
inline void setPrefixColor(std::optional<double> prefixColor) noexcept override {
|
|
459
|
+
_swiftPart.setPrefixColor(prefixColor);
|
|
460
|
+
}
|
|
461
|
+
inline std::optional<double> getSuffixColor() noexcept override {
|
|
462
|
+
auto __result = _swiftPart.getSuffixColor();
|
|
463
|
+
return __result;
|
|
464
|
+
}
|
|
465
|
+
inline void setSuffixColor(std::optional<double> suffixColor) noexcept override {
|
|
466
|
+
_swiftPart.setSuffixColor(suffixColor);
|
|
467
|
+
}
|
|
468
|
+
inline std::optional<double> getFractionColor() noexcept override {
|
|
469
|
+
auto __result = _swiftPart.getFractionColor();
|
|
470
|
+
return __result;
|
|
471
|
+
}
|
|
472
|
+
inline void setFractionColor(std::optional<double> fractionColor) noexcept override {
|
|
473
|
+
_swiftPart.setFractionColor(fractionColor);
|
|
474
|
+
}
|
|
475
|
+
inline std::optional<double> getFractionFontSize() noexcept override {
|
|
476
|
+
auto __result = _swiftPart.getFractionFontSize();
|
|
477
|
+
return __result;
|
|
478
|
+
}
|
|
479
|
+
inline void setFractionFontSize(std::optional<double> fractionFontSize) noexcept override {
|
|
480
|
+
_swiftPart.setFractionFontSize(fractionFontSize);
|
|
481
|
+
}
|
|
482
|
+
inline std::optional<NitroNumberAffixAlign> getFractionAlign() noexcept override {
|
|
483
|
+
auto __result = _swiftPart.getFractionAlign();
|
|
484
|
+
return __result;
|
|
485
|
+
}
|
|
486
|
+
inline void setFractionAlign(std::optional<NitroNumberAffixAlign> fractionAlign) noexcept override {
|
|
487
|
+
_swiftPart.setFractionAlign(fractionAlign);
|
|
488
|
+
}
|
|
489
|
+
inline std::optional<bool> getRespectReduceMotion() noexcept override {
|
|
490
|
+
auto __result = _swiftPart.getRespectReduceMotion();
|
|
491
|
+
return __result;
|
|
492
|
+
}
|
|
493
|
+
inline void setRespectReduceMotion(std::optional<bool> respectReduceMotion) noexcept override {
|
|
494
|
+
_swiftPart.setRespectReduceMotion(respectReduceMotion);
|
|
495
|
+
}
|
|
364
496
|
inline std::optional<bool> getAdjustsFontSizeToFit() noexcept override {
|
|
365
497
|
auto __result = _swiftPart.getAdjustsFontSizeToFit();
|
|
366
498
|
return __result;
|
|
@@ -445,6 +577,20 @@ namespace margelo::nitro::nitroinput {
|
|
|
445
577
|
inline void setOnRevealMilestone(const std::optional<std::function<void(double /* index */, double /* value */)>>& onRevealMilestone) noexcept override {
|
|
446
578
|
_swiftPart.setOnRevealMilestone(onRevealMilestone);
|
|
447
579
|
}
|
|
580
|
+
inline std::optional<std::function<void()>> getOnAnimationStart() noexcept override {
|
|
581
|
+
auto __result = _swiftPart.getOnAnimationStart();
|
|
582
|
+
return __result;
|
|
583
|
+
}
|
|
584
|
+
inline void setOnAnimationStart(const std::optional<std::function<void()>>& onAnimationStart) noexcept override {
|
|
585
|
+
_swiftPart.setOnAnimationStart(onAnimationStart);
|
|
586
|
+
}
|
|
587
|
+
inline std::optional<std::function<void(double /* value */)>> getOnAnimationEnd() noexcept override {
|
|
588
|
+
auto __result = _swiftPart.getOnAnimationEnd();
|
|
589
|
+
return __result;
|
|
590
|
+
}
|
|
591
|
+
inline void setOnAnimationEnd(const std::optional<std::function<void(double /* value */)>>& onAnimationEnd) noexcept override {
|
|
592
|
+
_swiftPart.setOnAnimationEnd(onAnimationEnd);
|
|
593
|
+
}
|
|
448
594
|
|
|
449
595
|
public:
|
|
450
596
|
// Methods
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextMeasureSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridNitroTextMeasureSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitroinput {
|
|
11
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextMeasureSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridNitroTextMeasureSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroTextMeasureSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroInput { class HybridNitroTextMeasureSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#include <string>
|
|
18
|
+
|
|
19
|
+
#include "NitroInput-Swift-Cxx-Umbrella.hpp"
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::nitroinput {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The C++ part of HybridNitroTextMeasureSpec_cxx.swift.
|
|
25
|
+
*
|
|
26
|
+
* HybridNitroTextMeasureSpecSwift (C++) accesses HybridNitroTextMeasureSpec_cxx (Swift), and might
|
|
27
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
28
|
+
*
|
|
29
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
30
|
+
* the future, HybridNitroTextMeasureSpec_cxx can directly inherit from the C++ class HybridNitroTextMeasureSpec
|
|
31
|
+
* to simplify the whole structure and memory management.
|
|
32
|
+
*/
|
|
33
|
+
class HybridNitroTextMeasureSpecSwift: public virtual HybridNitroTextMeasureSpec {
|
|
34
|
+
public:
|
|
35
|
+
// Constructor from a Swift instance
|
|
36
|
+
explicit HybridNitroTextMeasureSpecSwift(const NitroInput::HybridNitroTextMeasureSpec_cxx& swiftPart):
|
|
37
|
+
HybridObject(HybridNitroTextMeasureSpec::TAG),
|
|
38
|
+
_swiftPart(swiftPart) { }
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
// Get the Swift part
|
|
42
|
+
inline NitroInput::HybridNitroTextMeasureSpec_cxx& getSwiftPart() noexcept {
|
|
43
|
+
return _swiftPart;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
48
|
+
return _swiftPart.getMemorySize();
|
|
49
|
+
}
|
|
50
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
51
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroTextMeasureSpecSwift>(other)) {
|
|
52
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
void dispose() noexcept override {
|
|
57
|
+
_swiftPart.dispose();
|
|
58
|
+
}
|
|
59
|
+
std::string toString() override {
|
|
60
|
+
return _swiftPart.toString();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
// Properties
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
public:
|
|
68
|
+
// Methods
|
|
69
|
+
inline double measure(const std::string& text, double fontSize, double fontWeight, const std::string& fontFamily, double letterSpacing) override {
|
|
70
|
+
auto __result = _swiftPart.measure(text, std::forward<decltype(fontSize)>(fontSize), std::forward<decltype(fontWeight)>(fontWeight), fontFamily, std::forward<decltype(letterSpacing)>(letterSpacing));
|
|
71
|
+
if (__result.hasError()) [[unlikely]] {
|
|
72
|
+
std::rethrow_exception(__result.error());
|
|
73
|
+
}
|
|
74
|
+
auto __value = std::move(__result.value());
|
|
75
|
+
return __value;
|
|
76
|
+
}
|
|
77
|
+
inline double lineHeight(double fontSize, double fontWeight, const std::string& fontFamily) override {
|
|
78
|
+
auto __result = _swiftPart.lineHeight(std::forward<decltype(fontSize)>(fontSize), std::forward<decltype(fontWeight)>(fontWeight), fontFamily);
|
|
79
|
+
if (__result.hasError()) [[unlikely]] {
|
|
80
|
+
std::rethrow_exception(__result.error());
|
|
81
|
+
}
|
|
82
|
+
auto __value = std::move(__result.value());
|
|
83
|
+
return __value;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private:
|
|
87
|
+
NitroInput::HybridNitroTextMeasureSpec_cxx _swiftPart;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridNitroTextViewSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitroinput {
|
|
11
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridNitroTextViewSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroTextViewSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroInput { class HybridNitroTextViewSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `NitroNumberTextAlign` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
17
|
+
// Forward declaration of `NitroInputEasing` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputEasing; }
|
|
19
|
+
// Forward declaration of `NitroInputEffect` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputEffect; }
|
|
21
|
+
// Forward declaration of `NitroNumberShimmerDirection` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberShimmerDirection; }
|
|
23
|
+
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include "NitroNumberTextAlign.hpp"
|
|
27
|
+
#include "NitroInputEasing.hpp"
|
|
28
|
+
#include "NitroInputEffect.hpp"
|
|
29
|
+
#include "NitroNumberShimmerDirection.hpp"
|
|
30
|
+
|
|
31
|
+
#include "NitroInput-Swift-Cxx-Umbrella.hpp"
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro::nitroinput {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The C++ part of HybridNitroTextViewSpec_cxx.swift.
|
|
37
|
+
*
|
|
38
|
+
* HybridNitroTextViewSpecSwift (C++) accesses HybridNitroTextViewSpec_cxx (Swift), and might
|
|
39
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
40
|
+
*
|
|
41
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
42
|
+
* the future, HybridNitroTextViewSpec_cxx can directly inherit from the C++ class HybridNitroTextViewSpec
|
|
43
|
+
* to simplify the whole structure and memory management.
|
|
44
|
+
*/
|
|
45
|
+
class HybridNitroTextViewSpecSwift: public virtual HybridNitroTextViewSpec {
|
|
46
|
+
public:
|
|
47
|
+
// Constructor from a Swift instance
|
|
48
|
+
explicit HybridNitroTextViewSpecSwift(const NitroInput::HybridNitroTextViewSpec_cxx& swiftPart):
|
|
49
|
+
HybridObject(HybridNitroTextViewSpec::TAG),
|
|
50
|
+
_swiftPart(swiftPart) { }
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// Get the Swift part
|
|
54
|
+
inline NitroInput::HybridNitroTextViewSpec_cxx& getSwiftPart() noexcept {
|
|
55
|
+
return _swiftPart;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
60
|
+
return _swiftPart.getMemorySize();
|
|
61
|
+
}
|
|
62
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
63
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroTextViewSpecSwift>(other)) {
|
|
64
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
void dispose() noexcept override {
|
|
69
|
+
_swiftPart.dispose();
|
|
70
|
+
}
|
|
71
|
+
std::string toString() override {
|
|
72
|
+
return _swiftPart.toString();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public:
|
|
76
|
+
// Properties
|
|
77
|
+
inline std::string getText() noexcept override {
|
|
78
|
+
auto __result = _swiftPart.getText();
|
|
79
|
+
return __result;
|
|
80
|
+
}
|
|
81
|
+
inline void setText(const std::string& text) noexcept override {
|
|
82
|
+
_swiftPart.setText(text);
|
|
83
|
+
}
|
|
84
|
+
inline std::optional<double> getFontSize() noexcept override {
|
|
85
|
+
auto __result = _swiftPart.getFontSize();
|
|
86
|
+
return __result;
|
|
87
|
+
}
|
|
88
|
+
inline void setFontSize(std::optional<double> fontSize) noexcept override {
|
|
89
|
+
_swiftPart.setFontSize(fontSize);
|
|
90
|
+
}
|
|
91
|
+
inline std::optional<double> getFontWeight() noexcept override {
|
|
92
|
+
auto __result = _swiftPart.getFontWeight();
|
|
93
|
+
return __result;
|
|
94
|
+
}
|
|
95
|
+
inline void setFontWeight(std::optional<double> fontWeight) noexcept override {
|
|
96
|
+
_swiftPart.setFontWeight(fontWeight);
|
|
97
|
+
}
|
|
98
|
+
inline std::optional<std::string> getFontFamily() noexcept override {
|
|
99
|
+
auto __result = _swiftPart.getFontFamily();
|
|
100
|
+
return __result;
|
|
101
|
+
}
|
|
102
|
+
inline void setFontFamily(const std::optional<std::string>& fontFamily) noexcept override {
|
|
103
|
+
_swiftPart.setFontFamily(fontFamily);
|
|
104
|
+
}
|
|
105
|
+
inline std::optional<double> getColor() noexcept override {
|
|
106
|
+
auto __result = _swiftPart.getColor();
|
|
107
|
+
return __result;
|
|
108
|
+
}
|
|
109
|
+
inline void setColor(std::optional<double> color) noexcept override {
|
|
110
|
+
_swiftPart.setColor(color);
|
|
111
|
+
}
|
|
112
|
+
inline std::optional<double> getLetterSpacing() noexcept override {
|
|
113
|
+
auto __result = _swiftPart.getLetterSpacing();
|
|
114
|
+
return __result;
|
|
115
|
+
}
|
|
116
|
+
inline void setLetterSpacing(std::optional<double> letterSpacing) noexcept override {
|
|
117
|
+
_swiftPart.setLetterSpacing(letterSpacing);
|
|
118
|
+
}
|
|
119
|
+
inline std::optional<NitroNumberTextAlign> getTextAlign() noexcept override {
|
|
120
|
+
auto __result = _swiftPart.getTextAlign();
|
|
121
|
+
return __result;
|
|
122
|
+
}
|
|
123
|
+
inline void setTextAlign(std::optional<NitroNumberTextAlign> textAlign) noexcept override {
|
|
124
|
+
_swiftPart.setTextAlign(textAlign);
|
|
125
|
+
}
|
|
126
|
+
inline std::optional<bool> getRightToLeft() noexcept override {
|
|
127
|
+
auto __result = _swiftPart.getRightToLeft();
|
|
128
|
+
return __result;
|
|
129
|
+
}
|
|
130
|
+
inline void setRightToLeft(std::optional<bool> rightToLeft) noexcept override {
|
|
131
|
+
_swiftPart.setRightToLeft(rightToLeft);
|
|
132
|
+
}
|
|
133
|
+
inline std::optional<double> getDuration() noexcept override {
|
|
134
|
+
auto __result = _swiftPart.getDuration();
|
|
135
|
+
return __result;
|
|
136
|
+
}
|
|
137
|
+
inline void setDuration(std::optional<double> duration) noexcept override {
|
|
138
|
+
_swiftPart.setDuration(duration);
|
|
139
|
+
}
|
|
140
|
+
inline std::optional<NitroInputEasing> getEasing() noexcept override {
|
|
141
|
+
auto __result = _swiftPart.getEasing();
|
|
142
|
+
return __result;
|
|
143
|
+
}
|
|
144
|
+
inline void setEasing(std::optional<NitroInputEasing> easing) noexcept override {
|
|
145
|
+
_swiftPart.setEasing(easing);
|
|
146
|
+
}
|
|
147
|
+
inline std::optional<double> getBounce() noexcept override {
|
|
148
|
+
auto __result = _swiftPart.getBounce();
|
|
149
|
+
return __result;
|
|
150
|
+
}
|
|
151
|
+
inline void setBounce(std::optional<double> bounce) noexcept override {
|
|
152
|
+
_swiftPart.setBounce(bounce);
|
|
153
|
+
}
|
|
154
|
+
inline std::optional<NitroInputEffect> getEffect() noexcept override {
|
|
155
|
+
auto __result = _swiftPart.getEffect();
|
|
156
|
+
return __result;
|
|
157
|
+
}
|
|
158
|
+
inline void setEffect(std::optional<NitroInputEffect> effect) noexcept override {
|
|
159
|
+
_swiftPart.setEffect(effect);
|
|
160
|
+
}
|
|
161
|
+
inline std::optional<bool> getRespectReduceMotion() noexcept override {
|
|
162
|
+
auto __result = _swiftPart.getRespectReduceMotion();
|
|
163
|
+
return __result;
|
|
164
|
+
}
|
|
165
|
+
inline void setRespectReduceMotion(std::optional<bool> respectReduceMotion) noexcept override {
|
|
166
|
+
_swiftPart.setRespectReduceMotion(respectReduceMotion);
|
|
167
|
+
}
|
|
168
|
+
inline std::optional<bool> getLoading() noexcept override {
|
|
169
|
+
auto __result = _swiftPart.getLoading();
|
|
170
|
+
return __result;
|
|
171
|
+
}
|
|
172
|
+
inline void setLoading(std::optional<bool> loading) noexcept override {
|
|
173
|
+
_swiftPart.setLoading(loading);
|
|
174
|
+
}
|
|
175
|
+
inline std::optional<double> getShimmerColor() noexcept override {
|
|
176
|
+
auto __result = _swiftPart.getShimmerColor();
|
|
177
|
+
return __result;
|
|
178
|
+
}
|
|
179
|
+
inline void setShimmerColor(std::optional<double> shimmerColor) noexcept override {
|
|
180
|
+
_swiftPart.setShimmerColor(shimmerColor);
|
|
181
|
+
}
|
|
182
|
+
inline std::optional<double> getShimmerDuration() noexcept override {
|
|
183
|
+
auto __result = _swiftPart.getShimmerDuration();
|
|
184
|
+
return __result;
|
|
185
|
+
}
|
|
186
|
+
inline void setShimmerDuration(std::optional<double> shimmerDuration) noexcept override {
|
|
187
|
+
_swiftPart.setShimmerDuration(shimmerDuration);
|
|
188
|
+
}
|
|
189
|
+
inline std::optional<double> getShimmerAngle() noexcept override {
|
|
190
|
+
auto __result = _swiftPart.getShimmerAngle();
|
|
191
|
+
return __result;
|
|
192
|
+
}
|
|
193
|
+
inline void setShimmerAngle(std::optional<double> shimmerAngle) noexcept override {
|
|
194
|
+
_swiftPart.setShimmerAngle(shimmerAngle);
|
|
195
|
+
}
|
|
196
|
+
inline std::optional<double> getShimmerWidth() noexcept override {
|
|
197
|
+
auto __result = _swiftPart.getShimmerWidth();
|
|
198
|
+
return __result;
|
|
199
|
+
}
|
|
200
|
+
inline void setShimmerWidth(std::optional<double> shimmerWidth) noexcept override {
|
|
201
|
+
_swiftPart.setShimmerWidth(shimmerWidth);
|
|
202
|
+
}
|
|
203
|
+
inline std::optional<double> getShimmerBaseColor() noexcept override {
|
|
204
|
+
auto __result = _swiftPart.getShimmerBaseColor();
|
|
205
|
+
return __result;
|
|
206
|
+
}
|
|
207
|
+
inline void setShimmerBaseColor(std::optional<double> shimmerBaseColor) noexcept override {
|
|
208
|
+
_swiftPart.setShimmerBaseColor(shimmerBaseColor);
|
|
209
|
+
}
|
|
210
|
+
inline std::optional<NitroNumberShimmerDirection> getShimmerDirection() noexcept override {
|
|
211
|
+
auto __result = _swiftPart.getShimmerDirection();
|
|
212
|
+
return __result;
|
|
213
|
+
}
|
|
214
|
+
inline void setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) noexcept override {
|
|
215
|
+
_swiftPart.setShimmerDirection(shimmerDirection);
|
|
216
|
+
}
|
|
217
|
+
inline std::optional<double> getShimmerDelay() noexcept override {
|
|
218
|
+
auto __result = _swiftPart.getShimmerDelay();
|
|
219
|
+
return __result;
|
|
220
|
+
}
|
|
221
|
+
inline void setShimmerDelay(std::optional<double> shimmerDelay) noexcept override {
|
|
222
|
+
_swiftPart.setShimmerDelay(shimmerDelay);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public:
|
|
226
|
+
// Methods
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
private:
|
|
230
|
+
NitroInput::HybridNitroTextViewSpec_cxx _swiftPart;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
} // namespace margelo::nitro::nitroinput
|