mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
# Summary This PR adds Fabric support and a FabricExample app for Windows. Windows support for Fabric is experimental and as such APIs are subject to change/break. ## Test Plan https://github.com/software-mansion/react-native-svg/assets/1422161/2a7db119-44a8-4ee1-a837-41ca8320d8fa ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ❌ | | Android | ❌ | | Windows | ✅ | ## Checklist - [x] I have tested this on a device and a simulator - [ ] I added documentation in `README.md` - [ ] I updated the typed files (typescript) - [ ] I added a test for the API in the `__tests__` folder
45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "SvgViewManager.g.h"
|
|
|
|
namespace winrt::RNSVG::implementation {
|
|
struct SvgViewManager : SvgViewManagerT<SvgViewManager> {
|
|
SvgViewManager() = default;
|
|
|
|
// IViewManager
|
|
hstring Name();
|
|
xaml::FrameworkElement CreateView();
|
|
|
|
// IViewManagerWithReactContext
|
|
Microsoft::ReactNative::IReactContext ReactContext();
|
|
void ReactContext(Microsoft::ReactNative::IReactContext const &value);
|
|
|
|
// IViewManagerWithNativeProperties
|
|
Windows::Foundation::Collections::IMapView<hstring, Microsoft::ReactNative::ViewManagerPropertyType> NativeProps();
|
|
void UpdateProperties(
|
|
xaml::FrameworkElement const &view,
|
|
Microsoft::ReactNative::IJSValueReader const &propertyMapReader);
|
|
|
|
// IViewManagerWithChildren
|
|
void AddView(xaml::FrameworkElement const &parent, xaml::UIElement const &child, int64_t index);
|
|
void RemoveAllChildren(xaml::FrameworkElement const &parent);
|
|
void RemoveChildAt(xaml::FrameworkElement const &parent, int64_t index);
|
|
void ReplaceChild(
|
|
xaml::FrameworkElement const &parent,
|
|
xaml::UIElement const &oldChild,
|
|
xaml::UIElement const &newChild);
|
|
|
|
// IViewManagerWithPointerEvents
|
|
void OnPointerEvent(
|
|
Windows::Foundation::IInspectable const &view,
|
|
Microsoft::ReactNative::ReactPointerEventArgs const &args);
|
|
|
|
private:
|
|
Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
};
|
|
} // namespace winrt::RNSVG::implementation
|
|
|
|
namespace winrt::RNSVG::factory_implementation {
|
|
struct SvgViewManager : SvgViewManagerT<SvgViewManager, implementation::SvgViewManager> {};
|
|
} // namespace winrt::RNSVG::factory_implementation
|