react-native-nitro-list 0.1.2 → 0.1.3
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/README.md +16 -44
- package/ios/HybridNitroList.swift +7 -5
- package/lib/commonjs/index.js +31 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/layout/MutableLinearLayout.js.map +1 -1
- package/lib/commonjs/native/NitroListView.js +20 -0
- package/lib/commonjs/native/NitroListView.js.map +1 -0
- package/lib/commonjs/recycler/CellPool.js +5 -18
- package/lib/commonjs/recycler/CellPool.js.map +1 -1
- package/lib/commonjs/recycler/{RecyclerList.js → NitroList.js} +91 -92
- package/lib/commonjs/recycler/NitroList.js.map +1 -0
- package/lib/commonjs/scroll/useScrollVelocity.js +20 -0
- package/lib/commonjs/scroll/useScrollVelocity.js.map +1 -0
- package/lib/commonjs/{native/NitroList.types.js → specs/NitroList.nitro.js} +1 -1
- package/lib/commonjs/{native/NitroList.types.js.map → specs/NitroList.nitro.js.map} +1 -1
- package/lib/commonjs/types/CellType.js +25 -0
- package/lib/commonjs/types/CellType.js.map +1 -1
- package/lib/commonjs/types/recycler/CellPool.js +42 -0
- package/lib/commonjs/types/recycler/CellPool.js.map +1 -0
- package/lib/commonjs/types/recycler/{RecyclerListProps.js → NitroListProps.js} +1 -1
- package/lib/commonjs/types/recycler/NitroListProps.js.map +1 -0
- package/lib/commonjs/types/recycler/{RecyclerCellInstance.js → RecyclerCell.js} +1 -1
- package/lib/commonjs/types/recycler/RecyclerCell.js.map +1 -0
- package/lib/commonjs/windowing/computeVisibleItemRange.js +22 -32
- package/lib/commonjs/windowing/computeVisibleItemRange.js.map +1 -1
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/layout/MutableLinearLayout.js.map +1 -1
- package/lib/module/native/NitroListView.js +17 -0
- package/lib/module/native/NitroListView.js.map +1 -0
- package/lib/module/recycler/CellPool.js +5 -18
- package/lib/module/recycler/CellPool.js.map +1 -1
- package/lib/module/recycler/NitroList.js +220 -0
- package/lib/module/recycler/NitroList.js.map +1 -0
- package/lib/module/scroll/useScrollVelocity.js +16 -0
- package/lib/module/scroll/useScrollVelocity.js.map +1 -0
- package/lib/module/specs/NitroList.nitro.js +4 -0
- package/lib/module/{native/NitroList.types.js.map → specs/NitroList.nitro.js.map} +1 -1
- package/lib/module/types/CellType.js +20 -0
- package/lib/module/types/CellType.js.map +1 -1
- package/lib/module/types/recycler/CellPool.js +37 -0
- package/lib/module/types/recycler/CellPool.js.map +1 -0
- package/lib/module/types/recycler/NitroListProps.js +4 -0
- package/lib/module/types/recycler/NitroListProps.js.map +1 -0
- package/lib/module/types/recycler/RecyclerCell.js +4 -0
- package/lib/module/types/recycler/RecyclerCell.js.map +1 -0
- package/lib/module/windowing/computeVisibleItemRange.js +22 -32
- package/lib/module/windowing/computeVisibleItemRange.js.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/NitroListView.d.ts +20 -0
- package/lib/typescript/src/native/NitroListView.d.ts.map +1 -0
- package/lib/typescript/src/recycler/CellPool.d.ts +4 -7
- package/lib/typescript/src/recycler/CellPool.d.ts.map +1 -1
- package/lib/typescript/src/recycler/NitroList.d.ts +4 -0
- package/lib/typescript/src/recycler/NitroList.d.ts.map +1 -0
- package/lib/typescript/src/scroll/useScrollVelocity.d.ts +2 -0
- package/lib/typescript/src/scroll/useScrollVelocity.d.ts.map +1 -0
- package/lib/typescript/src/specs/NitroList.nitro.d.ts +26 -0
- package/lib/typescript/src/specs/NitroList.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types/CellKey.d.ts +1 -9
- package/lib/typescript/src/types/CellKey.d.ts.map +1 -1
- package/lib/typescript/src/types/CellType.d.ts +12 -1
- package/lib/typescript/src/types/CellType.d.ts.map +1 -1
- package/lib/typescript/src/types/recycler/CellPool.d.ts +16 -0
- package/lib/typescript/src/types/recycler/CellPool.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/{RecyclerListProps.d.ts → NitroListProps.d.ts} +3 -3
- package/lib/typescript/src/types/recycler/NitroListProps.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerCell.d.ts +12 -0
- package/lib/typescript/src/types/recycler/RecyclerCell.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts +6 -2
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts.map +1 -1
- package/lib/typescript/src/types/recycler/index.d.ts +2 -2
- package/lib/typescript/src/types/recycler/index.d.ts.map +1 -1
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts +16 -12
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts.map +1 -1
- package/nitro.json +5 -5
- package/nitrogen/generated/android/NitroList+autolinking.cmake +2 -2
- package/nitrogen/generated/android/NitroListOnLoad.cpp +2 -2
- package/nitrogen/generated/android/c++/{JHybridNitroLayoutEngineSpec.cpp → JHybridNitroListSpec.cpp} +15 -15
- package/nitrogen/generated/android/c++/{JHybridNitroLayoutEngineSpec.hpp → JHybridNitroListSpec.hpp} +11 -11
- package/nitrogen/generated/android/c++/{JLayoutRect.hpp → JItemLayout.hpp} +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{HybridNitroLayoutEngineSpec.kt → HybridNitroListSpec.kt} +7 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{LayoutRect.kt → ItemLayout.kt} +5 -5
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.cpp +9 -9
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.hpp +27 -27
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Umbrella.hpp +8 -8
- package/nitrogen/generated/ios/c++/{HybridNitroLayoutEngineSpecSwift.cpp → HybridNitroListSpecSwift.cpp} +2 -2
- package/nitrogen/generated/ios/c++/{HybridNitroLayoutEngineSpecSwift.hpp → HybridNitroListSpecSwift.hpp} +16 -16
- package/nitrogen/generated/ios/swift/HybridNitroListSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/{HybridNitroLayoutEngineSpec_cxx.swift → HybridNitroListSpec_cxx.swift} +23 -23
- package/nitrogen/generated/ios/swift/{LayoutRect.swift → ItemLayout.swift} +5 -5
- package/nitrogen/generated/shared/c++/{HybridNitroLayoutEngineSpec.cpp → HybridNitroListSpec.cpp} +4 -4
- package/nitrogen/generated/shared/c++/{HybridNitroLayoutEngineSpec.hpp → HybridNitroListSpec.hpp} +13 -13
- package/nitrogen/generated/shared/c++/{LayoutRect.hpp → ItemLayout.hpp} +11 -11
- package/package.json +5 -5
- package/src/index.ts +7 -1
- package/src/layout/MutableLinearLayout.ts +1 -1
- package/src/native/NitroListView.ts +22 -0
- package/src/recycler/CellPool.ts +10 -24
- package/src/recycler/NitroList.tsx +317 -0
- package/src/scroll/useScrollVelocity.ts +16 -0
- package/src/specs/NitroList.nitro.ts +29 -0
- package/src/types/CellKey.ts +2 -9
- package/src/types/CellType.ts +8 -9
- package/src/types/recycler/CellPool.ts +45 -0
- package/src/types/recycler/{RecyclerListProps.ts → NitroListProps.ts} +2 -2
- package/src/types/recycler/RecyclerCell.ts +12 -0
- package/src/types/recycler/RecyclerItemRenderer.ts +6 -2
- package/src/types/recycler/index.ts +2 -2
- package/src/windowing/computeVisibleItemRange.ts +42 -38
- package/lib/commonjs/NitroList.js +0 -9
- package/lib/commonjs/NitroList.js.map +0 -1
- package/lib/commonjs/native/NitroLayoutEngine.js +0 -9
- package/lib/commonjs/native/NitroLayoutEngine.js.map +0 -1
- package/lib/commonjs/native/NitroRecyclerView.js +0 -9
- package/lib/commonjs/native/NitroRecyclerView.js.map +0 -1
- package/lib/commonjs/recycler/RecyclerList.js.map +0 -1
- package/lib/commonjs/specs/nitro-layout-engine.nitro.js +0 -6
- package/lib/commonjs/specs/nitro-layout-engine.nitro.js.map +0 -1
- package/lib/commonjs/types/recycler/RecyclerCellInstance.js.map +0 -1
- package/lib/commonjs/types/recycler/RecyclerListProps.js.map +0 -1
- package/lib/module/NitroList.js +0 -5
- package/lib/module/NitroList.js.map +0 -1
- package/lib/module/native/NitroLayoutEngine.js +0 -5
- package/lib/module/native/NitroLayoutEngine.js.map +0 -1
- package/lib/module/native/NitroList.types.js +0 -4
- package/lib/module/native/NitroRecyclerView.js +0 -5
- package/lib/module/native/NitroRecyclerView.js.map +0 -1
- package/lib/module/recycler/RecyclerList.js +0 -221
- package/lib/module/recycler/RecyclerList.js.map +0 -1
- package/lib/module/specs/nitro-layout-engine.nitro.js +0 -4
- package/lib/module/specs/nitro-layout-engine.nitro.js.map +0 -1
- package/lib/module/types/recycler/RecyclerCellInstance.js +0 -4
- package/lib/module/types/recycler/RecyclerCellInstance.js.map +0 -1
- package/lib/module/types/recycler/RecyclerListProps.js +0 -4
- package/lib/module/types/recycler/RecyclerListProps.js.map +0 -1
- package/lib/typescript/src/NitroList.d.ts +0 -5
- package/lib/typescript/src/NitroList.d.ts.map +0 -1
- package/lib/typescript/src/native/NitroLayoutEngine.d.ts +0 -3
- package/lib/typescript/src/native/NitroLayoutEngine.d.ts.map +0 -1
- package/lib/typescript/src/native/NitroList.types.d.ts +0 -9
- package/lib/typescript/src/native/NitroList.types.d.ts.map +0 -1
- package/lib/typescript/src/native/NitroRecyclerView.d.ts +0 -5
- package/lib/typescript/src/native/NitroRecyclerView.d.ts.map +0 -1
- package/lib/typescript/src/recycler/RecyclerList.d.ts +0 -4
- package/lib/typescript/src/recycler/RecyclerList.d.ts.map +0 -1
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts +0 -14
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts.map +0 -1
- package/lib/typescript/src/types/recycler/RecyclerCellInstance.d.ts +0 -37
- package/lib/typescript/src/types/recycler/RecyclerCellInstance.d.ts.map +0 -1
- package/lib/typescript/src/types/recycler/RecyclerListProps.d.ts.map +0 -1
- package/nitrogen/generated/ios/swift/HybridNitroLayoutEngineSpec.swift +0 -56
- package/src/NitroList.ts +0 -8
- package/src/native/NitroLayoutEngine.ts +0 -7
- package/src/native/NitroList.types.ts +0 -13
- package/src/native/NitroRecyclerView.ts +0 -8
- package/src/recycler/RecyclerList.tsx +0 -304
- package/src/specs/nitro-layout-engine.nitro.ts +0 -17
- package/src/types/recycler/RecyclerCellInstance.ts +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JItemLayout.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "
|
|
11
|
+
#include "ItemLayout.hpp"
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -17,19 +17,19 @@ namespace margelo::nitro::nitrolist {
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "ItemLayout" and the the Kotlin data class "ItemLayout".
|
|
21
21
|
*/
|
|
22
|
-
struct
|
|
22
|
+
struct JItemLayout final: public jni::JavaClass<JItemLayout> {
|
|
23
23
|
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolist/
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolist/ItemLayout;";
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ItemLayout by copying all values to C++.
|
|
29
29
|
*/
|
|
30
30
|
[[maybe_unused]]
|
|
31
31
|
[[nodiscard]]
|
|
32
|
-
|
|
32
|
+
ItemLayout toCpp() const {
|
|
33
33
|
static const auto clazz = javaClassStatic();
|
|
34
34
|
static const auto fieldX = clazz->getField<double>("x");
|
|
35
35
|
double x = this->getFieldValue(fieldX);
|
|
@@ -39,7 +39,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
39
39
|
double width = this->getFieldValue(fieldWidth);
|
|
40
40
|
static const auto fieldHeight = clazz->getField<double>("height");
|
|
41
41
|
double height = this->getFieldValue(fieldHeight);
|
|
42
|
-
return
|
|
42
|
+
return ItemLayout(
|
|
43
43
|
x,
|
|
44
44
|
y,
|
|
45
45
|
width,
|
|
@@ -52,8 +52,8 @@ namespace margelo::nitro::nitrolist {
|
|
|
52
52
|
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
53
|
*/
|
|
54
54
|
[[maybe_unused]]
|
|
55
|
-
static jni::local_ref<
|
|
56
|
-
using JSignature =
|
|
55
|
+
static jni::local_ref<JItemLayout::javaobject> fromCpp(const ItemLayout& value) {
|
|
56
|
+
using JSignature = JItemLayout(double, double, double, double);
|
|
57
57
|
static const auto clazz = javaClassStatic();
|
|
58
58
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
59
|
return create(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpec.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -13,8 +13,8 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
13
13
|
import com.margelo.nitro.core.HybridObject
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* A Kotlin class representing the
|
|
17
|
-
* Implement this abstract class to create Kotlin-based instances of
|
|
16
|
+
* A Kotlin class representing the NitroList HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of NitroList.
|
|
18
18
|
*/
|
|
19
19
|
@DoNotStrip
|
|
20
20
|
@Keep
|
|
@@ -23,7 +23,7 @@ import com.margelo.nitro.core.HybridObject
|
|
|
23
23
|
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
24
|
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
25
|
)
|
|
26
|
-
abstract class
|
|
26
|
+
abstract class HybridNitroListSpec: HybridObject() {
|
|
27
27
|
@DoNotStrip
|
|
28
28
|
private var mHybridData: HybridData = initHybrid()
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@ abstract class HybridNitroLayoutEngineSpec: HybridObject() {
|
|
|
38
38
|
|
|
39
39
|
// Default implementation of `HybridObject.toString()`
|
|
40
40
|
override fun toString(): String {
|
|
41
|
-
return "[HybridObject
|
|
41
|
+
return "[HybridObject NitroList]"
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Properties
|
|
@@ -47,11 +47,11 @@ abstract class HybridNitroLayoutEngineSpec: HybridObject() {
|
|
|
47
47
|
// Methods
|
|
48
48
|
@DoNotStrip
|
|
49
49
|
@Keep
|
|
50
|
-
abstract fun computeLayout(containerWidth: Double, itemHeights: DoubleArray): Array<
|
|
50
|
+
abstract fun computeLayout(containerWidth: Double, itemHeights: DoubleArray): Array<ItemLayout>
|
|
51
51
|
|
|
52
52
|
private external fun initHybrid(): HybridData
|
|
53
53
|
|
|
54
54
|
companion object {
|
|
55
|
-
protected const val TAG = "
|
|
55
|
+
protected const val TAG = "HybridNitroListSpec"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// ItemLayout.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -12,11 +12,11 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Represents the JavaScript object/struct "
|
|
15
|
+
* Represents the JavaScript object/struct "ItemLayout".
|
|
16
16
|
*/
|
|
17
17
|
@DoNotStrip
|
|
18
18
|
@Keep
|
|
19
|
-
data class
|
|
19
|
+
data class ItemLayout(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
22
|
val x: Double,
|
|
@@ -40,8 +40,8 @@ data class LayoutRect(
|
|
|
40
40
|
@Keep
|
|
41
41
|
@Suppress("unused")
|
|
42
42
|
@JvmStatic
|
|
43
|
-
private fun fromCpp(x: Double, y: Double, width: Double, height: Double):
|
|
44
|
-
return
|
|
43
|
+
private fun fromCpp(x: Double, y: Double, width: Double, height: Double): ItemLayout {
|
|
44
|
+
return ItemLayout(x, y, width, height)
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
#include "NitroList-Swift-Cxx-Bridge.hpp"
|
|
9
9
|
|
|
10
10
|
// Include C++ implementation defined types
|
|
11
|
-
#include "
|
|
11
|
+
#include "HybridNitroListSpecSwift.hpp"
|
|
12
12
|
#include "NitroList-Swift-Cxx-Umbrella.hpp"
|
|
13
13
|
#include <NitroModules/NitroDefines.hpp>
|
|
14
14
|
|
|
15
15
|
namespace margelo::nitro::nitrolist::bridge::swift {
|
|
16
16
|
|
|
17
|
-
// pragma MARK: std::shared_ptr<
|
|
18
|
-
std::shared_ptr<
|
|
19
|
-
NitroList::
|
|
20
|
-
return std::make_shared<margelo::nitro::nitrolist::
|
|
17
|
+
// pragma MARK: std::shared_ptr<HybridNitroListSpec>
|
|
18
|
+
std::shared_ptr<HybridNitroListSpec> create_std__shared_ptr_HybridNitroListSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
19
|
+
NitroList::HybridNitroListSpec_cxx swiftPart = NitroList::HybridNitroListSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
20
|
+
return std::make_shared<margelo::nitro::nitrolist::HybridNitroListSpecSwift>(swiftPart);
|
|
21
21
|
}
|
|
22
|
-
void* NON_NULL
|
|
23
|
-
std::shared_ptr<margelo::nitro::nitrolist::
|
|
22
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroListSpec_(std__shared_ptr_HybridNitroListSpec_ cppType) {
|
|
23
|
+
std::shared_ptr<margelo::nitro::nitrolist::HybridNitroListSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrolist::HybridNitroListSpecSwift>(cppType);
|
|
24
24
|
#ifdef NITRO_DEBUG
|
|
25
25
|
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
26
|
-
throw std::runtime_error("Class \"
|
|
26
|
+
throw std::runtime_error("Class \"HybridNitroListSpec\" is not implemented in Swift!");
|
|
27
27
|
}
|
|
28
28
|
#endif
|
|
29
|
-
NitroList::
|
|
29
|
+
NitroList::HybridNitroListSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
30
30
|
return swiftPart.toUnsafe();
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `
|
|
12
|
-
namespace margelo::nitro::nitrolist { class
|
|
13
|
-
// Forward declaration of `
|
|
14
|
-
namespace margelo::nitro::nitrolist { struct
|
|
11
|
+
// Forward declaration of `HybridNitroListSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::nitrolist { class HybridNitroListSpec; }
|
|
13
|
+
// Forward declaration of `ItemLayout` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitrolist { struct ItemLayout; }
|
|
15
15
|
|
|
16
16
|
// Forward declarations of Swift defined types
|
|
17
|
-
// Forward declaration of `
|
|
18
|
-
namespace NitroList { class
|
|
17
|
+
// Forward declaration of `HybridNitroListSpec_cxx` to properly resolve imports.
|
|
18
|
+
namespace NitroList { class HybridNitroListSpec_cxx; }
|
|
19
19
|
|
|
20
20
|
// Include C++ defined types
|
|
21
|
-
#include "
|
|
22
|
-
#include "
|
|
21
|
+
#include "HybridNitroListSpec.hpp"
|
|
22
|
+
#include "ItemLayout.hpp"
|
|
23
23
|
#include <NitroModules/Result.hpp>
|
|
24
24
|
#include <exception>
|
|
25
25
|
#include <memory>
|
|
@@ -31,13 +31,13 @@ namespace NitroList { class HybridNitroLayoutEngineSpec_cxx; }
|
|
|
31
31
|
*/
|
|
32
32
|
namespace margelo::nitro::nitrolist::bridge::swift {
|
|
33
33
|
|
|
34
|
-
// pragma MARK: std::vector<
|
|
34
|
+
// pragma MARK: std::vector<ItemLayout>
|
|
35
35
|
/**
|
|
36
|
-
* Specialized version of `std::vector<
|
|
36
|
+
* Specialized version of `std::vector<ItemLayout>`.
|
|
37
37
|
*/
|
|
38
|
-
using
|
|
39
|
-
inline std::vector<
|
|
40
|
-
std::vector<
|
|
38
|
+
using std__vector_ItemLayout_ = std::vector<ItemLayout>;
|
|
39
|
+
inline std::vector<ItemLayout> create_std__vector_ItemLayout_(size_t size) noexcept {
|
|
40
|
+
std::vector<ItemLayout> vector;
|
|
41
41
|
vector.reserve(size);
|
|
42
42
|
return vector;
|
|
43
43
|
}
|
|
@@ -53,25 +53,25 @@ namespace margelo::nitro::nitrolist::bridge::swift {
|
|
|
53
53
|
return vector;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// pragma MARK: std::shared_ptr<
|
|
56
|
+
// pragma MARK: std::shared_ptr<HybridNitroListSpec>
|
|
57
57
|
/**
|
|
58
|
-
* Specialized version of `std::shared_ptr<
|
|
58
|
+
* Specialized version of `std::shared_ptr<HybridNitroListSpec>`.
|
|
59
59
|
*/
|
|
60
|
-
using
|
|
61
|
-
std::shared_ptr<
|
|
62
|
-
void* NON_NULL
|
|
60
|
+
using std__shared_ptr_HybridNitroListSpec_ = std::shared_ptr<HybridNitroListSpec>;
|
|
61
|
+
std::shared_ptr<HybridNitroListSpec> create_std__shared_ptr_HybridNitroListSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
62
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroListSpec_(std__shared_ptr_HybridNitroListSpec_ cppType);
|
|
63
63
|
|
|
64
|
-
// pragma MARK: std::weak_ptr<
|
|
65
|
-
using
|
|
66
|
-
inline
|
|
64
|
+
// pragma MARK: std::weak_ptr<HybridNitroListSpec>
|
|
65
|
+
using std__weak_ptr_HybridNitroListSpec_ = std::weak_ptr<HybridNitroListSpec>;
|
|
66
|
+
inline std__weak_ptr_HybridNitroListSpec_ weakify_std__shared_ptr_HybridNitroListSpec_(const std::shared_ptr<HybridNitroListSpec>& strong) noexcept { return strong; }
|
|
67
67
|
|
|
68
|
-
// pragma MARK: Result<std::vector<
|
|
69
|
-
using
|
|
70
|
-
inline
|
|
71
|
-
return Result<std::vector<
|
|
68
|
+
// pragma MARK: Result<std::vector<ItemLayout>>
|
|
69
|
+
using Result_std__vector_ItemLayout__ = Result<std::vector<ItemLayout>>;
|
|
70
|
+
inline Result_std__vector_ItemLayout__ create_Result_std__vector_ItemLayout__(const std::vector<ItemLayout>& value) noexcept {
|
|
71
|
+
return Result<std::vector<ItemLayout>>::withValue(value);
|
|
72
72
|
}
|
|
73
|
-
inline
|
|
74
|
-
return Result<std::vector<
|
|
73
|
+
inline Result_std__vector_ItemLayout__ create_Result_std__vector_ItemLayout__(const std::exception_ptr& error) noexcept {
|
|
74
|
+
return Result<std::vector<ItemLayout>>::withError(error);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
} // namespace margelo::nitro::nitrolist::bridge::swift
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `
|
|
12
|
-
namespace margelo::nitro::nitrolist { class
|
|
13
|
-
// Forward declaration of `
|
|
14
|
-
namespace margelo::nitro::nitrolist { struct
|
|
11
|
+
// Forward declaration of `HybridNitroListSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::nitrolist { class HybridNitroListSpec; }
|
|
13
|
+
// Forward declaration of `ItemLayout` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitrolist { struct ItemLayout; }
|
|
15
15
|
|
|
16
16
|
// Include C++ defined types
|
|
17
|
-
#include "
|
|
18
|
-
#include "
|
|
17
|
+
#include "HybridNitroListSpec.hpp"
|
|
18
|
+
#include "ItemLayout.hpp"
|
|
19
19
|
#include <NitroModules/Result.hpp>
|
|
20
20
|
#include <exception>
|
|
21
21
|
#include <memory>
|
|
@@ -31,8 +31,8 @@ namespace margelo::nitro::nitrolist { struct LayoutRect; }
|
|
|
31
31
|
#include <NitroModules/DateToChronoDate.hpp>
|
|
32
32
|
|
|
33
33
|
// Forward declarations of Swift defined types
|
|
34
|
-
// Forward declaration of `
|
|
35
|
-
namespace NitroList { class
|
|
34
|
+
// Forward declaration of `HybridNitroListSpec_cxx` to properly resolve imports.
|
|
35
|
+
namespace NitroList { class HybridNitroListSpec_cxx; }
|
|
36
36
|
|
|
37
37
|
// Include Swift defined types
|
|
38
38
|
#if __has_include("NitroList-Swift.h")
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "HybridNitroListSpecSwift.hpp"
|
|
9
9
|
|
|
10
10
|
namespace margelo::nitro::nitrolist {
|
|
11
11
|
} // namespace margelo::nitro::nitrolist
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include "
|
|
10
|
+
#include "HybridNitroListSpec.hpp"
|
|
11
11
|
|
|
12
|
-
// Forward declaration of `
|
|
13
|
-
namespace NitroList { class
|
|
12
|
+
// Forward declaration of `HybridNitroListSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroList { class HybridNitroListSpec_cxx; }
|
|
14
14
|
|
|
15
|
-
// Forward declaration of `
|
|
16
|
-
namespace margelo::nitro::nitrolist { struct
|
|
15
|
+
// Forward declaration of `ItemLayout` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitrolist { struct ItemLayout; }
|
|
17
17
|
|
|
18
|
-
#include "
|
|
18
|
+
#include "ItemLayout.hpp"
|
|
19
19
|
#include <vector>
|
|
20
20
|
|
|
21
21
|
#include "NitroList-Swift-Cxx-Umbrella.hpp"
|
|
@@ -23,25 +23,25 @@ namespace margelo::nitro::nitrolist { struct LayoutRect; }
|
|
|
23
23
|
namespace margelo::nitro::nitrolist {
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* The C++ part of
|
|
26
|
+
* The C++ part of HybridNitroListSpec_cxx.swift.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
28
|
+
* HybridNitroListSpecSwift (C++) accesses HybridNitroListSpec_cxx (Swift), and might
|
|
29
29
|
* contain some additional bridging code for C++ <> Swift interop.
|
|
30
30
|
*
|
|
31
31
|
* Since this obviously introduces an overhead, I hope at some point in
|
|
32
|
-
* the future,
|
|
32
|
+
* the future, HybridNitroListSpec_cxx can directly inherit from the C++ class HybridNitroListSpec
|
|
33
33
|
* to simplify the whole structure and memory management.
|
|
34
34
|
*/
|
|
35
|
-
class
|
|
35
|
+
class HybridNitroListSpecSwift: public virtual HybridNitroListSpec {
|
|
36
36
|
public:
|
|
37
37
|
// Constructor from a Swift instance
|
|
38
|
-
explicit
|
|
39
|
-
HybridObject(
|
|
38
|
+
explicit HybridNitroListSpecSwift(const NitroList::HybridNitroListSpec_cxx& swiftPart):
|
|
39
|
+
HybridObject(HybridNitroListSpec::TAG),
|
|
40
40
|
_swiftPart(swiftPart) { }
|
|
41
41
|
|
|
42
42
|
public:
|
|
43
43
|
// Get the Swift part
|
|
44
|
-
inline NitroList::
|
|
44
|
+
inline NitroList::HybridNitroListSpec_cxx& getSwiftPart() noexcept {
|
|
45
45
|
return _swiftPart;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -62,7 +62,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
62
62
|
|
|
63
63
|
public:
|
|
64
64
|
// Methods
|
|
65
|
-
inline std::vector<
|
|
65
|
+
inline std::vector<ItemLayout> computeLayout(double containerWidth, const std::vector<double>& itemHeights) override {
|
|
66
66
|
auto __result = _swiftPart.computeLayout(std::forward<decltype(containerWidth)>(containerWidth), itemHeights);
|
|
67
67
|
if (__result.hasError()) [[unlikely]] {
|
|
68
68
|
std::rethrow_exception(__result.error());
|
|
@@ -72,7 +72,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
private:
|
|
75
|
-
NitroList::
|
|
75
|
+
NitroList::HybridNitroListSpec_cxx _swiftPart;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
} // namespace margelo::nitro::nitrolist
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroListSpec.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/// See ``HybridNitroListSpec``
|
|
12
|
+
public protocol HybridNitroListSpec_protocol: HybridObject {
|
|
13
|
+
// Properties
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Methods
|
|
17
|
+
func computeLayout(containerWidth: Double, itemHeights: [Double]) throws -> [ItemLayout]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public extension HybridNitroListSpec_protocol {
|
|
21
|
+
/// Default implementation of ``HybridObject.toString``
|
|
22
|
+
func toString() -> String {
|
|
23
|
+
return "[HybridObject NitroList]"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// See ``HybridNitroListSpec``
|
|
28
|
+
open class HybridNitroListSpec_base {
|
|
29
|
+
private weak var cxxWrapper: HybridNitroListSpec_cxx? = nil
|
|
30
|
+
public init() { }
|
|
31
|
+
public func getCxxWrapper() -> HybridNitroListSpec_cxx {
|
|
32
|
+
#if DEBUG
|
|
33
|
+
guard self is HybridNitroListSpec else {
|
|
34
|
+
fatalError("`self` is not a `HybridNitroListSpec`! Did you accidentally inherit from `HybridNitroListSpec_base` instead of `HybridNitroListSpec`?")
|
|
35
|
+
}
|
|
36
|
+
#endif
|
|
37
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
38
|
+
return cxxWrapper
|
|
39
|
+
} else {
|
|
40
|
+
let cxxWrapper = HybridNitroListSpec_cxx(self as! HybridNitroListSpec)
|
|
41
|
+
self.cxxWrapper = cxxWrapper
|
|
42
|
+
return cxxWrapper
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A Swift base-protocol representing the NitroList HybridObject.
|
|
49
|
+
* Implement this protocol to create Swift-based instances of NitroList.
|
|
50
|
+
* ```swift
|
|
51
|
+
* class HybridNitroList : HybridNitroListSpec {
|
|
52
|
+
* // ...
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
public typealias HybridNitroListSpec = HybridNitroListSpec_protocol & HybridNitroListSpec_base
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpec_cxx.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -9,7 +9,7 @@ import Foundation
|
|
|
9
9
|
import NitroModules
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* A class implementation that bridges
|
|
12
|
+
* A class implementation that bridges HybridNitroListSpec over to C++.
|
|
13
13
|
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
14
14
|
*
|
|
15
15
|
* Also, some Swift types need to be bridged with special handling:
|
|
@@ -17,7 +17,7 @@ import NitroModules
|
|
|
17
17
|
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
18
|
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
19
|
*/
|
|
20
|
-
open class
|
|
20
|
+
open class HybridNitroListSpec_cxx {
|
|
21
21
|
/**
|
|
22
22
|
* The Swift <> C++ bridge's namespace (`margelo::nitro::nitrolist::bridge::swift`)
|
|
23
23
|
* from `NitroList-Swift-Cxx-Bridge.hpp`.
|
|
@@ -26,30 +26,30 @@ open class HybridNitroLayoutEngineSpec_cxx {
|
|
|
26
26
|
public typealias bridge = margelo.nitro.nitrolist.bridge.swift
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Holds an instance of the `
|
|
29
|
+
* Holds an instance of the `HybridNitroListSpec` Swift protocol.
|
|
30
30
|
*/
|
|
31
|
-
private var __implementation: any
|
|
31
|
+
private var __implementation: any HybridNitroListSpec
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
35
|
*/
|
|
36
|
-
private var __cxxPart: bridge.
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridNitroListSpec_
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Create a new `
|
|
39
|
+
* Create a new `HybridNitroListSpec_cxx` that wraps the given `HybridNitroListSpec`.
|
|
40
40
|
* All properties and methods bridge to C++ types.
|
|
41
41
|
*/
|
|
42
|
-
public init(_ implementation: any
|
|
42
|
+
public init(_ implementation: any HybridNitroListSpec) {
|
|
43
43
|
self.__implementation = implementation
|
|
44
44
|
self.__cxxPart = .init()
|
|
45
45
|
/* no base class */
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* Get the actual `
|
|
49
|
+
* Get the actual `HybridNitroListSpec` instance this class wraps.
|
|
50
50
|
*/
|
|
51
51
|
@inline(__always)
|
|
52
|
-
public func
|
|
52
|
+
public func getHybridNitroListSpec() -> any HybridNitroListSpec {
|
|
53
53
|
return __implementation
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -62,25 +62,25 @@ open class HybridNitroLayoutEngineSpec_cxx {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* Casts an unsafe pointer to a `
|
|
66
|
-
* The pointer has to be a retained opaque `Unmanaged<
|
|
65
|
+
* Casts an unsafe pointer to a `HybridNitroListSpec_cxx`.
|
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNitroListSpec_cxx>`.
|
|
67
67
|
* This removes one strong reference from the object!
|
|
68
68
|
*/
|
|
69
|
-
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) ->
|
|
70
|
-
return Unmanaged<
|
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNitroListSpec_cxx {
|
|
70
|
+
return Unmanaged<HybridNitroListSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
-
* The C++ part is a `std::shared_ptr<
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridNitroListSpec>`.
|
|
76
76
|
*/
|
|
77
|
-
public func getCxxPart() -> bridge.
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridNitroListSpec_ {
|
|
78
78
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
79
|
if Bool(fromCxx: cachedCxxPart) {
|
|
80
80
|
return cachedCxxPart
|
|
81
81
|
} else {
|
|
82
|
-
let newCxxPart = bridge.
|
|
83
|
-
__cxxPart = bridge.
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridNitroListSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridNitroListSpec_(newCxxPart)
|
|
84
84
|
return newCxxPart
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -118,20 +118,20 @@ open class HybridNitroLayoutEngineSpec_cxx {
|
|
|
118
118
|
|
|
119
119
|
// Methods
|
|
120
120
|
@inline(__always)
|
|
121
|
-
public final func computeLayout(containerWidth: Double, itemHeights: bridge.std__vector_double_) -> bridge.
|
|
121
|
+
public final func computeLayout(containerWidth: Double, itemHeights: bridge.std__vector_double_) -> bridge.Result_std__vector_ItemLayout__ {
|
|
122
122
|
do {
|
|
123
123
|
let __result = try self.__implementation.computeLayout(containerWidth: containerWidth, itemHeights: itemHeights.map({ __item in __item }))
|
|
124
|
-
let __resultCpp = { () -> bridge.
|
|
125
|
-
var __vector = bridge.
|
|
124
|
+
let __resultCpp = { () -> bridge.std__vector_ItemLayout_ in
|
|
125
|
+
var __vector = bridge.create_std__vector_ItemLayout_(__result.count)
|
|
126
126
|
for __item in __result {
|
|
127
127
|
__vector.push_back(__item)
|
|
128
128
|
}
|
|
129
129
|
return __vector
|
|
130
130
|
}()
|
|
131
|
-
return bridge.
|
|
131
|
+
return bridge.create_Result_std__vector_ItemLayout__(__resultCpp)
|
|
132
132
|
} catch (let __error) {
|
|
133
133
|
let __exceptionPtr = __error.toCpp()
|
|
134
|
-
return bridge.
|
|
134
|
+
return bridge.create_Result_std__vector_ItemLayout__(__exceptionPtr)
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// ItemLayout.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -9,15 +9,15 @@ import Foundation
|
|
|
9
9
|
import NitroModules
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Represents an instance of `
|
|
12
|
+
* Represents an instance of `ItemLayout`, backed by a C++ struct.
|
|
13
13
|
*/
|
|
14
|
-
public typealias
|
|
14
|
+
public typealias ItemLayout = margelo.nitro.nitrolist.ItemLayout
|
|
15
15
|
|
|
16
|
-
public extension
|
|
16
|
+
public extension ItemLayout {
|
|
17
17
|
private typealias bridge = margelo.nitro.nitrolist.bridge.swift
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Create a new instance of `
|
|
20
|
+
* Create a new instance of `ItemLayout`.
|
|
21
21
|
*/
|
|
22
22
|
init(x: Double, y: Double, width: Double, height: Double) {
|
|
23
23
|
self.init(x, y, width, height)
|
package/nitrogen/generated/shared/c++/{HybridNitroLayoutEngineSpec.cpp → HybridNitroListSpec.cpp}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "HybridNitroListSpec.hpp"
|
|
9
9
|
|
|
10
10
|
namespace margelo::nitro::nitrolist {
|
|
11
11
|
|
|
12
|
-
void
|
|
12
|
+
void HybridNitroListSpec::loadHybridMethods() {
|
|
13
13
|
// load base methods/properties
|
|
14
14
|
HybridObject::loadHybridMethods();
|
|
15
15
|
// load custom methods/properties
|
|
16
16
|
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridMethod("computeLayout", &
|
|
17
|
+
prototype.registerHybridMethod("computeLayout", &HybridNitroListSpec::computeLayout);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|