| 400 | auto hostViewFactory = _hostViewManager->createViewFactory(className, nullptr); |
| 401 | if (hostViewFactory.get() != nullptr) { |
| 402 | return Valdi::makeShared<BridgeLayerFactory>( |
| 403 | _resources, hostViewFactory, *this, *_hostViewManager, boundAttributes); |
| 404 | } |
| 405 | // Host doesn't actually provide this class (e.g. "Layout" on macOS); use layer fallback |
| 406 | } |
| 407 | { |
| 408 | auto layerClass = getLayerClass(className); |
| 409 | if (layerClass == nullptr) { |
| 410 | VALDI_ERROR(_logger, |
| 411 | "Unable to resolve view factory for class {}, falling back to {}", |
| 412 | className, |
| 413 | getDefaultViewClass()); |
| 414 | layerClass = getBaseLayerClass(); |
| 415 | SC_ASSERT(layerClass != nullptr); |
| 416 | } |
| 417 | |
| 418 | return Valdi::makeShared<SnapDrawingViewFactory>(className, *this, boundAttributes, layerClass); |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | Valdi::Ref<Valdi::ViewFactory> SnapDrawingViewManager::bridgeViewFactory( |
| 423 | const Valdi::Ref<Valdi::ViewFactory>& viewFactory, const Valdi::Ref<Valdi::BoundAttributes>& startingAttributes) { |
| 424 | Valdi::AttributeHandlerById handlers; |
| 425 | |
| 426 | for (const auto& boundAttribute : viewFactory->getBoundAttributes()->getHandlers()) { |
| 427 | if (boundAttribute.second.isCompositePart()) { |
| 428 | handlers[boundAttribute.first] = boundAttribute.second; |
nothing calls this directly
no test coverage detected