50 lines
1.3 KiB
C++
Generated
50 lines
1.3 KiB
C++
Generated
///
|
|
/// NitroEpubOnLoad.cpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#ifndef BUILDING_NITROEPUB_WITH_GENERATED_CMAKE_PROJECT
|
|
#error NitroEpubOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
#endif
|
|
|
|
#include "NitroEpubOnLoad.hpp"
|
|
|
|
#include <jni.h>
|
|
#include <fbjni/fbjni.h>
|
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
|
|
#include "HybridEpub.hpp"
|
|
|
|
namespace margelo::nitro::nitroepub {
|
|
|
|
int initialize(JavaVM* vm) {
|
|
return facebook::jni::initialize(vm, []() {
|
|
::margelo::nitro::nitroepub::registerAllNatives();
|
|
});
|
|
}
|
|
|
|
|
|
|
|
void registerAllNatives() {
|
|
using namespace margelo::nitro;
|
|
using namespace margelo::nitro::nitroepub;
|
|
|
|
// Register native JNI methods
|
|
|
|
|
|
// Register Nitro Hybrid Objects
|
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
"Epub",
|
|
[]() -> std::shared_ptr<HybridObject> {
|
|
static_assert(std::is_default_constructible_v<HybridEpub>,
|
|
"The HybridObject \"HybridEpub\" is not default-constructible! "
|
|
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
return std::make_shared<HybridEpub>();
|
|
}
|
|
);
|
|
}
|
|
|
|
} // namespace margelo::nitro::nitroepub
|