react-native-pdf-sdk 0.0.0-stage → 0.1.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 +24 -0
- package/LICENSE +21 -0
- package/PdfSdk.podspec +32 -0
- package/README.md +270 -2
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +132 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfDocument.kt +72 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfSdk.kt +17 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfView.kt +194 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfDocumentLayout.kt +109 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfFailure.kt +36 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfPageSource.kt +141 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSdkPackage.kt +35 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSourceLoader.kt +117 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSurface.kt +839 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfTileStore.kt +210 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfViewport.kt +255 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/TileGrid.kt +276 -0
- package/ios/HybridPdfDocument.swift +71 -0
- package/ios/HybridPdfSdk.swift +10 -0
- package/ios/HybridPdfView.swift +202 -0
- package/ios/PdfDocumentLayout.swift +174 -0
- package/ios/PdfFailure.swift +46 -0
- package/ios/PdfImageCache.swift +83 -0
- package/ios/PdfPageSource.swift +221 -0
- package/ios/PdfScrollPlan.swift +108 -0
- package/ios/PdfSourceLoader.swift +120 -0
- package/ios/PdfSurface.swift +711 -0
- package/ios/PdfTileCanvas.swift +148 -0
- package/ios/PdfTileGrid.swift +518 -0
- package/ios/PdfTileStore.swift +346 -0
- package/ios/PdfViewport.swift +200 -0
- package/lib/commonjs/PdfView.js +149 -0
- package/lib/commonjs/PdfView.js.map +1 -0
- package/lib/commonjs/document.js +38 -0
- package/lib/commonjs/document.js.map +1 -0
- package/lib/commonjs/index.js +26 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/PdfSdk.nitro.js +6 -0
- package/lib/commonjs/specs/PdfSdk.nitro.js.map +1 -0
- package/lib/commonjs/specs/PdfView.nitro.js +6 -0
- package/lib/commonjs/specs/PdfView.nitro.js.map +1 -0
- package/lib/module/PdfView.js +143 -0
- package/lib/module/PdfView.js.map +1 -0
- package/lib/module/document.js +34 -0
- package/lib/module/document.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/PdfSdk.nitro.js +4 -0
- package/lib/module/specs/PdfSdk.nitro.js.map +1 -0
- package/lib/module/specs/PdfView.nitro.js +4 -0
- package/lib/module/specs/PdfView.nitro.js.map +1 -0
- package/lib/typescript/src/PdfView.d.ts +65 -0
- package/lib/typescript/src/PdfView.d.ts.map +1 -0
- package/lib/typescript/src/document.d.ts +22 -0
- package/lib/typescript/src/document.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/PdfSdk.nitro.d.ts +60 -0
- package/lib/typescript/src/specs/PdfSdk.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/PdfView.nitro.d.ts +131 -0
- package/lib/typescript/src/specs/PdfView.nitro.d.ts.map +1 -0
- package/nitro.json +40 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/PdfSdk+autolinking.cmake +87 -0
- package/nitrogen/generated/android/PdfSdk+autolinking.gradle +27 -0
- package/nitrogen/generated/android/PdfSdkOnLoad.cpp +84 -0
- package/nitrogen/generated/android/PdfSdkOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfErrorEvent.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfLoadEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfPageEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfTapEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfZoomEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.cpp +266 -0
- package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.hpp +92 -0
- package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.cpp +87 -0
- package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JPdfErrorCode.hpp +67 -0
- package/nitrogen/generated/android/c++/JPdfErrorEvent.hpp +63 -0
- package/nitrogen/generated/android/c++/JPdfFit.hpp +64 -0
- package/nitrogen/generated/android/c++/JPdfLoadEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JPdfPageEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/JPdfPageSize.hpp +61 -0
- package/nitrogen/generated/android/c++/JPdfRenderRequest.hpp +86 -0
- package/nitrogen/generated/android/c++/JPdfTapEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JPdfViewSource.hpp +84 -0
- package/nitrogen/generated/android/c++/JPdfZoomEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.cpp +108 -0
- package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfErrorEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfLoadEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfPageEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfTapEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfZoomEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridNativePdfViewSpec.kt +185 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfDocumentSpec.kt +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfSdkSpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorCode.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfFit.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfLoadEvent.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageSize.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfRenderRequest.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfSdkOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfTapEvent.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfViewSource.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfZoomEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/PdfSdk+autolinking.rb +62 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.cpp +123 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.hpp +474 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Umbrella.hpp +88 -0
- package/nitrogen/generated/ios/PdfSdkAutolinking.mm +41 -0
- package/nitrogen/generated/ios/PdfSdkAutolinking.swift +38 -0
- package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.hpp +209 -0
- package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.hpp +105 -0
- package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.hpp +86 -0
- package/nitrogen/generated/ios/c++/views/HybridNativePdfViewComponent.mm +187 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfErrorEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfLoadEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfPageEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfTapEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfZoomEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec.swift +70 -0
- package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec_cxx.swift +438 -0
- package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec_cxx.swift +173 -0
- package/nitrogen/generated/ios/swift/HybridPdfSdkSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridPdfSdkSpec_cxx.swift +148 -0
- package/nitrogen/generated/ios/swift/PdfErrorCode.swift +52 -0
- package/nitrogen/generated/ios/swift/PdfErrorEvent.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfFit.swift +48 -0
- package/nitrogen/generated/ios/swift/PdfLoadEvent.swift +39 -0
- package/nitrogen/generated/ios/swift/PdfPageEvent.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfPageSize.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfRenderRequest.swift +129 -0
- package/nitrogen/generated/ios/swift/PdfTapEvent.swift +39 -0
- package/nitrogen/generated/ios/swift/PdfViewSource.swift +97 -0
- package/nitrogen/generated/ios/swift/PdfZoomEvent.swift +34 -0
- package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.cpp +51 -0
- package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.hpp +112 -0
- package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/PdfErrorCode.hpp +88 -0
- package/nitrogen/generated/shared/c++/PdfErrorEvent.hpp +89 -0
- package/nitrogen/generated/shared/c++/PdfFit.hpp +84 -0
- package/nitrogen/generated/shared/c++/PdfLoadEvent.hpp +91 -0
- package/nitrogen/generated/shared/c++/PdfPageEvent.hpp +87 -0
- package/nitrogen/generated/shared/c++/PdfPageSize.hpp +87 -0
- package/nitrogen/generated/shared/c++/PdfRenderRequest.hpp +112 -0
- package/nitrogen/generated/shared/c++/PdfTapEvent.hpp +91 -0
- package/nitrogen/generated/shared/c++/PdfViewSource.hpp +97 -0
- package/nitrogen/generated/shared/c++/PdfZoomEvent.hpp +87 -0
- package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.cpp +226 -0
- package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.hpp +130 -0
- package/nitrogen/generated/shared/json/NativePdfViewConfig.json +23 -0
- package/package.json +80 -4
- package/react-native.config.js +10 -0
- package/src/PdfView.tsx +221 -0
- package/src/document.ts +34 -0
- package/src/index.ts +16 -0
- package/src/specs/PdfSdk.nitro.ts +60 -0
- package/src/specs/PdfView.nitro.ts +149 -0
package/nitro.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://nitro.margelo.com/nitro.schema.json",
|
|
3
|
+
"cxxNamespace": [
|
|
4
|
+
"pdfsdk"
|
|
5
|
+
],
|
|
6
|
+
"ios": {
|
|
7
|
+
"iosModuleName": "PdfSdk"
|
|
8
|
+
},
|
|
9
|
+
"android": {
|
|
10
|
+
"androidNamespace": [
|
|
11
|
+
"pdfsdk"
|
|
12
|
+
],
|
|
13
|
+
"androidCxxLibName": "PdfSdk"
|
|
14
|
+
},
|
|
15
|
+
"autolinking": {
|
|
16
|
+
"PdfSdk": {
|
|
17
|
+
"ios": {
|
|
18
|
+
"language": "swift",
|
|
19
|
+
"implementationClassName": "HybridPdfSdk"
|
|
20
|
+
},
|
|
21
|
+
"android": {
|
|
22
|
+
"language": "kotlin",
|
|
23
|
+
"implementationClassName": "HybridPdfSdk"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"NativePdfView": {
|
|
27
|
+
"android": {
|
|
28
|
+
"language": "kotlin",
|
|
29
|
+
"implementationClassName": "HybridPdfView"
|
|
30
|
+
},
|
|
31
|
+
"ios": {
|
|
32
|
+
"language": "swift",
|
|
33
|
+
"implementationClassName": "HybridPdfView"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"ignorePaths": [
|
|
38
|
+
"**/node_modules"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
** linguist-generated=true
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#
|
|
2
|
+
# PdfSdk+autolinking.cmake
|
|
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
|
+
# This is a CMake file that adds all files generated by Nitrogen
|
|
9
|
+
# to the current CMake project.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your CMakeLists.txt:
|
|
12
|
+
# ```cmake
|
|
13
|
+
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/PdfSdk+autolinking.cmake)
|
|
14
|
+
# ```
|
|
15
|
+
|
|
16
|
+
# Define a flag to check if we are building properly
|
|
17
|
+
add_definitions(-DBUILDING_PDFSDK_WITH_GENERATED_CMAKE_PROJECT)
|
|
18
|
+
|
|
19
|
+
# Enable Raw Props parsing in react-native (for Nitro Views)
|
|
20
|
+
add_definitions(-DRN_SERIALIZABLE_STATE)
|
|
21
|
+
|
|
22
|
+
# Add all headers that were generated by Nitrogen
|
|
23
|
+
include_directories(
|
|
24
|
+
"../nitrogen/generated/shared/c++"
|
|
25
|
+
"../nitrogen/generated/android/c++"
|
|
26
|
+
"../nitrogen/generated/android/"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Add all .cpp sources that were generated by Nitrogen
|
|
30
|
+
target_sources(
|
|
31
|
+
# CMake project name (Android C++ library name)
|
|
32
|
+
PdfSdk PRIVATE
|
|
33
|
+
# Autolinking Setup
|
|
34
|
+
../nitrogen/generated/android/PdfSdkOnLoad.cpp
|
|
35
|
+
# Shared Nitrogen C++ sources
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridPdfDocumentSpec.cpp
|
|
37
|
+
../nitrogen/generated/shared/c++/HybridPdfSdkSpec.cpp
|
|
38
|
+
../nitrogen/generated/shared/c++/HybridNativePdfViewSpec.cpp
|
|
39
|
+
../nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.cpp
|
|
40
|
+
# Android-specific Nitrogen C++ sources
|
|
41
|
+
../nitrogen/generated/android/c++/JHybridPdfDocumentSpec.cpp
|
|
42
|
+
../nitrogen/generated/android/c++/JHybridPdfSdkSpec.cpp
|
|
43
|
+
../nitrogen/generated/android/c++/JHybridNativePdfViewSpec.cpp
|
|
44
|
+
../nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.cpp
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
48
|
+
# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
|
|
49
|
+
target_compile_definitions(
|
|
50
|
+
PdfSdk PRIVATE
|
|
51
|
+
-DFOLLY_NO_CONFIG=1
|
|
52
|
+
-DFOLLY_HAVE_CLOCK_GETTIME=1
|
|
53
|
+
-DFOLLY_USE_LIBCPP=1
|
|
54
|
+
-DFOLLY_CFG_NO_COROUTINES=1
|
|
55
|
+
-DFOLLY_MOBILE=1
|
|
56
|
+
-DFOLLY_HAVE_RECVMMSG=1
|
|
57
|
+
-DFOLLY_HAVE_PTHREAD=1
|
|
58
|
+
# Once we target android-23 above, we can comment
|
|
59
|
+
# the following line. NDK uses GNU style stderror_r() after API 23.
|
|
60
|
+
-DFOLLY_HAVE_XSI_STRERROR_R=1
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Add all libraries required by the generated specs
|
|
64
|
+
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
|
|
65
|
+
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
|
|
66
|
+
find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
|
|
67
|
+
|
|
68
|
+
# Link all libraries together
|
|
69
|
+
target_link_libraries(
|
|
70
|
+
PdfSdk
|
|
71
|
+
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
|
72
|
+
ReactAndroid::jsi # <-- RN: JSI
|
|
73
|
+
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Link react-native (different prefab between RN 0.75 and RN 0.76)
|
|
77
|
+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
|
78
|
+
target_link_libraries(
|
|
79
|
+
PdfSdk
|
|
80
|
+
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
|
|
81
|
+
)
|
|
82
|
+
else()
|
|
83
|
+
target_link_libraries(
|
|
84
|
+
PdfSdk
|
|
85
|
+
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
|
86
|
+
)
|
|
87
|
+
endif()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdk+autolinking.gradle
|
|
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
|
+
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
9
|
+
/// to the current Gradle project.
|
|
10
|
+
///
|
|
11
|
+
/// To use it, add this to your build.gradle:
|
|
12
|
+
/// ```gradle
|
|
13
|
+
/// apply from: '../nitrogen/generated/android/PdfSdk+autolinking.gradle'
|
|
14
|
+
/// ```
|
|
15
|
+
|
|
16
|
+
logger.warn("[NitroModules] 🔥 PdfSdk is boosted by nitro!")
|
|
17
|
+
|
|
18
|
+
android {
|
|
19
|
+
sourceSets {
|
|
20
|
+
main {
|
|
21
|
+
java.srcDirs += [
|
|
22
|
+
// Nitrogen files
|
|
23
|
+
"${project.projectDir}/../nitrogen/generated/android/kotlin"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdkOnLoad.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
|
+
#ifndef BUILDING_PDFSDK_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
+
#error PdfSdkOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#include "PdfSdkOnLoad.hpp"
|
|
13
|
+
|
|
14
|
+
#include <jni.h>
|
|
15
|
+
#include <fbjni/fbjni.h>
|
|
16
|
+
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
|
+
|
|
18
|
+
#include "JHybridPdfDocumentSpec.hpp"
|
|
19
|
+
#include "JHybridPdfSdkSpec.hpp"
|
|
20
|
+
#include "JHybridNativePdfViewSpec.hpp"
|
|
21
|
+
#include "JFunc_void_PdfLoadEvent.hpp"
|
|
22
|
+
#include "JFunc_void_PdfPageEvent.hpp"
|
|
23
|
+
#include "JFunc_void_PdfZoomEvent.hpp"
|
|
24
|
+
#include "JFunc_void_PdfErrorEvent.hpp"
|
|
25
|
+
#include "JFunc_void_PdfTapEvent.hpp"
|
|
26
|
+
#include "views/JHybridNativePdfViewStateUpdater.hpp"
|
|
27
|
+
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
28
|
+
|
|
29
|
+
namespace margelo::nitro::pdfsdk {
|
|
30
|
+
|
|
31
|
+
int initialize(JavaVM* vm) {
|
|
32
|
+
return facebook::jni::initialize(vm, []() {
|
|
33
|
+
::margelo::nitro::pdfsdk::registerAllNatives();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
struct JHybridPdfSdkSpecImpl: public jni::JavaClass<JHybridPdfSdkSpecImpl, JHybridPdfSdkSpec::JavaPart> {
|
|
38
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/HybridPdfSdk;";
|
|
39
|
+
static std::shared_ptr<JHybridPdfSdkSpec> create() {
|
|
40
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridPdfSdkSpecImpl::javaobject()>();
|
|
41
|
+
jni::local_ref<JHybridPdfSdkSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
42
|
+
return javaPart->getJHybridPdfSdkSpec();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
struct JHybridNativePdfViewSpecImpl: public jni::JavaClass<JHybridNativePdfViewSpecImpl, JHybridNativePdfViewSpec::JavaPart> {
|
|
46
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/HybridPdfView;";
|
|
47
|
+
static std::shared_ptr<JHybridNativePdfViewSpec> create() {
|
|
48
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNativePdfViewSpecImpl::javaobject()>();
|
|
49
|
+
jni::local_ref<JHybridNativePdfViewSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
50
|
+
return javaPart->getJHybridNativePdfViewSpec();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
void registerAllNatives() {
|
|
55
|
+
using namespace margelo::nitro;
|
|
56
|
+
using namespace margelo::nitro::pdfsdk;
|
|
57
|
+
|
|
58
|
+
// Register native JNI methods
|
|
59
|
+
margelo::nitro::pdfsdk::JHybridPdfDocumentSpec::CxxPart::registerNatives();
|
|
60
|
+
margelo::nitro::pdfsdk::JHybridPdfSdkSpec::CxxPart::registerNatives();
|
|
61
|
+
margelo::nitro::pdfsdk::JHybridNativePdfViewSpec::CxxPart::registerNatives();
|
|
62
|
+
margelo::nitro::pdfsdk::JFunc_void_PdfLoadEvent_cxx::registerNatives();
|
|
63
|
+
margelo::nitro::pdfsdk::JFunc_void_PdfPageEvent_cxx::registerNatives();
|
|
64
|
+
margelo::nitro::pdfsdk::JFunc_void_PdfZoomEvent_cxx::registerNatives();
|
|
65
|
+
margelo::nitro::pdfsdk::JFunc_void_PdfErrorEvent_cxx::registerNatives();
|
|
66
|
+
margelo::nitro::pdfsdk::JFunc_void_PdfTapEvent_cxx::registerNatives();
|
|
67
|
+
margelo::nitro::pdfsdk::views::JHybridNativePdfViewStateUpdater::registerNatives();
|
|
68
|
+
|
|
69
|
+
// Register Nitro Hybrid Objects
|
|
70
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
71
|
+
"PdfSdk",
|
|
72
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
73
|
+
return JHybridPdfSdkSpecImpl::create();
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
77
|
+
"NativePdfView",
|
|
78
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
79
|
+
return JHybridNativePdfViewSpecImpl::create();
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro::pdfsdk
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdkOnLoad.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
|
+
#include <jni.h>
|
|
9
|
+
#include <functional>
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::pdfsdk {
|
|
13
|
+
|
|
14
|
+
[[deprecated("Use registerNatives() instead.")]]
|
|
15
|
+
int initialize(JavaVM* vm);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Register the native (C++) part of PdfSdk, and autolinks all Hybrid Objects.
|
|
19
|
+
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
|
|
20
|
+
* inside a `facebook::jni::initialize(vm, ...)` call.
|
|
21
|
+
* Example:
|
|
22
|
+
* ```cpp (cpp-adapter.cpp)
|
|
23
|
+
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
24
|
+
* return facebook::jni::initialize(vm, []() {
|
|
25
|
+
* // register all PdfSdk HybridObjects
|
|
26
|
+
* margelo::nitro::pdfsdk::registerNatives();
|
|
27
|
+
* // any other custom registrations go here.
|
|
28
|
+
* });
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
void registerAllNatives();
|
|
33
|
+
|
|
34
|
+
} // namespace margelo::nitro::pdfsdk
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_PdfErrorEvent.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "PdfErrorEvent.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JPdfErrorEvent.hpp"
|
|
17
|
+
#include "PdfErrorCode.hpp"
|
|
18
|
+
#include "JPdfErrorCode.hpp"
|
|
19
|
+
#include <string>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::pdfsdk {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Represents the Java/Kotlin callback `(event: PdfErrorEvent) -> Unit`.
|
|
27
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
28
|
+
*/
|
|
29
|
+
struct JFunc_void_PdfErrorEvent: public jni::JavaClass<JFunc_void_PdfErrorEvent> {
|
|
30
|
+
public:
|
|
31
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfErrorEvent;";
|
|
32
|
+
|
|
33
|
+
public:
|
|
34
|
+
/**
|
|
35
|
+
* Invokes the function this `JFunc_void_PdfErrorEvent` instance holds through JNI.
|
|
36
|
+
*/
|
|
37
|
+
void invoke(const PdfErrorEvent& event) const {
|
|
38
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JPdfErrorEvent> /* event */)>("invoke");
|
|
39
|
+
method(self(), JPdfErrorEvent::fromCpp(event));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An implementation of Func_void_PdfErrorEvent that is backed by a C++ implementation (using `std::function<...>`)
|
|
45
|
+
*/
|
|
46
|
+
class JFunc_void_PdfErrorEvent_cxx final: public jni::HybridClass<JFunc_void_PdfErrorEvent_cxx, JFunc_void_PdfErrorEvent> {
|
|
47
|
+
public:
|
|
48
|
+
static jni::local_ref<JFunc_void_PdfErrorEvent::javaobject> fromCpp(const std::function<void(const PdfErrorEvent& /* event */)>& func) {
|
|
49
|
+
return JFunc_void_PdfErrorEvent_cxx::newObjectCxxArgs(func);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
/**
|
|
54
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_PdfErrorEvent_cxx` instance holds.
|
|
55
|
+
*/
|
|
56
|
+
void invoke_cxx(jni::alias_ref<JPdfErrorEvent> event) {
|
|
57
|
+
_func(event->toCpp());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
[[nodiscard]]
|
|
62
|
+
inline const std::function<void(const PdfErrorEvent& /* event */)>& getFunction() const {
|
|
63
|
+
return _func;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfErrorEvent_cxx;";
|
|
68
|
+
static void registerNatives() {
|
|
69
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_PdfErrorEvent_cxx::invoke_cxx)});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
explicit JFunc_void_PdfErrorEvent_cxx(const std::function<void(const PdfErrorEvent& /* event */)>& func): _func(func) { }
|
|
74
|
+
|
|
75
|
+
private:
|
|
76
|
+
friend HybridBase;
|
|
77
|
+
std::function<void(const PdfErrorEvent& /* event */)> _func;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro::pdfsdk
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_PdfLoadEvent.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "PdfLoadEvent.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JPdfLoadEvent.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::pdfsdk {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(event: PdfLoadEvent) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_PdfLoadEvent: public jni::JavaClass<JFunc_void_PdfLoadEvent> {
|
|
27
|
+
public:
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfLoadEvent;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_PdfLoadEvent` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(const PdfLoadEvent& event) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JPdfLoadEvent> /* event */)>("invoke");
|
|
36
|
+
method(self(), JPdfLoadEvent::fromCpp(event));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_PdfLoadEvent that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_PdfLoadEvent_cxx final: public jni::HybridClass<JFunc_void_PdfLoadEvent_cxx, JFunc_void_PdfLoadEvent> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_PdfLoadEvent::javaobject> fromCpp(const std::function<void(const PdfLoadEvent& /* event */)>& func) {
|
|
46
|
+
return JFunc_void_PdfLoadEvent_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_PdfLoadEvent_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JPdfLoadEvent> event) {
|
|
54
|
+
_func(event->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(const PdfLoadEvent& /* event */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfLoadEvent_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_PdfLoadEvent_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_PdfLoadEvent_cxx(const std::function<void(const PdfLoadEvent& /* event */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(const PdfLoadEvent& /* event */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::pdfsdk
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_PdfPageEvent.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "PdfPageEvent.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JPdfPageEvent.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::pdfsdk {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(event: PdfPageEvent) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_PdfPageEvent: public jni::JavaClass<JFunc_void_PdfPageEvent> {
|
|
27
|
+
public:
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfPageEvent;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_PdfPageEvent` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(const PdfPageEvent& event) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JPdfPageEvent> /* event */)>("invoke");
|
|
36
|
+
method(self(), JPdfPageEvent::fromCpp(event));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_PdfPageEvent that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_PdfPageEvent_cxx final: public jni::HybridClass<JFunc_void_PdfPageEvent_cxx, JFunc_void_PdfPageEvent> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_PdfPageEvent::javaobject> fromCpp(const std::function<void(const PdfPageEvent& /* event */)>& func) {
|
|
46
|
+
return JFunc_void_PdfPageEvent_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_PdfPageEvent_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JPdfPageEvent> event) {
|
|
54
|
+
_func(event->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(const PdfPageEvent& /* event */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfPageEvent_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_PdfPageEvent_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_PdfPageEvent_cxx(const std::function<void(const PdfPageEvent& /* event */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(const PdfPageEvent& /* event */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::pdfsdk
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_PdfTapEvent.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "PdfTapEvent.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JPdfTapEvent.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::pdfsdk {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(event: PdfTapEvent) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_PdfTapEvent: public jni::JavaClass<JFunc_void_PdfTapEvent> {
|
|
27
|
+
public:
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfTapEvent;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_PdfTapEvent` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(const PdfTapEvent& event) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JPdfTapEvent> /* event */)>("invoke");
|
|
36
|
+
method(self(), JPdfTapEvent::fromCpp(event));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_PdfTapEvent that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_PdfTapEvent_cxx final: public jni::HybridClass<JFunc_void_PdfTapEvent_cxx, JFunc_void_PdfTapEvent> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_PdfTapEvent::javaobject> fromCpp(const std::function<void(const PdfTapEvent& /* event */)>& func) {
|
|
46
|
+
return JFunc_void_PdfTapEvent_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_PdfTapEvent_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JPdfTapEvent> event) {
|
|
54
|
+
_func(event->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(const PdfTapEvent& /* event */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfTapEvent_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_PdfTapEvent_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_PdfTapEvent_cxx(const std::function<void(const PdfTapEvent& /* event */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(const PdfTapEvent& /* event */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::pdfsdk
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_PdfZoomEvent.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "PdfZoomEvent.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JPdfZoomEvent.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::pdfsdk {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(event: PdfZoomEvent) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_PdfZoomEvent: public jni::JavaClass<JFunc_void_PdfZoomEvent> {
|
|
27
|
+
public:
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfZoomEvent;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_PdfZoomEvent` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(const PdfZoomEvent& event) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JPdfZoomEvent> /* event */)>("invoke");
|
|
36
|
+
method(self(), JPdfZoomEvent::fromCpp(event));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_PdfZoomEvent that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_PdfZoomEvent_cxx final: public jni::HybridClass<JFunc_void_PdfZoomEvent_cxx, JFunc_void_PdfZoomEvent> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_PdfZoomEvent::javaobject> fromCpp(const std::function<void(const PdfZoomEvent& /* event */)>& func) {
|
|
46
|
+
return JFunc_void_PdfZoomEvent_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_PdfZoomEvent_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JPdfZoomEvent> event) {
|
|
54
|
+
_func(event->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(const PdfZoomEvent& /* event */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/Func_void_PdfZoomEvent_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_PdfZoomEvent_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_PdfZoomEvent_cxx(const std::function<void(const PdfZoomEvent& /* event */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(const PdfZoomEvent& /* event */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::pdfsdk
|