@onekeyfe/react-native-qr-scanner 6.8.0-alpha.540 → 6.8.0-alpha.546
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/android/src/main/java/com/margelo/nitro/qrscanner/HybridQrCameraList.kt +100 -0
- package/android/src/main/java/com/margelo/nitro/qrscanner/QrCameraCatalog.kt +26 -0
- package/android/src/main/java/com/margelo/nitro/qrscanner/QrCameraZoom.kt +15 -0
- package/android/src/main/java/com/margelo/nitro/qrscanner/QrScanner.kt +135 -10
- package/android/src/test/java/com/margelo/nitro/qrscanner/QrCameraCatalogTest.kt +37 -0
- package/android/src/test/java/com/margelo/nitro/qrscanner/QrCameraZoomTest.kt +24 -0
- package/ios/HybridQrCameraList.swift +54 -0
- package/ios/QrCameraControl.swift +99 -0
- package/ios/QrScanner.swift +207 -24
- package/lib/module/QrCameraList.nitro.js +4 -0
- package/lib/module/QrCameraList.nitro.js.map +1 -0
- package/lib/module/QrScanner.js +2 -0
- package/lib/module/QrScanner.js.map +1 -1
- package/lib/module/cameras.js +33 -0
- package/lib/module/cameras.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/web/cameras.js +33 -0
- package/lib/module/web/cameras.js.map +1 -0
- package/lib/module/web/index.js +1 -0
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/scanner.js +22 -5
- package/lib/module/web/scanner.js.map +1 -1
- package/lib/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/lib/nitrogen/generated/android/c++/JHybridQrCameraListSpec.cpp +91 -0
- package/lib/nitrogen/generated/android/c++/JHybridQrCameraListSpec.hpp +64 -0
- package/lib/nitrogen/generated/android/c++/JHybridQrScannerSpec.cpp +11 -2
- package/lib/nitrogen/generated/android/c++/JHybridQrScannerSpec.hpp +2 -0
- package/lib/nitrogen/generated/android/c++/JQrCameraInfo.hpp +67 -0
- package/lib/nitrogen/generated/android/c++/JQrCameraPosition.hpp +61 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridQrScannerStateUpdater.cpp +5 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/Func_void.kt +78 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/HybridQrCameraListSpec.kt +66 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/HybridQrScannerSpec.kt +6 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/QrCameraInfo.kt +61 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/QrCameraPosition.kt +24 -0
- package/lib/nitrogen/generated/android/qrscanner+autolinking.cmake +2 -0
- package/lib/nitrogen/generated/android/qrscannerOnLoad.cpp +18 -0
- package/lib/nitrogen/generated/ios/QrScanner-Swift-Cxx-Bridge.cpp +37 -4
- package/lib/nitrogen/generated/ios/QrScanner-Swift-Cxx-Bridge.hpp +146 -22
- package/lib/nitrogen/generated/ios/QrScanner-Swift-Cxx-Umbrella.hpp +12 -0
- package/lib/nitrogen/generated/ios/QrScannerAutolinking.mm +8 -0
- package/lib/nitrogen/generated/ios/QrScannerAutolinking.swift +12 -0
- package/lib/nitrogen/generated/ios/c++/HybridQrCameraListSpecSwift.cpp +11 -0
- package/lib/nitrogen/generated/ios/c++/HybridQrCameraListSpecSwift.hpp +97 -0
- package/lib/nitrogen/generated/ios/c++/HybridQrScannerSpecSwift.hpp +9 -2
- package/lib/nitrogen/generated/ios/c++/views/HybridQrScannerComponent.mm +6 -0
- package/lib/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/lib/nitrogen/generated/ios/swift/Func_void_std__vector_QrCameraInfo_.swift +46 -0
- package/lib/nitrogen/generated/ios/swift/HybridQrCameraListSpec.swift +56 -0
- package/lib/nitrogen/generated/ios/swift/HybridQrCameraListSpec_cxx.swift +174 -0
- package/lib/nitrogen/generated/ios/swift/HybridQrScannerSpec.swift +1 -0
- package/lib/nitrogen/generated/ios/swift/HybridQrScannerSpec_cxx.swift +24 -0
- package/lib/nitrogen/generated/ios/swift/QrCameraInfo.swift +39 -0
- package/lib/nitrogen/generated/ios/swift/QrCameraPosition.swift +44 -0
- package/lib/nitrogen/generated/shared/c++/HybridQrCameraListSpec.cpp +22 -0
- package/lib/nitrogen/generated/shared/c++/HybridQrCameraListSpec.hpp +68 -0
- package/lib/nitrogen/generated/shared/c++/HybridQrScannerSpec.cpp +2 -0
- package/lib/nitrogen/generated/shared/c++/HybridQrScannerSpec.hpp +4 -2
- package/lib/nitrogen/generated/shared/c++/QrCameraInfo.hpp +93 -0
- package/lib/nitrogen/generated/shared/c++/QrCameraPosition.hpp +80 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridQrScannerComponent.cpp +2 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridQrScannerComponent.hpp +5 -2
- package/lib/nitrogen/generated/shared/json/QrScannerConfig.json +1 -0
- package/lib/typescript/src/QrCameraList.nitro.d.ts +24 -0
- package/lib/typescript/src/QrCameraList.nitro.d.ts.map +1 -0
- package/lib/typescript/src/QrScanner.d.ts +6 -1
- package/lib/typescript/src/QrScanner.d.ts.map +1 -1
- package/lib/typescript/src/QrScanner.nitro.d.ts +6 -0
- package/lib/typescript/src/QrScanner.nitro.d.ts.map +1 -1
- package/lib/typescript/src/cameras.d.ts +11 -0
- package/lib/typescript/src/cameras.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/web/cameras.d.ts +12 -0
- package/lib/typescript/src/web/cameras.d.ts.map +1 -0
- package/lib/typescript/src/web/index.d.ts +2 -0
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/scanner.d.ts +7 -0
- package/lib/typescript/src/web/scanner.d.ts.map +1 -1
- package/nitro.json +4 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridQrCameraListSpec.cpp +91 -0
- package/nitrogen/generated/android/c++/JHybridQrCameraListSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridQrScannerSpec.cpp +11 -2
- package/nitrogen/generated/android/c++/JHybridQrScannerSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JQrCameraInfo.hpp +67 -0
- package/nitrogen/generated/android/c++/JQrCameraPosition.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridQrScannerStateUpdater.cpp +5 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/Func_void.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/HybridQrCameraListSpec.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/HybridQrScannerSpec.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/QrCameraInfo.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/QrCameraPosition.kt +24 -0
- package/nitrogen/generated/android/qrscanner+autolinking.cmake +2 -0
- package/nitrogen/generated/android/qrscannerOnLoad.cpp +18 -0
- package/nitrogen/generated/ios/QrScanner-Swift-Cxx-Bridge.cpp +37 -4
- package/nitrogen/generated/ios/QrScanner-Swift-Cxx-Bridge.hpp +146 -22
- package/nitrogen/generated/ios/QrScanner-Swift-Cxx-Umbrella.hpp +12 -0
- package/nitrogen/generated/ios/QrScannerAutolinking.mm +8 -0
- package/nitrogen/generated/ios/QrScannerAutolinking.swift +12 -0
- package/nitrogen/generated/ios/c++/HybridQrCameraListSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridQrCameraListSpecSwift.hpp +97 -0
- package/nitrogen/generated/ios/c++/HybridQrScannerSpecSwift.hpp +9 -2
- package/nitrogen/generated/ios/c++/views/HybridQrScannerComponent.mm +6 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_QrCameraInfo_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridQrCameraListSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridQrCameraListSpec_cxx.swift +174 -0
- package/nitrogen/generated/ios/swift/HybridQrScannerSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridQrScannerSpec_cxx.swift +24 -0
- package/nitrogen/generated/ios/swift/QrCameraInfo.swift +39 -0
- package/nitrogen/generated/ios/swift/QrCameraPosition.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridQrCameraListSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridQrCameraListSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridQrScannerSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridQrScannerSpec.hpp +4 -2
- package/nitrogen/generated/shared/c++/QrCameraInfo.hpp +93 -0
- package/nitrogen/generated/shared/c++/QrCameraPosition.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridQrScannerComponent.cpp +2 -0
- package/nitrogen/generated/shared/c++/views/HybridQrScannerComponent.hpp +5 -2
- package/nitrogen/generated/shared/json/QrScannerConfig.json +1 -0
- package/package.json +1 -1
- package/src/QrCameraList.nitro.ts +24 -0
- package/src/QrScanner.nitro.ts +6 -0
- package/src/QrScanner.tsx +9 -1
- package/src/cameras.ts +36 -0
- package/src/index.tsx +2 -0
- package/src/web/cameras.ts +36 -0
- package/src/web/index.ts +6 -0
- package/src/web/scanner.ts +28 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void.kt
|
|
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
|
+
package com.margelo.nitro.qrscanner
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript callback `() => void`.
|
|
17
|
+
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
18
|
+
* or in Kotlin/Java (in which case it is a native callback).
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
23
|
+
fun interface Func_void: () -> Unit {
|
|
24
|
+
/**
|
|
25
|
+
* Call the given JS callback.
|
|
26
|
+
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
27
|
+
*/
|
|
28
|
+
@DoNotStrip
|
|
29
|
+
@Keep
|
|
30
|
+
override fun invoke(): Unit
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Represents the JavaScript callback `() => void`.
|
|
35
|
+
* This is implemented in C++, via a `std::function<...>`.
|
|
36
|
+
* The callback might be coming from JS.
|
|
37
|
+
*/
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
@Suppress(
|
|
41
|
+
"KotlinJniMissingFunction", "unused",
|
|
42
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
43
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
44
|
+
)
|
|
45
|
+
class Func_void_cxx: Func_void {
|
|
46
|
+
@DoNotStrip
|
|
47
|
+
@Keep
|
|
48
|
+
private val mHybridData: HybridData
|
|
49
|
+
|
|
50
|
+
@DoNotStrip
|
|
51
|
+
@Keep
|
|
52
|
+
private constructor(hybridData: HybridData) {
|
|
53
|
+
mHybridData = hybridData
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
@Keep
|
|
58
|
+
override fun invoke(): Unit
|
|
59
|
+
= invoke_cxx()
|
|
60
|
+
|
|
61
|
+
private external fun invoke_cxx(): Unit
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Represents the JavaScript callback `() => void`.
|
|
66
|
+
* This is implemented in Java/Kotlin, via a `() -> Unit`.
|
|
67
|
+
* The callback is always coming from native.
|
|
68
|
+
*/
|
|
69
|
+
@DoNotStrip
|
|
70
|
+
@Keep
|
|
71
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
72
|
+
class Func_void_java(private val function: () -> Unit): Func_void {
|
|
73
|
+
@DoNotStrip
|
|
74
|
+
@Keep
|
|
75
|
+
override fun invoke(): Unit {
|
|
76
|
+
return this.function()
|
|
77
|
+
}
|
|
78
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/HybridQrCameraListSpec.kt
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridQrCameraListSpec.kt
|
|
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
|
+
package com.margelo.nitro.qrscanner
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
import com.margelo.nitro.core.Promise
|
|
15
|
+
import com.margelo.nitro.core.HybridObject
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A Kotlin class representing the QrCameraList HybridObject.
|
|
19
|
+
* Implement this abstract class to create Kotlin-based instances of QrCameraList.
|
|
20
|
+
*/
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
@Suppress(
|
|
24
|
+
"KotlinJniMissingFunction", "unused",
|
|
25
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
26
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
27
|
+
)
|
|
28
|
+
abstract class HybridQrCameraListSpec: HybridObject() {
|
|
29
|
+
// Properties
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// Methods
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
abstract fun listCameras(): Promise<Array<QrCameraInfo>>
|
|
36
|
+
|
|
37
|
+
abstract fun setOnChange(listener: (() -> Unit)?): Unit
|
|
38
|
+
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
private fun setOnChange_cxx(listener: Func_void?): Unit {
|
|
42
|
+
val __result = setOnChange(listener?.let { it })
|
|
43
|
+
return __result
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Default implementation of `HybridObject.toString()`
|
|
47
|
+
override fun toString(): String {
|
|
48
|
+
return "[HybridObject QrCameraList]"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// C++ backing class
|
|
52
|
+
@DoNotStrip
|
|
53
|
+
@Keep
|
|
54
|
+
protected open class CxxPart(javaPart: HybridQrCameraListSpec): HybridObject.CxxPart(javaPart) {
|
|
55
|
+
// C++ JHybridQrCameraListSpec::CxxPart::initHybrid(...)
|
|
56
|
+
@FastNative
|
|
57
|
+
external override fun initHybrid(): HybridData
|
|
58
|
+
}
|
|
59
|
+
override fun createCxxPart(): CxxPart {
|
|
60
|
+
return CxxPart(this)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
companion object {
|
|
64
|
+
protected const val TAG = "HybridQrCameraListSpec"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/qrscanner/HybridQrScannerSpec.kt
CHANGED
|
@@ -33,6 +33,12 @@ abstract class HybridQrScannerSpec: HybridView() {
|
|
|
33
33
|
@set:Keep
|
|
34
34
|
abstract var active: Boolean
|
|
35
35
|
|
|
36
|
+
@get:DoNotStrip
|
|
37
|
+
@get:Keep
|
|
38
|
+
@set:DoNotStrip
|
|
39
|
+
@set:Keep
|
|
40
|
+
abstract var cameraId: String?
|
|
41
|
+
|
|
36
42
|
abstract var onReady: ((generation: Double) -> Unit)?
|
|
37
43
|
|
|
38
44
|
private var onReady_cxx: Func_void_double?
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QrCameraInfo.kt
|
|
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
|
+
package com.margelo.nitro.qrscanner
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "QrCameraInfo".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class QrCameraInfo(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val id: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val position: QrCameraPosition,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val label: String
|
|
30
|
+
) {
|
|
31
|
+
/* primary constructor */
|
|
32
|
+
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is QrCameraInfo) return false
|
|
36
|
+
return Objects.deepEquals(this.id, other.id)
|
|
37
|
+
&& Objects.deepEquals(this.position, other.position)
|
|
38
|
+
&& Objects.deepEquals(this.label, other.label)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf<Any?>(
|
|
43
|
+
id,
|
|
44
|
+
position,
|
|
45
|
+
label
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
companion object {
|
|
50
|
+
/**
|
|
51
|
+
* Constructor called from C++
|
|
52
|
+
*/
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
@Suppress("unused")
|
|
56
|
+
@JvmStatic
|
|
57
|
+
private fun fromCpp(id: String, position: QrCameraPosition, label: String): QrCameraInfo {
|
|
58
|
+
return QrCameraInfo(id, position, label)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QrCameraPosition.kt
|
|
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
|
+
package com.margelo.nitro.qrscanner
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "QrCameraPosition".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class QrCameraPosition(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
BACK(0),
|
|
20
|
+
FRONT(1),
|
|
21
|
+
EXTERNAL(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -33,10 +33,12 @@ target_sources(
|
|
|
33
33
|
# Autolinking Setup
|
|
34
34
|
../nitrogen/generated/android/qrscannerOnLoad.cpp
|
|
35
35
|
# Shared Nitrogen C++ sources
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridQrCameraListSpec.cpp
|
|
36
37
|
../nitrogen/generated/shared/c++/HybridQrImageDecoderSpec.cpp
|
|
37
38
|
../nitrogen/generated/shared/c++/HybridQrScannerSpec.cpp
|
|
38
39
|
../nitrogen/generated/shared/c++/views/HybridQrScannerComponent.cpp
|
|
39
40
|
# Android-specific Nitrogen C++ sources
|
|
41
|
+
../nitrogen/generated/android/c++/JHybridQrCameraListSpec.cpp
|
|
40
42
|
../nitrogen/generated/android/c++/JHybridQrImageDecoderSpec.cpp
|
|
41
43
|
../nitrogen/generated/android/c++/JHybridQrScannerSpec.cpp
|
|
42
44
|
../nitrogen/generated/android/c++/views/JHybridQrScannerStateUpdater.cpp
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
#include <fbjni/fbjni.h>
|
|
16
16
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
17
|
|
|
18
|
+
#include "JHybridQrCameraListSpec.hpp"
|
|
19
|
+
#include "JFunc_void.hpp"
|
|
18
20
|
#include "JHybridQrImageDecoderSpec.hpp"
|
|
19
21
|
#include "JHybridQrScannerSpec.hpp"
|
|
20
22
|
#include "JFunc_void_double.hpp"
|
|
@@ -47,12 +49,22 @@ struct JHybridQrImageDecoderSpecImpl: public jni::JavaClass<JHybridQrImageDecode
|
|
|
47
49
|
return javaPart->getJHybridQrImageDecoderSpec();
|
|
48
50
|
}
|
|
49
51
|
};
|
|
52
|
+
struct JHybridQrCameraListSpecImpl: public jni::JavaClass<JHybridQrCameraListSpecImpl, JHybridQrCameraListSpec::JavaPart> {
|
|
53
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/qrscanner/HybridQrCameraList;";
|
|
54
|
+
static std::shared_ptr<JHybridQrCameraListSpec> create() {
|
|
55
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridQrCameraListSpecImpl::javaobject()>();
|
|
56
|
+
jni::local_ref<JHybridQrCameraListSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
57
|
+
return javaPart->getJHybridQrCameraListSpec();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
50
60
|
|
|
51
61
|
void registerAllNatives() {
|
|
52
62
|
using namespace margelo::nitro;
|
|
53
63
|
using namespace margelo::nitro::qrscanner;
|
|
54
64
|
|
|
55
65
|
// Register native JNI methods
|
|
66
|
+
margelo::nitro::qrscanner::JHybridQrCameraListSpec::CxxPart::registerNatives();
|
|
67
|
+
margelo::nitro::qrscanner::JFunc_void_cxx::registerNatives();
|
|
56
68
|
margelo::nitro::qrscanner::JHybridQrImageDecoderSpec::CxxPart::registerNatives();
|
|
57
69
|
margelo::nitro::qrscanner::JHybridQrScannerSpec::CxxPart::registerNatives();
|
|
58
70
|
margelo::nitro::qrscanner::JFunc_void_double_cxx::registerNatives();
|
|
@@ -73,6 +85,12 @@ void registerAllNatives() {
|
|
|
73
85
|
return JHybridQrImageDecoderSpecImpl::create();
|
|
74
86
|
}
|
|
75
87
|
);
|
|
88
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
89
|
+
"QrCameraList",
|
|
90
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
91
|
+
return JHybridQrCameraListSpecImpl::create();
|
|
92
|
+
}
|
|
93
|
+
);
|
|
76
94
|
}
|
|
77
95
|
|
|
78
96
|
} // namespace margelo::nitro::qrscanner
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#include "QrScanner-Swift-Cxx-Bridge.hpp"
|
|
9
9
|
|
|
10
10
|
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridQrCameraListSpecSwift.hpp"
|
|
11
12
|
#include "HybridQrImageDecoderSpecSwift.hpp"
|
|
12
13
|
#include "HybridQrScannerSpecSwift.hpp"
|
|
13
14
|
#include "QrScanner-Swift-Cxx-Umbrella.hpp"
|
|
@@ -15,10 +16,10 @@
|
|
|
15
16
|
|
|
16
17
|
namespace margelo::nitro::qrscanner::bridge::swift {
|
|
17
18
|
|
|
18
|
-
// pragma MARK: std::function<void(const
|
|
19
|
-
|
|
20
|
-
auto swiftClosure = QrScanner::
|
|
21
|
-
return [swiftClosure = std::move(swiftClosure)](const
|
|
19
|
+
// pragma MARK: std::function<void(const std::vector<QrCameraInfo>& /* result */)>
|
|
20
|
+
Func_void_std__vector_QrCameraInfo_ create_Func_void_std__vector_QrCameraInfo_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
21
|
+
auto swiftClosure = QrScanner::Func_void_std__vector_QrCameraInfo_::fromUnsafe(swiftClosureWrapper);
|
|
22
|
+
return [swiftClosure = std::move(swiftClosure)](const std::vector<QrCameraInfo>& result) mutable -> void {
|
|
22
23
|
swiftClosure.call(result);
|
|
23
24
|
};
|
|
24
25
|
}
|
|
@@ -31,6 +32,38 @@ namespace margelo::nitro::qrscanner::bridge::swift {
|
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
// pragma MARK: std::function<void()>
|
|
36
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
37
|
+
auto swiftClosure = QrScanner::Func_void::fromUnsafe(swiftClosureWrapper);
|
|
38
|
+
return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
|
|
39
|
+
swiftClosure.call();
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// pragma MARK: std::shared_ptr<HybridQrCameraListSpec>
|
|
44
|
+
std::shared_ptr<HybridQrCameraListSpec> create_std__shared_ptr_HybridQrCameraListSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
45
|
+
QrScanner::HybridQrCameraListSpec_cxx swiftPart = QrScanner::HybridQrCameraListSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
46
|
+
return std::make_shared<margelo::nitro::qrscanner::HybridQrCameraListSpecSwift>(swiftPart);
|
|
47
|
+
}
|
|
48
|
+
void* NON_NULL get_std__shared_ptr_HybridQrCameraListSpec_(std__shared_ptr_HybridQrCameraListSpec_ cppType) {
|
|
49
|
+
std::shared_ptr<margelo::nitro::qrscanner::HybridQrCameraListSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::qrscanner::HybridQrCameraListSpecSwift>(cppType);
|
|
50
|
+
#ifdef NITRO_DEBUG
|
|
51
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
52
|
+
throw std::runtime_error("Class \"HybridQrCameraListSpec\" is not implemented in Swift!");
|
|
53
|
+
}
|
|
54
|
+
#endif
|
|
55
|
+
QrScanner::HybridQrCameraListSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
56
|
+
return swiftPart.toUnsafe();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// pragma MARK: std::function<void(const QrImageDecodeResult& /* result */)>
|
|
60
|
+
Func_void_QrImageDecodeResult create_Func_void_QrImageDecodeResult(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
61
|
+
auto swiftClosure = QrScanner::Func_void_QrImageDecodeResult::fromUnsafe(swiftClosureWrapper);
|
|
62
|
+
return [swiftClosure = std::move(swiftClosure)](const QrImageDecodeResult& result) mutable -> void {
|
|
63
|
+
swiftClosure.call(result);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
34
67
|
// pragma MARK: std::shared_ptr<HybridQrImageDecoderSpec>
|
|
35
68
|
std::shared_ptr<HybridQrImageDecoderSpec> create_std__shared_ptr_HybridQrImageDecoderSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
36
69
|
QrScanner::HybridQrImageDecoderSpec_cxx swiftPart = QrScanner::HybridQrImageDecoderSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
@@ -8,10 +8,16 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridQrCameraListSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::qrscanner { class HybridQrCameraListSpec; }
|
|
11
13
|
// Forward declaration of `HybridQrImageDecoderSpec` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::qrscanner { class HybridQrImageDecoderSpec; }
|
|
13
15
|
// Forward declaration of `HybridQrScannerSpec` to properly resolve imports.
|
|
14
16
|
namespace margelo::nitro::qrscanner { class HybridQrScannerSpec; }
|
|
17
|
+
// Forward declaration of `QrCameraInfo` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::qrscanner { struct QrCameraInfo; }
|
|
19
|
+
// Forward declaration of `QrCameraPosition` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::qrscanner { enum class QrCameraPosition; }
|
|
15
21
|
// Forward declaration of `QrDecodeEngine` to properly resolve imports.
|
|
16
22
|
namespace margelo::nitro::qrscanner { enum class QrDecodeEngine; }
|
|
17
23
|
// Forward declaration of `QrDecodePass` to properly resolve imports.
|
|
@@ -20,14 +26,19 @@ namespace margelo::nitro::qrscanner { enum class QrDecodePass; }
|
|
|
20
26
|
namespace margelo::nitro::qrscanner { struct QrImageDecodeResult; }
|
|
21
27
|
|
|
22
28
|
// Forward declarations of Swift defined types
|
|
29
|
+
// Forward declaration of `HybridQrCameraListSpec_cxx` to properly resolve imports.
|
|
30
|
+
namespace QrScanner { class HybridQrCameraListSpec_cxx; }
|
|
23
31
|
// Forward declaration of `HybridQrImageDecoderSpec_cxx` to properly resolve imports.
|
|
24
32
|
namespace QrScanner { class HybridQrImageDecoderSpec_cxx; }
|
|
25
33
|
// Forward declaration of `HybridQrScannerSpec_cxx` to properly resolve imports.
|
|
26
34
|
namespace QrScanner { class HybridQrScannerSpec_cxx; }
|
|
27
35
|
|
|
28
36
|
// Include C++ defined types
|
|
37
|
+
#include "HybridQrCameraListSpec.hpp"
|
|
29
38
|
#include "HybridQrImageDecoderSpec.hpp"
|
|
30
39
|
#include "HybridQrScannerSpec.hpp"
|
|
40
|
+
#include "QrCameraInfo.hpp"
|
|
41
|
+
#include "QrCameraPosition.hpp"
|
|
31
42
|
#include "QrDecodeEngine.hpp"
|
|
32
43
|
#include "QrDecodePass.hpp"
|
|
33
44
|
#include "QrImageDecodeResult.hpp"
|
|
@@ -39,6 +50,7 @@ namespace QrScanner { class HybridQrScannerSpec_cxx; }
|
|
|
39
50
|
#include <memory>
|
|
40
51
|
#include <optional>
|
|
41
52
|
#include <string>
|
|
53
|
+
#include <vector>
|
|
42
54
|
|
|
43
55
|
/**
|
|
44
56
|
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
@@ -46,6 +58,140 @@ namespace QrScanner { class HybridQrScannerSpec_cxx; }
|
|
|
46
58
|
*/
|
|
47
59
|
namespace margelo::nitro::qrscanner::bridge::swift {
|
|
48
60
|
|
|
61
|
+
// pragma MARK: std::vector<QrCameraInfo>
|
|
62
|
+
/**
|
|
63
|
+
* Specialized version of `std::vector<QrCameraInfo>`.
|
|
64
|
+
*/
|
|
65
|
+
using std__vector_QrCameraInfo_ = std::vector<QrCameraInfo>;
|
|
66
|
+
inline std::vector<QrCameraInfo> create_std__vector_QrCameraInfo_(size_t size) noexcept {
|
|
67
|
+
std::vector<QrCameraInfo> vector;
|
|
68
|
+
vector.reserve(size);
|
|
69
|
+
return vector;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// pragma MARK: std::shared_ptr<Promise<std::vector<QrCameraInfo>>>
|
|
73
|
+
/**
|
|
74
|
+
* Specialized version of `std::shared_ptr<Promise<std::vector<QrCameraInfo>>>`.
|
|
75
|
+
*/
|
|
76
|
+
using std__shared_ptr_Promise_std__vector_QrCameraInfo___ = std::shared_ptr<Promise<std::vector<QrCameraInfo>>>;
|
|
77
|
+
inline std::shared_ptr<Promise<std::vector<QrCameraInfo>>> create_std__shared_ptr_Promise_std__vector_QrCameraInfo___() noexcept {
|
|
78
|
+
return Promise<std::vector<QrCameraInfo>>::create();
|
|
79
|
+
}
|
|
80
|
+
inline PromiseHolder<std::vector<QrCameraInfo>> wrap_std__shared_ptr_Promise_std__vector_QrCameraInfo___(std::shared_ptr<Promise<std::vector<QrCameraInfo>>> promise) noexcept {
|
|
81
|
+
return PromiseHolder<std::vector<QrCameraInfo>>(std::move(promise));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// pragma MARK: std::function<void(const std::vector<QrCameraInfo>& /* result */)>
|
|
85
|
+
/**
|
|
86
|
+
* Specialized version of `std::function<void(const std::vector<QrCameraInfo>&)>`.
|
|
87
|
+
*/
|
|
88
|
+
using Func_void_std__vector_QrCameraInfo_ = std::function<void(const std::vector<QrCameraInfo>& /* result */)>;
|
|
89
|
+
/**
|
|
90
|
+
* Wrapper class for a `std::function<void(const std::vector<QrCameraInfo>& / * result * /)>`, this can be used from Swift.
|
|
91
|
+
*/
|
|
92
|
+
class Func_void_std__vector_QrCameraInfo__Wrapper final {
|
|
93
|
+
public:
|
|
94
|
+
explicit Func_void_std__vector_QrCameraInfo__Wrapper(std::function<void(const std::vector<QrCameraInfo>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::vector<QrCameraInfo>& /* result */)>>(std::move(func))) {}
|
|
95
|
+
inline void call(std::vector<QrCameraInfo> result) const noexcept {
|
|
96
|
+
_function->operator()(result);
|
|
97
|
+
}
|
|
98
|
+
private:
|
|
99
|
+
std::unique_ptr<std::function<void(const std::vector<QrCameraInfo>& /* result */)>> _function;
|
|
100
|
+
} SWIFT_NONCOPYABLE;
|
|
101
|
+
Func_void_std__vector_QrCameraInfo_ create_Func_void_std__vector_QrCameraInfo_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
102
|
+
inline Func_void_std__vector_QrCameraInfo__Wrapper wrap_Func_void_std__vector_QrCameraInfo_(Func_void_std__vector_QrCameraInfo_ value) noexcept {
|
|
103
|
+
return Func_void_std__vector_QrCameraInfo__Wrapper(std::move(value));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
107
|
+
/**
|
|
108
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
109
|
+
*/
|
|
110
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
111
|
+
/**
|
|
112
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
113
|
+
*/
|
|
114
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
115
|
+
public:
|
|
116
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
117
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
118
|
+
_function->operator()(error);
|
|
119
|
+
}
|
|
120
|
+
private:
|
|
121
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
122
|
+
} SWIFT_NONCOPYABLE;
|
|
123
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
124
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
125
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// pragma MARK: std::function<void()>
|
|
129
|
+
/**
|
|
130
|
+
* Specialized version of `std::function<void()>`.
|
|
131
|
+
*/
|
|
132
|
+
using Func_void = std::function<void()>;
|
|
133
|
+
/**
|
|
134
|
+
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
|
135
|
+
*/
|
|
136
|
+
class Func_void_Wrapper final {
|
|
137
|
+
public:
|
|
138
|
+
explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
|
|
139
|
+
inline void call() const noexcept {
|
|
140
|
+
_function->operator()();
|
|
141
|
+
}
|
|
142
|
+
private:
|
|
143
|
+
std::unique_ptr<std::function<void()>> _function;
|
|
144
|
+
} SWIFT_NONCOPYABLE;
|
|
145
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
146
|
+
inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
|
|
147
|
+
return Func_void_Wrapper(std::move(value));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// pragma MARK: std::optional<std::function<void()>>
|
|
151
|
+
/**
|
|
152
|
+
* Specialized version of `std::optional<std::function<void()>>`.
|
|
153
|
+
*/
|
|
154
|
+
using std__optional_std__function_void____ = std::optional<std::function<void()>>;
|
|
155
|
+
inline std::optional<std::function<void()>> create_std__optional_std__function_void____(const std::function<void()>& value) noexcept {
|
|
156
|
+
return std::optional<std::function<void()>>(value);
|
|
157
|
+
}
|
|
158
|
+
inline bool has_value_std__optional_std__function_void____(const std::optional<std::function<void()>>& optional) noexcept {
|
|
159
|
+
return optional.has_value();
|
|
160
|
+
}
|
|
161
|
+
inline std::function<void()> get_std__optional_std__function_void____(const std::optional<std::function<void()>>& optional) noexcept {
|
|
162
|
+
return optional.value();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// pragma MARK: std::shared_ptr<HybridQrCameraListSpec>
|
|
166
|
+
/**
|
|
167
|
+
* Specialized version of `std::shared_ptr<HybridQrCameraListSpec>`.
|
|
168
|
+
*/
|
|
169
|
+
using std__shared_ptr_HybridQrCameraListSpec_ = std::shared_ptr<HybridQrCameraListSpec>;
|
|
170
|
+
std::shared_ptr<HybridQrCameraListSpec> create_std__shared_ptr_HybridQrCameraListSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
171
|
+
void* NON_NULL get_std__shared_ptr_HybridQrCameraListSpec_(std__shared_ptr_HybridQrCameraListSpec_ cppType);
|
|
172
|
+
|
|
173
|
+
// pragma MARK: std::weak_ptr<HybridQrCameraListSpec>
|
|
174
|
+
using std__weak_ptr_HybridQrCameraListSpec_ = std::weak_ptr<HybridQrCameraListSpec>;
|
|
175
|
+
inline std__weak_ptr_HybridQrCameraListSpec_ weakify_std__shared_ptr_HybridQrCameraListSpec_(const std::shared_ptr<HybridQrCameraListSpec>& strong) noexcept { return strong; }
|
|
176
|
+
|
|
177
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::vector<QrCameraInfo>>>>
|
|
178
|
+
using Result_std__shared_ptr_Promise_std__vector_QrCameraInfo____ = Result<std::shared_ptr<Promise<std::vector<QrCameraInfo>>>>;
|
|
179
|
+
inline Result_std__shared_ptr_Promise_std__vector_QrCameraInfo____ create_Result_std__shared_ptr_Promise_std__vector_QrCameraInfo____(const std::shared_ptr<Promise<std::vector<QrCameraInfo>>>& value) noexcept {
|
|
180
|
+
return Result<std::shared_ptr<Promise<std::vector<QrCameraInfo>>>>::withValue(value);
|
|
181
|
+
}
|
|
182
|
+
inline Result_std__shared_ptr_Promise_std__vector_QrCameraInfo____ create_Result_std__shared_ptr_Promise_std__vector_QrCameraInfo____(const std::exception_ptr& error) noexcept {
|
|
183
|
+
return Result<std::shared_ptr<Promise<std::vector<QrCameraInfo>>>>::withError(error);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// pragma MARK: Result<void>
|
|
187
|
+
using Result_void_ = Result<void>;
|
|
188
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
189
|
+
return Result<void>::withValue();
|
|
190
|
+
}
|
|
191
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
192
|
+
return Result<void>::withError(error);
|
|
193
|
+
}
|
|
194
|
+
|
|
49
195
|
// pragma MARK: std::optional<std::string>
|
|
50
196
|
/**
|
|
51
197
|
* Specialized version of `std::optional<std::string>`.
|
|
@@ -125,28 +271,6 @@ namespace margelo::nitro::qrscanner::bridge::swift {
|
|
|
125
271
|
return Func_void_QrImageDecodeResult_Wrapper(std::move(value));
|
|
126
272
|
}
|
|
127
273
|
|
|
128
|
-
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
129
|
-
/**
|
|
130
|
-
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
131
|
-
*/
|
|
132
|
-
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
133
|
-
/**
|
|
134
|
-
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
135
|
-
*/
|
|
136
|
-
class Func_void_std__exception_ptr_Wrapper final {
|
|
137
|
-
public:
|
|
138
|
-
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
139
|
-
inline void call(std::exception_ptr error) const noexcept {
|
|
140
|
-
_function->operator()(error);
|
|
141
|
-
}
|
|
142
|
-
private:
|
|
143
|
-
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
144
|
-
} SWIFT_NONCOPYABLE;
|
|
145
|
-
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
146
|
-
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
147
|
-
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
274
|
// pragma MARK: std::shared_ptr<HybridQrImageDecoderSpec>
|
|
151
275
|
/**
|
|
152
276
|
* Specialized version of `std::shared_ptr<HybridQrImageDecoderSpec>`.
|
|
@@ -8,10 +8,16 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridQrCameraListSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::qrscanner { class HybridQrCameraListSpec; }
|
|
11
13
|
// Forward declaration of `HybridQrImageDecoderSpec` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::qrscanner { class HybridQrImageDecoderSpec; }
|
|
13
15
|
// Forward declaration of `HybridQrScannerSpec` to properly resolve imports.
|
|
14
16
|
namespace margelo::nitro::qrscanner { class HybridQrScannerSpec; }
|
|
17
|
+
// Forward declaration of `QrCameraInfo` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::qrscanner { struct QrCameraInfo; }
|
|
19
|
+
// Forward declaration of `QrCameraPosition` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::qrscanner { enum class QrCameraPosition; }
|
|
15
21
|
// Forward declaration of `QrDecodeEngine` to properly resolve imports.
|
|
16
22
|
namespace margelo::nitro::qrscanner { enum class QrDecodeEngine; }
|
|
17
23
|
// Forward declaration of `QrDecodePass` to properly resolve imports.
|
|
@@ -20,8 +26,11 @@ namespace margelo::nitro::qrscanner { enum class QrDecodePass; }
|
|
|
20
26
|
namespace margelo::nitro::qrscanner { struct QrImageDecodeResult; }
|
|
21
27
|
|
|
22
28
|
// Include C++ defined types
|
|
29
|
+
#include "HybridQrCameraListSpec.hpp"
|
|
23
30
|
#include "HybridQrImageDecoderSpec.hpp"
|
|
24
31
|
#include "HybridQrScannerSpec.hpp"
|
|
32
|
+
#include "QrCameraInfo.hpp"
|
|
33
|
+
#include "QrCameraPosition.hpp"
|
|
25
34
|
#include "QrDecodeEngine.hpp"
|
|
26
35
|
#include "QrDecodePass.hpp"
|
|
27
36
|
#include "QrImageDecodeResult.hpp"
|
|
@@ -32,6 +41,7 @@ namespace margelo::nitro::qrscanner { struct QrImageDecodeResult; }
|
|
|
32
41
|
#include <memory>
|
|
33
42
|
#include <optional>
|
|
34
43
|
#include <string>
|
|
44
|
+
#include <vector>
|
|
35
45
|
|
|
36
46
|
// C++ helpers for Swift
|
|
37
47
|
#include "QrScanner-Swift-Cxx-Bridge.hpp"
|
|
@@ -43,6 +53,8 @@ namespace margelo::nitro::qrscanner { struct QrImageDecodeResult; }
|
|
|
43
53
|
#include <NitroModules/DateToChronoDate.hpp>
|
|
44
54
|
|
|
45
55
|
// Forward declarations of Swift defined types
|
|
56
|
+
// Forward declaration of `HybridQrCameraListSpec_cxx` to properly resolve imports.
|
|
57
|
+
namespace QrScanner { class HybridQrCameraListSpec_cxx; }
|
|
46
58
|
// Forward declaration of `HybridQrImageDecoderSpec_cxx` to properly resolve imports.
|
|
47
59
|
namespace QrScanner { class HybridQrImageDecoderSpec_cxx; }
|
|
48
60
|
// Forward declaration of `HybridQrScannerSpec_cxx` to properly resolve imports.
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#include "HybridQrScannerSpecSwift.hpp"
|
|
14
14
|
#include "HybridQrImageDecoderSpecSwift.hpp"
|
|
15
|
+
#include "HybridQrCameraListSpecSwift.hpp"
|
|
15
16
|
|
|
16
17
|
@interface QrScannerAutolinking : NSObject
|
|
17
18
|
@end
|
|
@@ -36,6 +37,13 @@
|
|
|
36
37
|
return hybridObject;
|
|
37
38
|
}
|
|
38
39
|
);
|
|
40
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
41
|
+
"QrCameraList",
|
|
42
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
43
|
+
std::shared_ptr<HybridQrCameraListSpec> hybridObject = QrScanner::QrScannerAutolinking::createQrCameraList();
|
|
44
|
+
return hybridObject;
|
|
45
|
+
}
|
|
46
|
+
);
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
@end
|
|
@@ -35,4 +35,16 @@ public final class QrScannerAutolinking {
|
|
|
35
35
|
public static func isQrImageDecoderRecyclable() -> Bool {
|
|
36
36
|
return HybridQrImageDecoder.self is any RecyclableView.Type
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
public static func createQrCameraList() -> bridge.std__shared_ptr_HybridQrCameraListSpec_ {
|
|
40
|
+
let hybridObject = HybridQrCameraList()
|
|
41
|
+
return { () -> bridge.std__shared_ptr_HybridQrCameraListSpec_ in
|
|
42
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
43
|
+
return __cxxWrapped.getCxxPart()
|
|
44
|
+
}()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static func isQrCameraListRecyclable() -> Bool {
|
|
48
|
+
return HybridQrCameraList.self is any RecyclableView.Type
|
|
49
|
+
}
|
|
38
50
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridQrCameraListSpecSwift.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 "HybridQrCameraListSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::qrscanner {
|
|
11
|
+
} // namespace margelo::nitro::qrscanner
|