/// /// codepadOnLoad.cpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// #ifndef BUILDING_CODEPAD_WITH_GENERATED_CMAKE_PROJECT #error codepadOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? #endif #include "codepadOnLoad.hpp" #include #include #include #include "JHybridCodeEditorViewSpec.hpp" #include "JFunc_void.hpp" #include "JFunc_void_NativeScrollEvent.hpp" #include "JFunc_void_NativeSelection.hpp" #include "JFunc_void_NativeChangeEvent.hpp" #include "JFunc_void_std__string.hpp" #include "JFunc_void_NativeContentSize.hpp" #include "JFunc_void_std__vector_NativeGap_.hpp" #include "views/JHybridCodeEditorViewStateUpdater.hpp" #include "JHybridCodepadSpec.hpp" #include namespace margelo::nitro::codepad { int initialize(JavaVM* vm) { return facebook::jni::initialize(vm, []() { ::margelo::nitro::codepad::registerAllNatives(); }); } struct JHybridCodeEditorViewSpecImpl: public jni::JavaClass { static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/codepad/HybridCodeEditorView;"; static std::shared_ptr create() { static const auto constructorFn = javaClassStatic()->getConstructor(); jni::local_ref javaPart = javaClassStatic()->newObject(constructorFn); return javaPart->getJHybridCodeEditorViewSpec(); } }; struct JHybridCodepadSpecImpl: public jni::JavaClass { static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/codepad/HybridCodepad;"; static std::shared_ptr create() { static const auto constructorFn = javaClassStatic()->getConstructor(); jni::local_ref javaPart = javaClassStatic()->newObject(constructorFn); return javaPart->getJHybridCodepadSpec(); } }; void registerAllNatives() { using namespace margelo::nitro; using namespace margelo::nitro::codepad; // Register native JNI methods margelo::nitro::codepad::JHybridCodeEditorViewSpec::CxxPart::registerNatives(); margelo::nitro::codepad::JFunc_void_cxx::registerNatives(); margelo::nitro::codepad::JFunc_void_NativeScrollEvent_cxx::registerNatives(); margelo::nitro::codepad::JFunc_void_NativeSelection_cxx::registerNatives(); margelo::nitro::codepad::JFunc_void_NativeChangeEvent_cxx::registerNatives(); margelo::nitro::codepad::JFunc_void_std__string_cxx::registerNatives(); margelo::nitro::codepad::JFunc_void_NativeContentSize_cxx::registerNatives(); margelo::nitro::codepad::JFunc_void_std__vector_NativeGap__cxx::registerNatives(); margelo::nitro::codepad::views::JHybridCodeEditorViewStateUpdater::registerNatives(); margelo::nitro::codepad::JHybridCodepadSpec::CxxPart::registerNatives(); // Register Nitro Hybrid Objects HybridObjectRegistry::registerHybridObjectConstructor( "CodeEditorView", []() -> std::shared_ptr { return JHybridCodeEditorViewSpecImpl::create(); } ); HybridObjectRegistry::registerHybridObjectConstructor( "Codepad", []() -> std::shared_ptr { return JHybridCodepadSpecImpl::create(); } ); } } // namespace margelo::nitro::codepad