| 27 | } |
| 28 | |
| 29 | jni::local_ref<MainComponentsRegistry::jhybriddata> |
| 30 | MainComponentsRegistry::initHybrid( |
| 31 | jni::alias_ref<jclass>, |
| 32 | ComponentFactory *delegate) { |
| 33 | auto instance = makeCxxInstance(delegate); |
| 34 | |
| 35 | auto buildRegistryFunction = |
| 36 | [](EventDispatcher::Weak const &eventDispatcher, |
| 37 | ContextContainer::Shared const &contextContainer) |
| 38 | -> ComponentDescriptorRegistry::Shared { |
| 39 | auto registry = MainComponentsRegistry::sharedProviderRegistry() |
| 40 | ->createComponentDescriptorRegistry( |
| 41 | {eventDispatcher, contextContainer}); |
| 42 | |
| 43 | auto mutableRegistry = |
| 44 | std::const_pointer_cast<ComponentDescriptorRegistry>(registry); |
| 45 | |
| 46 | mutableRegistry->setFallbackComponentDescriptor( |
| 47 | std::make_shared<UnimplementedNativeViewComponentDescriptor>( |
| 48 | ComponentDescriptorParameters{ |
| 49 | eventDispatcher, contextContainer, nullptr})); |
| 50 | |
| 51 | return registry; |
| 52 | }; |
| 53 | |
| 54 | delegate->buildRegistryFunction = buildRegistryFunction; |
| 55 | return instance; |
| 56 | } |
| 57 | |
| 58 | void MainComponentsRegistry::registerNatives() { |
| 59 | registerHybrid({ |
nothing calls this directly
no outgoing calls
no test coverage detected