@thatkid02/react-native-pdf-viewer 0.0.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/LICENSE +20 -0
- package/PdfViewer.podspec +28 -0
- package/README.md +290 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +121 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/pdfviewer/HybridPdfViewer.kt +169 -0
- package/android/src/main/java/com/margelo/nitro/pdfviewer/PdfViewer.kt +996 -0
- package/android/src/main/java/com/margelo/nitro/pdfviewer/PdfViewerPackage.kt +26 -0
- package/ios/PdfViewer.swift +696 -0
- package/lib/module/PdfViewer.nitro.js +4 -0
- package/lib/module/PdfViewer.nitro.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/PdfViewer.nitro.d.ts +67 -0
- package/lib/typescript/src/PdfViewer.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +8 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/c++/JErrorEvent.hpp +57 -0
- package/nitrogen/generated/android/c++/JFunc_void_ErrorEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_LoadCompleteEvent.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_LoadingChangeEvent.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_PageChangeEvent.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_ScaleChangeEvent.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_ThumbnailGeneratedEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridPdfViewerSpec.cpp +273 -0
- package/nitrogen/generated/android/c++/JHybridPdfViewerSpec.hpp +94 -0
- package/nitrogen/generated/android/c++/JLoadCompleteEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/JLoadingChangeEvent.hpp +53 -0
- package/nitrogen/generated/android/c++/JPageChangeEvent.hpp +57 -0
- package/nitrogen/generated/android/c++/JScaleChangeEvent.hpp +53 -0
- package/nitrogen/generated/android/c++/JThumbnailGeneratedEvent.hpp +57 -0
- package/nitrogen/generated/android/c++/views/JHybridPdfViewerStateUpdater.cpp +108 -0
- package/nitrogen/generated/android/c++/views/JHybridPdfViewerStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/ErrorEvent.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_ErrorEvent.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_LoadCompleteEvent.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_LoadingChangeEvent.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_PageChangeEvent.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_ScaleChangeEvent.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_ThumbnailGeneratedEvent.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/HybridPdfViewerSpec.kt +195 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/LoadCompleteEvent.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/LoadingChangeEvent.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/PageChangeEvent.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/ScaleChangeEvent.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/ThumbnailGeneratedEvent.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/pdfviewerOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/views/HybridPdfViewerManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/views/HybridPdfViewerStateUpdater.kt +23 -0
- package/nitrogen/generated/android/pdfviewer+autolinking.cmake +83 -0
- package/nitrogen/generated/android/pdfviewer+autolinking.gradle +27 -0
- package/nitrogen/generated/android/pdfviewerOnLoad.cpp +58 -0
- package/nitrogen/generated/android/pdfviewerOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/PdfViewer+autolinking.rb +60 -0
- package/nitrogen/generated/ios/PdfViewer-Swift-Cxx-Bridge.cpp +80 -0
- package/nitrogen/generated/ios/PdfViewer-Swift-Cxx-Bridge.hpp +339 -0
- package/nitrogen/generated/ios/PdfViewer-Swift-Cxx-Umbrella.hpp +64 -0
- package/nitrogen/generated/ios/PdfViewerAutolinking.mm +33 -0
- package/nitrogen/generated/ios/PdfViewerAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridPdfViewerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfViewerSpecSwift.hpp +205 -0
- package/nitrogen/generated/ios/c++/views/HybridPdfViewerComponent.mm +161 -0
- package/nitrogen/generated/ios/swift/ErrorEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_ErrorEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_LoadCompleteEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_LoadingChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_PageChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_ScaleChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_ThumbnailGeneratedEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridPdfViewerSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridPdfViewerSpec_cxx.swift +500 -0
- package/nitrogen/generated/ios/swift/LoadCompleteEvent.swift +57 -0
- package/nitrogen/generated/ios/swift/LoadingChangeEvent.swift +35 -0
- package/nitrogen/generated/ios/swift/PageChangeEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/ScaleChangeEvent.swift +35 -0
- package/nitrogen/generated/ios/swift/ThumbnailGeneratedEvent.swift +46 -0
- package/nitrogen/generated/shared/c++/ErrorEvent.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridPdfViewerSpec.cpp +52 -0
- package/nitrogen/generated/shared/c++/HybridPdfViewerSpec.hpp +111 -0
- package/nitrogen/generated/shared/c++/LoadCompleteEvent.hpp +75 -0
- package/nitrogen/generated/shared/c++/LoadingChangeEvent.hpp +67 -0
- package/nitrogen/generated/shared/c++/PageChangeEvent.hpp +71 -0
- package/nitrogen/generated/shared/c++/ScaleChangeEvent.hpp +67 -0
- package/nitrogen/generated/shared/c++/ThumbnailGeneratedEvent.hpp +71 -0
- package/nitrogen/generated/shared/c++/views/HybridPdfViewerComponent.cpp +243 -0
- package/nitrogen/generated/shared/c++/views/HybridPdfViewerComponent.hpp +127 -0
- package/nitrogen/generated/shared/json/PdfViewerConfig.json +23 -0
- package/package.json +175 -0
- package/src/PdfViewer.nitro.ts +97 -0
- package/src/index.tsx +27 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# PdfViewer+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/PdfViewer+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 PdfViewer is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/PdfViewer-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only C)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfViewer-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "PdfViewer-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridPdfViewerSpecSwift.hpp"
|
|
12
|
+
#include "PdfViewer-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro::pdfviewer::bridge::swift {
|
|
15
|
+
|
|
16
|
+
// pragma MARK: std::function<void(const LoadCompleteEvent& /* event */)>
|
|
17
|
+
Func_void_LoadCompleteEvent create_Func_void_LoadCompleteEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
18
|
+
auto swiftClosure = PdfViewer::Func_void_LoadCompleteEvent::fromUnsafe(swiftClosureWrapper);
|
|
19
|
+
return [swiftClosure = std::move(swiftClosure)](const LoadCompleteEvent& event) mutable -> void {
|
|
20
|
+
swiftClosure.call(event);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// pragma MARK: std::function<void(const PageChangeEvent& /* event */)>
|
|
25
|
+
Func_void_PageChangeEvent create_Func_void_PageChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
26
|
+
auto swiftClosure = PdfViewer::Func_void_PageChangeEvent::fromUnsafe(swiftClosureWrapper);
|
|
27
|
+
return [swiftClosure = std::move(swiftClosure)](const PageChangeEvent& event) mutable -> void {
|
|
28
|
+
swiftClosure.call(event);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// pragma MARK: std::function<void(const ScaleChangeEvent& /* event */)>
|
|
33
|
+
Func_void_ScaleChangeEvent create_Func_void_ScaleChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
34
|
+
auto swiftClosure = PdfViewer::Func_void_ScaleChangeEvent::fromUnsafe(swiftClosureWrapper);
|
|
35
|
+
return [swiftClosure = std::move(swiftClosure)](const ScaleChangeEvent& event) mutable -> void {
|
|
36
|
+
swiftClosure.call(event);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// pragma MARK: std::function<void(const ErrorEvent& /* event */)>
|
|
41
|
+
Func_void_ErrorEvent create_Func_void_ErrorEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
42
|
+
auto swiftClosure = PdfViewer::Func_void_ErrorEvent::fromUnsafe(swiftClosureWrapper);
|
|
43
|
+
return [swiftClosure = std::move(swiftClosure)](const ErrorEvent& event) mutable -> void {
|
|
44
|
+
swiftClosure.call(event);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// pragma MARK: std::function<void(const ThumbnailGeneratedEvent& /* event */)>
|
|
49
|
+
Func_void_ThumbnailGeneratedEvent create_Func_void_ThumbnailGeneratedEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
50
|
+
auto swiftClosure = PdfViewer::Func_void_ThumbnailGeneratedEvent::fromUnsafe(swiftClosureWrapper);
|
|
51
|
+
return [swiftClosure = std::move(swiftClosure)](const ThumbnailGeneratedEvent& event) mutable -> void {
|
|
52
|
+
swiftClosure.call(event);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// pragma MARK: std::function<void(const LoadingChangeEvent& /* event */)>
|
|
57
|
+
Func_void_LoadingChangeEvent create_Func_void_LoadingChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
58
|
+
auto swiftClosure = PdfViewer::Func_void_LoadingChangeEvent::fromUnsafe(swiftClosureWrapper);
|
|
59
|
+
return [swiftClosure = std::move(swiftClosure)](const LoadingChangeEvent& event) mutable -> void {
|
|
60
|
+
swiftClosure.call(event);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// pragma MARK: std::shared_ptr<HybridPdfViewerSpec>
|
|
65
|
+
std::shared_ptr<HybridPdfViewerSpec> create_std__shared_ptr_HybridPdfViewerSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
66
|
+
PdfViewer::HybridPdfViewerSpec_cxx swiftPart = PdfViewer::HybridPdfViewerSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
67
|
+
return std::make_shared<margelo::nitro::pdfviewer::HybridPdfViewerSpecSwift>(swiftPart);
|
|
68
|
+
}
|
|
69
|
+
void* NON_NULL get_std__shared_ptr_HybridPdfViewerSpec_(std__shared_ptr_HybridPdfViewerSpec_ cppType) noexcept {
|
|
70
|
+
std::shared_ptr<margelo::nitro::pdfviewer::HybridPdfViewerSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::pdfviewer::HybridPdfViewerSpecSwift>(cppType);
|
|
71
|
+
#ifdef NITRO_DEBUG
|
|
72
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
73
|
+
throw std::runtime_error("Class \"HybridPdfViewerSpec\" is not implemented in Swift!");
|
|
74
|
+
}
|
|
75
|
+
#endif
|
|
76
|
+
PdfViewer::HybridPdfViewerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
77
|
+
return swiftPart.toUnsafe();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro::pdfviewer::bridge::swift
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfViewer-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ErrorEvent` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::pdfviewer { struct ErrorEvent; }
|
|
13
|
+
// Forward declaration of `HybridPdfViewerSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::pdfviewer { class HybridPdfViewerSpec; }
|
|
15
|
+
// Forward declaration of `LoadCompleteEvent` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::pdfviewer { struct LoadCompleteEvent; }
|
|
17
|
+
// Forward declaration of `LoadingChangeEvent` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::pdfviewer { struct LoadingChangeEvent; }
|
|
19
|
+
// Forward declaration of `PageChangeEvent` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::pdfviewer { struct PageChangeEvent; }
|
|
21
|
+
// Forward declaration of `ScaleChangeEvent` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::pdfviewer { struct ScaleChangeEvent; }
|
|
23
|
+
// Forward declaration of `ThumbnailGeneratedEvent` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::pdfviewer { struct ThumbnailGeneratedEvent; }
|
|
25
|
+
|
|
26
|
+
// Forward declarations of Swift defined types
|
|
27
|
+
// Forward declaration of `HybridPdfViewerSpec_cxx` to properly resolve imports.
|
|
28
|
+
namespace PdfViewer { class HybridPdfViewerSpec_cxx; }
|
|
29
|
+
|
|
30
|
+
// Include C++ defined types
|
|
31
|
+
#include "ErrorEvent.hpp"
|
|
32
|
+
#include "HybridPdfViewerSpec.hpp"
|
|
33
|
+
#include "LoadCompleteEvent.hpp"
|
|
34
|
+
#include "LoadingChangeEvent.hpp"
|
|
35
|
+
#include "PageChangeEvent.hpp"
|
|
36
|
+
#include "ScaleChangeEvent.hpp"
|
|
37
|
+
#include "ThumbnailGeneratedEvent.hpp"
|
|
38
|
+
#include <NitroModules/Result.hpp>
|
|
39
|
+
#include <exception>
|
|
40
|
+
#include <functional>
|
|
41
|
+
#include <memory>
|
|
42
|
+
#include <optional>
|
|
43
|
+
#include <string>
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
47
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
48
|
+
*/
|
|
49
|
+
namespace margelo::nitro::pdfviewer::bridge::swift {
|
|
50
|
+
|
|
51
|
+
// pragma MARK: std::optional<std::string>
|
|
52
|
+
/**
|
|
53
|
+
* Specialized version of `std::optional<std::string>`.
|
|
54
|
+
*/
|
|
55
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
56
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
57
|
+
return std::optional<std::string>(value);
|
|
58
|
+
}
|
|
59
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
60
|
+
return optional.has_value();
|
|
61
|
+
}
|
|
62
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
63
|
+
return *optional;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// pragma MARK: std::optional<bool>
|
|
67
|
+
/**
|
|
68
|
+
* Specialized version of `std::optional<bool>`.
|
|
69
|
+
*/
|
|
70
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
71
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
72
|
+
return std::optional<bool>(value);
|
|
73
|
+
}
|
|
74
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
75
|
+
return optional.has_value();
|
|
76
|
+
}
|
|
77
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
78
|
+
return *optional;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// pragma MARK: std::optional<double>
|
|
82
|
+
/**
|
|
83
|
+
* Specialized version of `std::optional<double>`.
|
|
84
|
+
*/
|
|
85
|
+
using std__optional_double_ = std::optional<double>;
|
|
86
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
87
|
+
return std::optional<double>(value);
|
|
88
|
+
}
|
|
89
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
90
|
+
return optional.has_value();
|
|
91
|
+
}
|
|
92
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
93
|
+
return *optional;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// pragma MARK: std::function<void(const LoadCompleteEvent& /* event */)>
|
|
97
|
+
/**
|
|
98
|
+
* Specialized version of `std::function<void(const LoadCompleteEvent&)>`.
|
|
99
|
+
*/
|
|
100
|
+
using Func_void_LoadCompleteEvent = std::function<void(const LoadCompleteEvent& /* event */)>;
|
|
101
|
+
/**
|
|
102
|
+
* Wrapper class for a `std::function<void(const LoadCompleteEvent& / * event * /)>`, this can be used from Swift.
|
|
103
|
+
*/
|
|
104
|
+
class Func_void_LoadCompleteEvent_Wrapper final {
|
|
105
|
+
public:
|
|
106
|
+
explicit Func_void_LoadCompleteEvent_Wrapper(std::function<void(const LoadCompleteEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const LoadCompleteEvent& /* event */)>>(std::move(func))) {}
|
|
107
|
+
inline void call(LoadCompleteEvent event) const noexcept {
|
|
108
|
+
_function->operator()(event);
|
|
109
|
+
}
|
|
110
|
+
private:
|
|
111
|
+
std::unique_ptr<std::function<void(const LoadCompleteEvent& /* event */)>> _function;
|
|
112
|
+
} SWIFT_NONCOPYABLE;
|
|
113
|
+
Func_void_LoadCompleteEvent create_Func_void_LoadCompleteEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
114
|
+
inline Func_void_LoadCompleteEvent_Wrapper wrap_Func_void_LoadCompleteEvent(Func_void_LoadCompleteEvent value) noexcept {
|
|
115
|
+
return Func_void_LoadCompleteEvent_Wrapper(std::move(value));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// pragma MARK: std::optional<std::function<void(const LoadCompleteEvent& /* event */)>>
|
|
119
|
+
/**
|
|
120
|
+
* Specialized version of `std::optional<std::function<void(const LoadCompleteEvent& / * event * /)>>`.
|
|
121
|
+
*/
|
|
122
|
+
using std__optional_std__function_void_const_LoadCompleteEvent_____event______ = std::optional<std::function<void(const LoadCompleteEvent& /* event */)>>;
|
|
123
|
+
inline std::optional<std::function<void(const LoadCompleteEvent& /* event */)>> create_std__optional_std__function_void_const_LoadCompleteEvent_____event______(const std::function<void(const LoadCompleteEvent& /* event */)>& value) noexcept {
|
|
124
|
+
return std::optional<std::function<void(const LoadCompleteEvent& /* event */)>>(value);
|
|
125
|
+
}
|
|
126
|
+
inline bool has_value_std__optional_std__function_void_const_LoadCompleteEvent_____event______(const std::optional<std::function<void(const LoadCompleteEvent& /* event */)>>& optional) noexcept {
|
|
127
|
+
return optional.has_value();
|
|
128
|
+
}
|
|
129
|
+
inline std::function<void(const LoadCompleteEvent& /* event */)> get_std__optional_std__function_void_const_LoadCompleteEvent_____event______(const std::optional<std::function<void(const LoadCompleteEvent& /* event */)>>& optional) noexcept {
|
|
130
|
+
return *optional;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// pragma MARK: std::function<void(const PageChangeEvent& /* event */)>
|
|
134
|
+
/**
|
|
135
|
+
* Specialized version of `std::function<void(const PageChangeEvent&)>`.
|
|
136
|
+
*/
|
|
137
|
+
using Func_void_PageChangeEvent = std::function<void(const PageChangeEvent& /* event */)>;
|
|
138
|
+
/**
|
|
139
|
+
* Wrapper class for a `std::function<void(const PageChangeEvent& / * event * /)>`, this can be used from Swift.
|
|
140
|
+
*/
|
|
141
|
+
class Func_void_PageChangeEvent_Wrapper final {
|
|
142
|
+
public:
|
|
143
|
+
explicit Func_void_PageChangeEvent_Wrapper(std::function<void(const PageChangeEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const PageChangeEvent& /* event */)>>(std::move(func))) {}
|
|
144
|
+
inline void call(PageChangeEvent event) const noexcept {
|
|
145
|
+
_function->operator()(event);
|
|
146
|
+
}
|
|
147
|
+
private:
|
|
148
|
+
std::unique_ptr<std::function<void(const PageChangeEvent& /* event */)>> _function;
|
|
149
|
+
} SWIFT_NONCOPYABLE;
|
|
150
|
+
Func_void_PageChangeEvent create_Func_void_PageChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
151
|
+
inline Func_void_PageChangeEvent_Wrapper wrap_Func_void_PageChangeEvent(Func_void_PageChangeEvent value) noexcept {
|
|
152
|
+
return Func_void_PageChangeEvent_Wrapper(std::move(value));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// pragma MARK: std::optional<std::function<void(const PageChangeEvent& /* event */)>>
|
|
156
|
+
/**
|
|
157
|
+
* Specialized version of `std::optional<std::function<void(const PageChangeEvent& / * event * /)>>`.
|
|
158
|
+
*/
|
|
159
|
+
using std__optional_std__function_void_const_PageChangeEvent_____event______ = std::optional<std::function<void(const PageChangeEvent& /* event */)>>;
|
|
160
|
+
inline std::optional<std::function<void(const PageChangeEvent& /* event */)>> create_std__optional_std__function_void_const_PageChangeEvent_____event______(const std::function<void(const PageChangeEvent& /* event */)>& value) noexcept {
|
|
161
|
+
return std::optional<std::function<void(const PageChangeEvent& /* event */)>>(value);
|
|
162
|
+
}
|
|
163
|
+
inline bool has_value_std__optional_std__function_void_const_PageChangeEvent_____event______(const std::optional<std::function<void(const PageChangeEvent& /* event */)>>& optional) noexcept {
|
|
164
|
+
return optional.has_value();
|
|
165
|
+
}
|
|
166
|
+
inline std::function<void(const PageChangeEvent& /* event */)> get_std__optional_std__function_void_const_PageChangeEvent_____event______(const std::optional<std::function<void(const PageChangeEvent& /* event */)>>& optional) noexcept {
|
|
167
|
+
return *optional;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// pragma MARK: std::function<void(const ScaleChangeEvent& /* event */)>
|
|
171
|
+
/**
|
|
172
|
+
* Specialized version of `std::function<void(const ScaleChangeEvent&)>`.
|
|
173
|
+
*/
|
|
174
|
+
using Func_void_ScaleChangeEvent = std::function<void(const ScaleChangeEvent& /* event */)>;
|
|
175
|
+
/**
|
|
176
|
+
* Wrapper class for a `std::function<void(const ScaleChangeEvent& / * event * /)>`, this can be used from Swift.
|
|
177
|
+
*/
|
|
178
|
+
class Func_void_ScaleChangeEvent_Wrapper final {
|
|
179
|
+
public:
|
|
180
|
+
explicit Func_void_ScaleChangeEvent_Wrapper(std::function<void(const ScaleChangeEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const ScaleChangeEvent& /* event */)>>(std::move(func))) {}
|
|
181
|
+
inline void call(ScaleChangeEvent event) const noexcept {
|
|
182
|
+
_function->operator()(event);
|
|
183
|
+
}
|
|
184
|
+
private:
|
|
185
|
+
std::unique_ptr<std::function<void(const ScaleChangeEvent& /* event */)>> _function;
|
|
186
|
+
} SWIFT_NONCOPYABLE;
|
|
187
|
+
Func_void_ScaleChangeEvent create_Func_void_ScaleChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
188
|
+
inline Func_void_ScaleChangeEvent_Wrapper wrap_Func_void_ScaleChangeEvent(Func_void_ScaleChangeEvent value) noexcept {
|
|
189
|
+
return Func_void_ScaleChangeEvent_Wrapper(std::move(value));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// pragma MARK: std::optional<std::function<void(const ScaleChangeEvent& /* event */)>>
|
|
193
|
+
/**
|
|
194
|
+
* Specialized version of `std::optional<std::function<void(const ScaleChangeEvent& / * event * /)>>`.
|
|
195
|
+
*/
|
|
196
|
+
using std__optional_std__function_void_const_ScaleChangeEvent_____event______ = std::optional<std::function<void(const ScaleChangeEvent& /* event */)>>;
|
|
197
|
+
inline std::optional<std::function<void(const ScaleChangeEvent& /* event */)>> create_std__optional_std__function_void_const_ScaleChangeEvent_____event______(const std::function<void(const ScaleChangeEvent& /* event */)>& value) noexcept {
|
|
198
|
+
return std::optional<std::function<void(const ScaleChangeEvent& /* event */)>>(value);
|
|
199
|
+
}
|
|
200
|
+
inline bool has_value_std__optional_std__function_void_const_ScaleChangeEvent_____event______(const std::optional<std::function<void(const ScaleChangeEvent& /* event */)>>& optional) noexcept {
|
|
201
|
+
return optional.has_value();
|
|
202
|
+
}
|
|
203
|
+
inline std::function<void(const ScaleChangeEvent& /* event */)> get_std__optional_std__function_void_const_ScaleChangeEvent_____event______(const std::optional<std::function<void(const ScaleChangeEvent& /* event */)>>& optional) noexcept {
|
|
204
|
+
return *optional;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// pragma MARK: std::function<void(const ErrorEvent& /* event */)>
|
|
208
|
+
/**
|
|
209
|
+
* Specialized version of `std::function<void(const ErrorEvent&)>`.
|
|
210
|
+
*/
|
|
211
|
+
using Func_void_ErrorEvent = std::function<void(const ErrorEvent& /* event */)>;
|
|
212
|
+
/**
|
|
213
|
+
* Wrapper class for a `std::function<void(const ErrorEvent& / * event * /)>`, this can be used from Swift.
|
|
214
|
+
*/
|
|
215
|
+
class Func_void_ErrorEvent_Wrapper final {
|
|
216
|
+
public:
|
|
217
|
+
explicit Func_void_ErrorEvent_Wrapper(std::function<void(const ErrorEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const ErrorEvent& /* event */)>>(std::move(func))) {}
|
|
218
|
+
inline void call(ErrorEvent event) const noexcept {
|
|
219
|
+
_function->operator()(event);
|
|
220
|
+
}
|
|
221
|
+
private:
|
|
222
|
+
std::unique_ptr<std::function<void(const ErrorEvent& /* event */)>> _function;
|
|
223
|
+
} SWIFT_NONCOPYABLE;
|
|
224
|
+
Func_void_ErrorEvent create_Func_void_ErrorEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
225
|
+
inline Func_void_ErrorEvent_Wrapper wrap_Func_void_ErrorEvent(Func_void_ErrorEvent value) noexcept {
|
|
226
|
+
return Func_void_ErrorEvent_Wrapper(std::move(value));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// pragma MARK: std::optional<std::function<void(const ErrorEvent& /* event */)>>
|
|
230
|
+
/**
|
|
231
|
+
* Specialized version of `std::optional<std::function<void(const ErrorEvent& / * event * /)>>`.
|
|
232
|
+
*/
|
|
233
|
+
using std__optional_std__function_void_const_ErrorEvent_____event______ = std::optional<std::function<void(const ErrorEvent& /* event */)>>;
|
|
234
|
+
inline std::optional<std::function<void(const ErrorEvent& /* event */)>> create_std__optional_std__function_void_const_ErrorEvent_____event______(const std::function<void(const ErrorEvent& /* event */)>& value) noexcept {
|
|
235
|
+
return std::optional<std::function<void(const ErrorEvent& /* event */)>>(value);
|
|
236
|
+
}
|
|
237
|
+
inline bool has_value_std__optional_std__function_void_const_ErrorEvent_____event______(const std::optional<std::function<void(const ErrorEvent& /* event */)>>& optional) noexcept {
|
|
238
|
+
return optional.has_value();
|
|
239
|
+
}
|
|
240
|
+
inline std::function<void(const ErrorEvent& /* event */)> get_std__optional_std__function_void_const_ErrorEvent_____event______(const std::optional<std::function<void(const ErrorEvent& /* event */)>>& optional) noexcept {
|
|
241
|
+
return *optional;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// pragma MARK: std::function<void(const ThumbnailGeneratedEvent& /* event */)>
|
|
245
|
+
/**
|
|
246
|
+
* Specialized version of `std::function<void(const ThumbnailGeneratedEvent&)>`.
|
|
247
|
+
*/
|
|
248
|
+
using Func_void_ThumbnailGeneratedEvent = std::function<void(const ThumbnailGeneratedEvent& /* event */)>;
|
|
249
|
+
/**
|
|
250
|
+
* Wrapper class for a `std::function<void(const ThumbnailGeneratedEvent& / * event * /)>`, this can be used from Swift.
|
|
251
|
+
*/
|
|
252
|
+
class Func_void_ThumbnailGeneratedEvent_Wrapper final {
|
|
253
|
+
public:
|
|
254
|
+
explicit Func_void_ThumbnailGeneratedEvent_Wrapper(std::function<void(const ThumbnailGeneratedEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const ThumbnailGeneratedEvent& /* event */)>>(std::move(func))) {}
|
|
255
|
+
inline void call(ThumbnailGeneratedEvent event) const noexcept {
|
|
256
|
+
_function->operator()(event);
|
|
257
|
+
}
|
|
258
|
+
private:
|
|
259
|
+
std::unique_ptr<std::function<void(const ThumbnailGeneratedEvent& /* event */)>> _function;
|
|
260
|
+
} SWIFT_NONCOPYABLE;
|
|
261
|
+
Func_void_ThumbnailGeneratedEvent create_Func_void_ThumbnailGeneratedEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
262
|
+
inline Func_void_ThumbnailGeneratedEvent_Wrapper wrap_Func_void_ThumbnailGeneratedEvent(Func_void_ThumbnailGeneratedEvent value) noexcept {
|
|
263
|
+
return Func_void_ThumbnailGeneratedEvent_Wrapper(std::move(value));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// pragma MARK: std::optional<std::function<void(const ThumbnailGeneratedEvent& /* event */)>>
|
|
267
|
+
/**
|
|
268
|
+
* Specialized version of `std::optional<std::function<void(const ThumbnailGeneratedEvent& / * event * /)>>`.
|
|
269
|
+
*/
|
|
270
|
+
using std__optional_std__function_void_const_ThumbnailGeneratedEvent_____event______ = std::optional<std::function<void(const ThumbnailGeneratedEvent& /* event */)>>;
|
|
271
|
+
inline std::optional<std::function<void(const ThumbnailGeneratedEvent& /* event */)>> create_std__optional_std__function_void_const_ThumbnailGeneratedEvent_____event______(const std::function<void(const ThumbnailGeneratedEvent& /* event */)>& value) noexcept {
|
|
272
|
+
return std::optional<std::function<void(const ThumbnailGeneratedEvent& /* event */)>>(value);
|
|
273
|
+
}
|
|
274
|
+
inline bool has_value_std__optional_std__function_void_const_ThumbnailGeneratedEvent_____event______(const std::optional<std::function<void(const ThumbnailGeneratedEvent& /* event */)>>& optional) noexcept {
|
|
275
|
+
return optional.has_value();
|
|
276
|
+
}
|
|
277
|
+
inline std::function<void(const ThumbnailGeneratedEvent& /* event */)> get_std__optional_std__function_void_const_ThumbnailGeneratedEvent_____event______(const std::optional<std::function<void(const ThumbnailGeneratedEvent& /* event */)>>& optional) noexcept {
|
|
278
|
+
return *optional;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// pragma MARK: std::function<void(const LoadingChangeEvent& /* event */)>
|
|
282
|
+
/**
|
|
283
|
+
* Specialized version of `std::function<void(const LoadingChangeEvent&)>`.
|
|
284
|
+
*/
|
|
285
|
+
using Func_void_LoadingChangeEvent = std::function<void(const LoadingChangeEvent& /* event */)>;
|
|
286
|
+
/**
|
|
287
|
+
* Wrapper class for a `std::function<void(const LoadingChangeEvent& / * event * /)>`, this can be used from Swift.
|
|
288
|
+
*/
|
|
289
|
+
class Func_void_LoadingChangeEvent_Wrapper final {
|
|
290
|
+
public:
|
|
291
|
+
explicit Func_void_LoadingChangeEvent_Wrapper(std::function<void(const LoadingChangeEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const LoadingChangeEvent& /* event */)>>(std::move(func))) {}
|
|
292
|
+
inline void call(LoadingChangeEvent event) const noexcept {
|
|
293
|
+
_function->operator()(event);
|
|
294
|
+
}
|
|
295
|
+
private:
|
|
296
|
+
std::unique_ptr<std::function<void(const LoadingChangeEvent& /* event */)>> _function;
|
|
297
|
+
} SWIFT_NONCOPYABLE;
|
|
298
|
+
Func_void_LoadingChangeEvent create_Func_void_LoadingChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
299
|
+
inline Func_void_LoadingChangeEvent_Wrapper wrap_Func_void_LoadingChangeEvent(Func_void_LoadingChangeEvent value) noexcept {
|
|
300
|
+
return Func_void_LoadingChangeEvent_Wrapper(std::move(value));
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// pragma MARK: std::optional<std::function<void(const LoadingChangeEvent& /* event */)>>
|
|
304
|
+
/**
|
|
305
|
+
* Specialized version of `std::optional<std::function<void(const LoadingChangeEvent& / * event * /)>>`.
|
|
306
|
+
*/
|
|
307
|
+
using std__optional_std__function_void_const_LoadingChangeEvent_____event______ = std::optional<std::function<void(const LoadingChangeEvent& /* event */)>>;
|
|
308
|
+
inline std::optional<std::function<void(const LoadingChangeEvent& /* event */)>> create_std__optional_std__function_void_const_LoadingChangeEvent_____event______(const std::function<void(const LoadingChangeEvent& /* event */)>& value) noexcept {
|
|
309
|
+
return std::optional<std::function<void(const LoadingChangeEvent& /* event */)>>(value);
|
|
310
|
+
}
|
|
311
|
+
inline bool has_value_std__optional_std__function_void_const_LoadingChangeEvent_____event______(const std::optional<std::function<void(const LoadingChangeEvent& /* event */)>>& optional) noexcept {
|
|
312
|
+
return optional.has_value();
|
|
313
|
+
}
|
|
314
|
+
inline std::function<void(const LoadingChangeEvent& /* event */)> get_std__optional_std__function_void_const_LoadingChangeEvent_____event______(const std::optional<std::function<void(const LoadingChangeEvent& /* event */)>>& optional) noexcept {
|
|
315
|
+
return *optional;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// pragma MARK: std::shared_ptr<HybridPdfViewerSpec>
|
|
319
|
+
/**
|
|
320
|
+
* Specialized version of `std::shared_ptr<HybridPdfViewerSpec>`.
|
|
321
|
+
*/
|
|
322
|
+
using std__shared_ptr_HybridPdfViewerSpec_ = std::shared_ptr<HybridPdfViewerSpec>;
|
|
323
|
+
std::shared_ptr<HybridPdfViewerSpec> create_std__shared_ptr_HybridPdfViewerSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
324
|
+
void* NON_NULL get_std__shared_ptr_HybridPdfViewerSpec_(std__shared_ptr_HybridPdfViewerSpec_ cppType) noexcept;
|
|
325
|
+
|
|
326
|
+
// pragma MARK: std::weak_ptr<HybridPdfViewerSpec>
|
|
327
|
+
using std__weak_ptr_HybridPdfViewerSpec_ = std::weak_ptr<HybridPdfViewerSpec>;
|
|
328
|
+
inline std__weak_ptr_HybridPdfViewerSpec_ weakify_std__shared_ptr_HybridPdfViewerSpec_(const std::shared_ptr<HybridPdfViewerSpec>& strong) noexcept { return strong; }
|
|
329
|
+
|
|
330
|
+
// pragma MARK: Result<void>
|
|
331
|
+
using Result_void_ = Result<void>;
|
|
332
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
333
|
+
return Result<void>::withValue();
|
|
334
|
+
}
|
|
335
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
336
|
+
return Result<void>::withError(error);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
} // namespace margelo::nitro::pdfviewer::bridge::swift
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfViewer-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ErrorEvent` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::pdfviewer { struct ErrorEvent; }
|
|
13
|
+
// Forward declaration of `HybridPdfViewerSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::pdfviewer { class HybridPdfViewerSpec; }
|
|
15
|
+
// Forward declaration of `LoadCompleteEvent` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::pdfviewer { struct LoadCompleteEvent; }
|
|
17
|
+
// Forward declaration of `LoadingChangeEvent` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::pdfviewer { struct LoadingChangeEvent; }
|
|
19
|
+
// Forward declaration of `PageChangeEvent` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::pdfviewer { struct PageChangeEvent; }
|
|
21
|
+
// Forward declaration of `ScaleChangeEvent` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::pdfviewer { struct ScaleChangeEvent; }
|
|
23
|
+
// Forward declaration of `ThumbnailGeneratedEvent` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::pdfviewer { struct ThumbnailGeneratedEvent; }
|
|
25
|
+
|
|
26
|
+
// Include C++ defined types
|
|
27
|
+
#include "ErrorEvent.hpp"
|
|
28
|
+
#include "HybridPdfViewerSpec.hpp"
|
|
29
|
+
#include "LoadCompleteEvent.hpp"
|
|
30
|
+
#include "LoadingChangeEvent.hpp"
|
|
31
|
+
#include "PageChangeEvent.hpp"
|
|
32
|
+
#include "ScaleChangeEvent.hpp"
|
|
33
|
+
#include "ThumbnailGeneratedEvent.hpp"
|
|
34
|
+
#include <NitroModules/Result.hpp>
|
|
35
|
+
#include <exception>
|
|
36
|
+
#include <functional>
|
|
37
|
+
#include <memory>
|
|
38
|
+
#include <optional>
|
|
39
|
+
#include <string>
|
|
40
|
+
|
|
41
|
+
// C++ helpers for Swift
|
|
42
|
+
#include "PdfViewer-Swift-Cxx-Bridge.hpp"
|
|
43
|
+
|
|
44
|
+
// Common C++ types used in Swift
|
|
45
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
46
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
47
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
48
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
49
|
+
|
|
50
|
+
// Forward declarations of Swift defined types
|
|
51
|
+
// Forward declaration of `HybridPdfViewerSpec_cxx` to properly resolve imports.
|
|
52
|
+
namespace PdfViewer { class HybridPdfViewerSpec_cxx; }
|
|
53
|
+
|
|
54
|
+
// Include Swift defined types
|
|
55
|
+
#if __has_include("PdfViewer-Swift.h")
|
|
56
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
57
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "PdfViewer".
|
|
58
|
+
#include "PdfViewer-Swift.h"
|
|
59
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
60
|
+
#elif __has_include(<PdfViewer/PdfViewer-Swift.h>)
|
|
61
|
+
#include <PdfViewer/PdfViewer-Swift.h>
|
|
62
|
+
#else
|
|
63
|
+
#error PdfViewer's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "PdfViewer", and try building the app first.
|
|
64
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfViewerAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "PdfViewer-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridPdfViewerSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface PdfViewerAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation PdfViewerAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::pdfviewer;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"PdfViewer",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridPdfViewerSpec> hybridObject = PdfViewer::PdfViewerAutolinking::createPdfViewer();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfViewerAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
public final class PdfViewerAutolinking {
|
|
9
|
+
public typealias bridge = margelo.nitro.pdfviewer.bridge.swift
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of a Swift class that implements `HybridPdfViewerSpec`,
|
|
13
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridPdfViewerSpec_cxx`)
|
|
14
|
+
*
|
|
15
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `HybridPdfViewer`).
|
|
17
|
+
*/
|
|
18
|
+
public static func createPdfViewer() -> bridge.std__shared_ptr_HybridPdfViewerSpec_ {
|
|
19
|
+
let hybridObject = HybridPdfViewer()
|
|
20
|
+
return { () -> bridge.std__shared_ptr_HybridPdfViewerSpec_ in
|
|
21
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
22
|
+
return __cxxWrapped.getCxxPart()
|
|
23
|
+
}()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridPdfViewerSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridPdfViewerSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::pdfviewer {
|
|
11
|
+
} // namespace margelo::nitro::pdfviewer
|