mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-13 09:29:00 +00:00
50 lines
1.7 KiB
C++
Generated
50 lines
1.7 KiB
C++
Generated
///
|
|
/// JHybridOmniViewStateUpdater.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#ifndef RN_SERIALIZABLE_STATE
|
|
#error Omni was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
|
|
#endif
|
|
|
|
#include <fbjni/fbjni.h>
|
|
#include <react/fabric/CoreComponentsRegistry.h>
|
|
#include <react/fabric/StateWrapperImpl.h>
|
|
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
#include <NitroModules/NitroDefines.hpp>
|
|
#include <NitroModules/JStateWrapper.hpp>
|
|
#include "JHybridOmniViewSpec.hpp"
|
|
#include "views/HybridOmniViewComponent.hpp"
|
|
|
|
namespace margelo::nitro::omni::views {
|
|
|
|
using namespace facebook;
|
|
|
|
class JHybridOmniViewStateUpdater final: public jni::JavaClass<JHybridOmniViewStateUpdater> {
|
|
public:
|
|
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/omni/views/HybridOmniViewStateUpdater;";
|
|
|
|
public:
|
|
static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
jni::alias_ref<JHybridOmniViewSpec::JavaPart> view,
|
|
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
|
|
|
|
public:
|
|
static void registerNatives() {
|
|
// Register JNI calls
|
|
javaClassStatic()->registerNatives({
|
|
makeNativeMethod("updateViewProps", JHybridOmniViewStateUpdater::updateViewProps),
|
|
});
|
|
// Register React Native view component descriptor
|
|
auto provider = react::concreteComponentDescriptorProvider<HybridOmniViewComponentDescriptor>();
|
|
auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
|
|
providerRegistry->add(provider);
|
|
}
|
|
};
|
|
|
|
} // namespace margelo::nitro::omni::views
|