mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 22:25:12 +00:00
b80f102b09
# 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
96 lines
2.4 KiB
Plaintext
96 lines
2.4 KiB
Plaintext
import "Types.idl";
|
|
|
|
namespace RNSVG
|
|
{
|
|
[experimental]
|
|
interface IRenderable
|
|
{
|
|
D2DGeometry Geometry;
|
|
Boolean IsResponsible;
|
|
|
|
void CreateResources();
|
|
void Draw(D2DDeviceContext deviceContext, Windows.Foundation.Size size);
|
|
void MergeProperties(IRenderable other);
|
|
void SaveDefinition();
|
|
void Unload();
|
|
void CreateGeometry(D2DDeviceContext deviceContext);
|
|
IRenderable HitTest(Windows.Foundation.Point point);
|
|
};
|
|
|
|
[experimental]
|
|
interface ISvgView
|
|
{
|
|
D2DDevice Device{ get; };
|
|
D2DDeviceContext DeviceContext{ get; };
|
|
Windows.Foundation.Size CanvasSize { get; };
|
|
Windows.Foundation.Collections.IMap<String, IRenderable> Templates{ get; };
|
|
Windows.Foundation.Collections.IMap<String, IBrushView> Brushes{ get; };
|
|
|
|
void Invalidate();
|
|
};
|
|
|
|
[experimental]
|
|
interface IRenderableView
|
|
{
|
|
Boolean IsUnloaded { get; };
|
|
|
|
String Id{ get; };
|
|
Windows.Foundation.Numerics.Matrix3x2 SvgTransform{ get; };
|
|
Single FillOpacity{ get; };
|
|
String FillBrushId{ get; };
|
|
Single StrokeOpacity{ get; };
|
|
String StrokeBrushId{ get; };
|
|
SVGLength StrokeWidth{ get; };
|
|
Single StrokeMiterLimit{ get; };
|
|
Single StrokeDashOffset{ get; };
|
|
Windows.Foundation.Collections.IVector<SVGLength> StrokeDashArray{ get; };
|
|
LineCap StrokeLineCap{ get; };
|
|
LineJoin StrokeLineJoin{ get; };
|
|
FillRule FillRule{ get; };
|
|
D2DGeometry ClipPathGeometry(D2DDeviceContext deviceContext);
|
|
};
|
|
|
|
[experimental]
|
|
interface IGroupView
|
|
{
|
|
Single FontSize;
|
|
String FontFamily;
|
|
String FontWeight;
|
|
|
|
void DrawGroup(D2DDeviceContext deviceContext, Windows.Foundation.Size size);
|
|
};
|
|
|
|
[experimental]
|
|
interface ITextView
|
|
{
|
|
Windows.Foundation.Collections.IVector<SVGLength> X{ get; };
|
|
Windows.Foundation.Collections.IVector<SVGLength> Y{ get; };
|
|
Windows.Foundation.Collections.IVector<SVGLength> DX{ get; };
|
|
Windows.Foundation.Collections.IVector<SVGLength> DY{ get; };
|
|
};
|
|
|
|
[experimental]
|
|
interface ITSpanView
|
|
{
|
|
Windows.Foundation.Collections.IVector<SVGLength> Rotate { get; };
|
|
};
|
|
|
|
[experimental]
|
|
interface ISymbolView
|
|
{
|
|
Single MinX{ get; };
|
|
Single MinY{ get; };
|
|
Single VbWidth{ get; };
|
|
Single VbHeight{ get; };
|
|
String Align{ get; };
|
|
MeetOrSlice MeetOrSlice{ get; };
|
|
};
|
|
|
|
[experimental]
|
|
interface IBrushView
|
|
{
|
|
D2DBrush Brush{ get; };
|
|
void CreateBrush();
|
|
void SetBounds(Windows.Foundation.Rect rect);
|
|
};
|
|
} |