diff --git a/Svg.Skia.sln b/Svg.Skia.sln index 40b73ff86..97081b8c3 100644 --- a/Svg.Skia.sln +++ b/Svg.Skia.sln @@ -99,16 +99,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{380E75 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "svgc", "samples\svgc\svgc.csproj", "{6B758C64-5BDA-4842-B0F5-A124D65D83F9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Svg.SourceGenerator.Skia.Sample", "samples\Svg.SourceGenerator.Skia.Sample\Svg.SourceGenerator.Skia.Sample.csproj", "{89FD53A6-8DE6-4733-AF87-EF8660C8EBD3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Svg.Skia.Converter", "samples\Svg.Skia.Converter\Svg.Skia.Converter.csproj", "{68F9524C-BA9F-451D-881D-6192EF2FAAAA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSvgSample", "samples\AvaloniaSvgSample\AvaloniaSvgSample.csproj", "{C3BCD2D5-DFC2-43C1-922D-2E76E6AEF122}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSKPictureImageSample", "samples\AvaloniaSKPictureImageSample\AvaloniaSKPictureImageSample.csproj", "{5A3BC87E-F3F6-4F89-B412-1324CCA2C32B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Svg.SourceGenerator.Skia", "src\Svg.SourceGenerator.Skia\Svg.SourceGenerator.Skia.csproj", "{3049C672-8A3F-4FE4-9973-515B8323B546}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Svg", "src\Avalonia.Svg\Avalonia.Svg.csproj", "{B742F260-0EC6-4805-AE9F-987818CE3CF4}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSvgSkiaStylingSample", "samples\AvaloniaSvgSkiaStylingSample\AvaloniaSvgSkiaStylingSample.csproj", "{8A938DC2-1634-4387-BAB3-69F871D54FB5}" @@ -179,10 +173,6 @@ Global {6B758C64-5BDA-4842-B0F5-A124D65D83F9}.Debug|Any CPU.Build.0 = Debug|Any CPU {6B758C64-5BDA-4842-B0F5-A124D65D83F9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6B758C64-5BDA-4842-B0F5-A124D65D83F9}.Release|Any CPU.Build.0 = Release|Any CPU - {89FD53A6-8DE6-4733-AF87-EF8660C8EBD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89FD53A6-8DE6-4733-AF87-EF8660C8EBD3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89FD53A6-8DE6-4733-AF87-EF8660C8EBD3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89FD53A6-8DE6-4733-AF87-EF8660C8EBD3}.Release|Any CPU.Build.0 = Release|Any CPU {68F9524C-BA9F-451D-881D-6192EF2FAAAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {68F9524C-BA9F-451D-881D-6192EF2FAAAA}.Debug|Any CPU.Build.0 = Debug|Any CPU {68F9524C-BA9F-451D-881D-6192EF2FAAAA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -191,14 +181,6 @@ Global {C3BCD2D5-DFC2-43C1-922D-2E76E6AEF122}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3BCD2D5-DFC2-43C1-922D-2E76E6AEF122}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3BCD2D5-DFC2-43C1-922D-2E76E6AEF122}.Release|Any CPU.Build.0 = Release|Any CPU - {5A3BC87E-F3F6-4F89-B412-1324CCA2C32B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A3BC87E-F3F6-4F89-B412-1324CCA2C32B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A3BC87E-F3F6-4F89-B412-1324CCA2C32B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A3BC87E-F3F6-4F89-B412-1324CCA2C32B}.Release|Any CPU.Build.0 = Release|Any CPU - {3049C672-8A3F-4FE4-9973-515B8323B546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3049C672-8A3F-4FE4-9973-515B8323B546}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3049C672-8A3F-4FE4-9973-515B8323B546}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3049C672-8A3F-4FE4-9973-515B8323B546}.Release|Any CPU.Build.0 = Release|Any CPU {B742F260-0EC6-4805-AE9F-987818CE3CF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B742F260-0EC6-4805-AE9F-987818CE3CF4}.Debug|Any CPU.Build.0 = Debug|Any CPU {B742F260-0EC6-4805-AE9F-987818CE3CF4}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -231,11 +213,8 @@ Global {BE25FC07-9A8C-4494-A6AE-F2561CF89010} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} {380E7565-C6FF-45C1-A683-E4E1FC744DCC} = {32B4A27D-6FC0-498C-9AD8-5510ACF2C4A1} {6B758C64-5BDA-4842-B0F5-A124D65D83F9} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} - {89FD53A6-8DE6-4733-AF87-EF8660C8EBD3} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} {68F9524C-BA9F-451D-881D-6192EF2FAAAA} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} {C3BCD2D5-DFC2-43C1-922D-2E76E6AEF122} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} - {5A3BC87E-F3F6-4F89-B412-1324CCA2C32B} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} - {3049C672-8A3F-4FE4-9973-515B8323B546} = {4C42912C-9F8C-43D9-A4B5-4427F7EC8F18} {B742F260-0EC6-4805-AE9F-987818CE3CF4} = {4C42912C-9F8C-43D9-A4B5-4427F7EC8F18} {8A938DC2-1634-4387-BAB3-69F871D54FB5} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8} EndGlobalSection diff --git a/build/Base.props b/build/Base.props index 2ec9ffe62..3a18d1eec 100644 --- a/build/Base.props +++ b/build/Base.props @@ -1,9 +1,9 @@ - 1.0.0.13 + 1.0.0.14 - 11.0.0.13 + 11.0.0.14 $(VersionSuffix) Wiesław Šoltés Wiesław Šoltés diff --git a/samples/AvaloniaSKPictureImageSample/App.axaml b/samples/AvaloniaSKPictureImageSample/App.axaml deleted file mode 100644 index c54fbea7a..000000000 --- a/samples/AvaloniaSKPictureImageSample/App.axaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/samples/AvaloniaSKPictureImageSample/App.axaml.cs b/samples/AvaloniaSKPictureImageSample/App.axaml.cs deleted file mode 100644 index a1d9f451b..000000000 --- a/samples/AvaloniaSKPictureImageSample/App.axaml.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace AvaloniaSKPictureImageSample; - -public class App : Application -{ - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - desktop.MainWindow = new MainWindow(); - } - - base.OnFrameworkInitializationCompleted(); - } -} \ No newline at end of file diff --git a/samples/AvaloniaSKPictureImageSample/Assets/SVG_logo.svg b/samples/AvaloniaSKPictureImageSample/Assets/SVG_logo.svg deleted file mode 100644 index fea45882f..000000000 --- a/samples/AvaloniaSKPictureImageSample/Assets/SVG_logo.svg +++ /dev/null @@ -1,261 +0,0 @@ - - - - - SVG Logo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SVG - - - - - - - - diff --git a/samples/AvaloniaSKPictureImageSample/Assets/__AJ_Digital_Camera.svg b/samples/AvaloniaSKPictureImageSample/Assets/__AJ_Digital_Camera.svg deleted file mode 100644 index c8fcefb25..000000000 --- a/samples/AvaloniaSKPictureImageSample/Assets/__AJ_Digital_Camera.svg +++ /dev/null @@ -1,340 +0,0 @@ - - - - - - - - digital-camera - - - - digital - - 11 - hardware - photo - digicam - computer - camera - - - - - AJ Ashton - - - - - AJ Ashton - - - - - AJ Ashton - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/AvaloniaSKPictureImageSample/Assets/__tiger.svg b/samples/AvaloniaSKPictureImageSample/Assets/__tiger.svg deleted file mode 100644 index bf1b4cc7f..000000000 --- a/samples/AvaloniaSKPictureImageSample/Assets/__tiger.svg +++ /dev/null @@ -1,1978 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/AvaloniaSKPictureImageSample/Assets/pservers-pattern-01-b.svg b/samples/AvaloniaSKPictureImageSample/Assets/pservers-pattern-01-b.svg deleted file mode 100644 index 2081855a4..000000000 --- a/samples/AvaloniaSKPictureImageSample/Assets/pservers-pattern-01-b.svg +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - -

- Test that the viewer has basic capability to handle patterns - on fills and stroke of objects and text. -

- - -

-Run the test. No interaction required. -

-
- -

- From top-down the appearance of objects is as follows. -

-

- The top rectangle should be filled with a pattern composed of a green - rectangle on top of yellow rectangle. A default stroke has been applied to the original - rectangle to see the boundary of the rectangle. -

-

- The next rectangle has no fill, but has a thick stroke on which the pattern is - applied. The pattern consists of 4 colored rectangles. -

-

- The next item is a text with a pattern on the fill. The pattern appears as - alternating rows of orange and green. -

-

- The last item is a text with a 2 user unit stroke on which a pattern is applied. - The pattern appears as alternating columns of maroon and blue. -

-
- - $RCSfile: pservers-pattern-01-b.svg,v $ - - - - - - - - - - - - - - - - - Pattern created using yellow and green rectangles applied to fill of rectangle - - - - - - - - - - - Pattern of 4 rectangles applied to a stroke of a rectangle. - - - - - - - - Pattern on fill - Pattern consists of orange and green rows - - - - - - - - Pattern on stroke - Pattern consists of maroon and blue columns - - - $Revision: 1.6 $ - - - - - diff --git a/samples/AvaloniaSKPictureImageSample/AvaloniaSKPictureImageSample.csproj b/samples/AvaloniaSKPictureImageSample/AvaloniaSKPictureImageSample.csproj deleted file mode 100644 index a8076b11a..000000000 --- a/samples/AvaloniaSKPictureImageSample/AvaloniaSKPictureImageSample.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - WinExe - net8.0 - False - enable - latest - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/AvaloniaSKPictureImageSample/MainWindow.axaml b/samples/AvaloniaSKPictureImageSample/MainWindow.axaml deleted file mode 100644 index 0cec335dc..000000000 --- a/samples/AvaloniaSKPictureImageSample/MainWindow.axaml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - None - Fill - Uniform - UniformToFill - - - - - - - - - - - - - None - Fill - Uniform - UniformToFill - - - - - - - - - - - - - - - - - - - None - Fill - Uniform - UniformToFill - - - - - - - - - - - - diff --git a/samples/AvaloniaSKPictureImageSample/MainWindow.axaml.cs b/samples/AvaloniaSKPictureImageSample/MainWindow.axaml.cs deleted file mode 100644 index c314fbea7..000000000 --- a/samples/AvaloniaSKPictureImageSample/MainWindow.axaml.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; - -namespace AvaloniaSKPictureImageSample; - -public partial class MainWindow : Window -{ - public MainWindow() - { - InitializeComponent(); -#if DEBUG - this.AttachDevTools(); -#endif - } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } -} diff --git a/samples/AvaloniaSKPictureImageSample/Program.cs b/samples/AvaloniaSKPictureImageSample/Program.cs deleted file mode 100644 index 92b7b26a4..000000000 --- a/samples/AvaloniaSKPictureImageSample/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Avalonia; -using Avalonia.Controls.Skia; - -namespace AvaloniaSKPictureImageSample; - -internal class Program -{ - public static void Main(string[] args) => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); - - public static AppBuilder BuildAvaloniaApp() - { - GC.KeepAlive(typeof(SKPictureImage).Assembly); - GC.KeepAlive(typeof(SKPictureControl).Assembly); - return AppBuilder.Configure() - .UsePlatformDetect() - .With(new X11PlatformOptions { }) - .UseSkia() - .LogToTrace(); - } -} diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Program.cs b/samples/Svg.SourceGenerator.Skia.Sample/Program.cs deleted file mode 100644 index d95535f06..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Program.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using Svg.Generated; -using Svg.Skia; - -namespace Svg.SourceGenerator.Skia.Sample; - -internal class Program -{ - private static void Main(string[] args) - { - Console.WriteLine($"Generated class {typeof(Camera)} from Svg file."); - Console.WriteLine($"Generated class {typeof(Tiger)} from Svg file."); - Console.WriteLine($"Generated class {typeof(Ellipse)} from Svg file."); - Console.WriteLine($"Generated class {typeof(Rect)} from Svg file."); - Console.WriteLine($"Generated class {typeof(Svg_pservers_pattern_01_b)} from Svg file."); - - var sw = new Stopwatch(); - - sw.Start(); - using var cameraStream = File.OpenWrite("__AJ_Digital_Camera.png"); - Camera.Picture.ToImage(cameraStream, SkiaSharp.SKColors.Transparent, SkiaSharp.SKEncodedImageFormat.Png, 100, 1, 1, SkiaSharp.SKImageInfo.PlatformColorType, SkiaSharp.SKAlphaType.Unpremul, SkiaSharp.SKColorSpace.CreateRgb(SkiaSharp.SKColorSpaceTransferFn.Srgb, SkiaSharp.SKColorSpaceXyz.Srgb)); - sw.Stop(); - Console.WriteLine($"Created __AJ_Digital_Camera.png in {sw.Elapsed.TotalMilliseconds}ms"); - - sw.Reset(); - sw.Start(); - using var tigerStream = File.OpenWrite("__tiger.png"); - Tiger.Picture.ToImage(tigerStream, SkiaSharp.SKColors.Transparent, SkiaSharp.SKEncodedImageFormat.Png, 100, 1, 1, SkiaSharp.SKImageInfo.PlatformColorType, SkiaSharp.SKAlphaType.Unpremul, SkiaSharp.SKColorSpace.CreateRgb(SkiaSharp.SKColorSpaceTransferFn.Srgb, SkiaSharp.SKColorSpaceXyz.Srgb)); - sw.Stop(); - Console.WriteLine($"Created __tiger.png in {sw.Elapsed.TotalMilliseconds}ms"); - - sw.Reset(); - sw.Start(); - using var ellipseStream = File.OpenWrite("e-ellipse-001.png"); - Ellipse.Picture.ToImage(ellipseStream, SkiaSharp.SKColors.Transparent, SkiaSharp.SKEncodedImageFormat.Png, 100, 1, 1, SkiaSharp.SKImageInfo.PlatformColorType, SkiaSharp.SKAlphaType.Unpremul, SkiaSharp.SKColorSpace.CreateSrgb()); - sw.Stop(); - Console.WriteLine($"Created e-ellipse-001.png in {sw.Elapsed.TotalMilliseconds}ms"); - - sw.Reset(); - sw.Start(); - using var rectStream = File.OpenWrite("e-rect-001.png"); - Rect.Picture.ToImage(rectStream, SkiaSharp.SKColors.Transparent, SkiaSharp.SKEncodedImageFormat.Png, 100, 1, 1, SkiaSharp.SKImageInfo.PlatformColorType, SkiaSharp.SKAlphaType.Unpremul, SkiaSharp.SKColorSpace.CreateSrgb()); - sw.Stop(); - Console.WriteLine($"Created e-rect-001.png in {sw.Elapsed.TotalMilliseconds}ms"); - - sw.Reset(); - sw.Start(); - using var patternStream = File.OpenWrite("pservers-pattern-01-b.png"); - Svg_pservers_pattern_01_b.Picture.ToImage(patternStream, SkiaSharp.SKColors.Transparent, SkiaSharp.SKEncodedImageFormat.Png, 100, 1, 1, SkiaSharp.SKImageInfo.PlatformColorType, SkiaSharp.SKAlphaType.Unpremul, SkiaSharp.SKColorSpace.CreateSrgb()); - sw.Stop(); - Console.WriteLine($"Created pservers-pattern-01-b.png in {sw.Elapsed.TotalMilliseconds}ms"); - } -} diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Svg.SourceGenerator.Skia.Sample.csproj b/samples/Svg.SourceGenerator.Skia.Sample/Svg.SourceGenerator.Skia.Sample.csproj deleted file mode 100644 index 8586878ad..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Svg.SourceGenerator.Skia.Sample.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - Exe - net8.0 - False - latest - true - $(BaseIntermediateOutputPath)\GeneratedFiles - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Svg/__AJ_Digital_Camera.svg b/samples/Svg.SourceGenerator.Skia.Sample/Svg/__AJ_Digital_Camera.svg deleted file mode 100644 index c8fcefb25..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Svg/__AJ_Digital_Camera.svg +++ /dev/null @@ -1,340 +0,0 @@ - - - - - - - - digital-camera - - - - digital - - 11 - hardware - photo - digicam - computer - camera - - - - - AJ Ashton - - - - - AJ Ashton - - - - - AJ Ashton - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Svg/__tiger.svg b/samples/Svg.SourceGenerator.Skia.Sample/Svg/__tiger.svg deleted file mode 100644 index bf1b4cc7f..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Svg/__tiger.svg +++ /dev/null @@ -1,1978 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Svg/e-ellipse-001.svg b/samples/Svg.SourceGenerator.Skia.Sample/Svg/e-ellipse-001.svg deleted file mode 100644 index 3a43477d8..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Svg/e-ellipse-001.svg +++ /dev/null @@ -1,13 +0,0 @@ - - Simple case - - - - - - - - - diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Svg/e-rect-001.svg b/samples/Svg.SourceGenerator.Skia.Sample/Svg/e-rect-001.svg deleted file mode 100644 index c34a6b2ef..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Svg/e-rect-001.svg +++ /dev/null @@ -1,11 +0,0 @@ - - Simple case - - - - - - - - - diff --git a/samples/Svg.SourceGenerator.Skia.Sample/Svg/pservers-pattern-01-b.svg b/samples/Svg.SourceGenerator.Skia.Sample/Svg/pservers-pattern-01-b.svg deleted file mode 100644 index 2081855a4..000000000 --- a/samples/Svg.SourceGenerator.Skia.Sample/Svg/pservers-pattern-01-b.svg +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - -

- Test that the viewer has basic capability to handle patterns - on fills and stroke of objects and text. -

- - -

-Run the test. No interaction required. -

-
- -

- From top-down the appearance of objects is as follows. -

-

- The top rectangle should be filled with a pattern composed of a green - rectangle on top of yellow rectangle. A default stroke has been applied to the original - rectangle to see the boundary of the rectangle. -

-

- The next rectangle has no fill, but has a thick stroke on which the pattern is - applied. The pattern consists of 4 colored rectangles. -

-

- The next item is a text with a pattern on the fill. The pattern appears as - alternating rows of orange and green. -

-

- The last item is a text with a 2 user unit stroke on which a pattern is applied. - The pattern appears as alternating columns of maroon and blue. -

-
- - $RCSfile: pservers-pattern-01-b.svg,v $ - - - - - - - - - - - - - - - - - Pattern created using yellow and green rectangles applied to fill of rectangle - - - - - - - - - - - Pattern of 4 rectangles applied to a stroke of a rectangle. - - - - - - - - Pattern on fill - Pattern consists of orange and green rows - - - - - - - - Pattern on stroke - Pattern consists of maroon and blue columns - - - $Revision: 1.6 $ - - - - - diff --git a/src/Avalonia.Controls.Skia/Avalonia.Controls.Skia.csproj b/src/Avalonia.Controls.Skia/Avalonia.Controls.Skia.csproj index 0563b6649..4f365e731 100644 --- a/src/Avalonia.Controls.Skia/Avalonia.Controls.Skia.csproj +++ b/src/Avalonia.Controls.Skia/Avalonia.Controls.Skia.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False CS1591 diff --git a/src/Avalonia.Svg.Skia/Avalonia.Svg.Skia.csproj b/src/Avalonia.Svg.Skia/Avalonia.Svg.Skia.csproj index 070669d27..e481e6978 100644 --- a/src/Avalonia.Svg.Skia/Avalonia.Svg.Skia.csproj +++ b/src/Avalonia.Svg.Skia/Avalonia.Svg.Skia.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False CS1591 diff --git a/src/Avalonia.Svg/Avalonia.Svg.csproj b/src/Avalonia.Svg/Avalonia.Svg.csproj index 7c49efbfd..a6f7a883a 100644 --- a/src/Avalonia.Svg/Avalonia.Svg.csproj +++ b/src/Avalonia.Svg/Avalonia.Svg.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False CS1591 diff --git a/src/ShimSkiaSharp/ShimSkiaSharp.csproj b/src/ShimSkiaSharp/ShimSkiaSharp.csproj index 0aa7d7123..acd0a53f9 100644 --- a/src/ShimSkiaSharp/ShimSkiaSharp.csproj +++ b/src/ShimSkiaSharp/ShimSkiaSharp.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False True diff --git a/src/Svg.CodeGen.Skia/Svg.CodeGen.Skia.csproj b/src/Svg.CodeGen.Skia/Svg.CodeGen.Skia.csproj index 24e6fa206..4efd07a28 100644 --- a/src/Svg.CodeGen.Skia/Svg.CodeGen.Skia.csproj +++ b/src/Svg.CodeGen.Skia/Svg.CodeGen.Skia.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0 + net8.0 latest enable True diff --git a/src/Svg.Custom/Svg.Custom.csproj b/src/Svg.Custom/Svg.Custom.csproj index 535dcdcf8..0c3d7fc0b 100644 --- a/src/Svg.Custom/Svg.Custom.csproj +++ b/src/Svg.Custom/Svg.Custom.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False True @@ -54,6 +54,10 @@ $(DefineConstants);NETCORE;NET6 + + $(DefineConstants);NETCORE;NET8 + + diff --git a/src/Svg.Model/Svg.Model.csproj b/src/Svg.Model/Svg.Model.csproj index 557a522ac..3dd30569a 100644 --- a/src/Svg.Model/Svg.Model.csproj +++ b/src/Svg.Model/Svg.Model.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False True diff --git a/src/Svg.Skia/Svg.Skia.csproj b/src/Svg.Skia/Svg.Skia.csproj index 1da5e006f..5272d0812 100644 --- a/src/Svg.Skia/Svg.Skia.csproj +++ b/src/Svg.Skia/Svg.Skia.csproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net6.0;net8.0 + net8.0 False False CS1591 diff --git a/src/Svg.SourceGenerator.Skia/SkiaGeneratorAssetLoader.cs b/src/Svg.SourceGenerator.Skia/SkiaGeneratorAssetLoader.cs deleted file mode 100644 index b83cebf7a..000000000 --- a/src/Svg.SourceGenerator.Skia/SkiaGeneratorAssetLoader.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; - -namespace Svg.SourceGenerator.Skia; - -public class SkiaGeneratorAssetLoader : Model.IAssetLoader -{ - public ShimSkiaSharp.SKImage LoadImage(System.IO.Stream stream) - { - var data = ShimSkiaSharp.SKImage.FromStream(stream); - using var image = SkiaSharp.SKImage.FromEncodedData(data); - return new ShimSkiaSharp.SKImage {Data = data, Width = image.Width, Height = image.Height}; - } - - public List FindTypefaces(string? text, ShimSkiaSharp.SKPaint paintPreferredTypeface) - { - if (text is null || string.IsNullOrEmpty(text)) - { - return new List(); - } - - // TODO: - // Font fallback and text advancing code should be generated along with canvas commands instead. - // Otherwise, some package reference hacking may be needed. - return new List - { - new(text, text.Length * paintPreferredTypeface.TextSize, paintPreferredTypeface.Typeface) - }; - } -} diff --git a/src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.csproj b/src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.csproj deleted file mode 100644 index 7644b5ef1..000000000 --- a/src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.csproj +++ /dev/null @@ -1,76 +0,0 @@ - - - - Library - netstandard2.0 - enable - True - False - False - True - true - - - - An Svg drawing markup to C# source generator using SkiaSharp as rendering engine. - Svg.SourceGenerator.Skia - MIT - svg;skia;skiasharp;sourcegenerator;compiler;csharp;codegen;graphics - - - - - - - - - CodeGen\SkiaCSharpCodeGen.cs - - - CodeGen\SkiaCSharpModelExtensions.cs - - - CodeGen\SkiaCSharpCodeGenCounter.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(GetTargetPathDependsOn);GetDependencyTargetPaths - - - - - - - - - - - - - - diff --git a/src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.props b/src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.props deleted file mode 100644 index 9609be5dc..000000000 --- a/src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Svg.SourceGenerator.Skia/SvgSourceGenerator.cs b/src/Svg.SourceGenerator.Skia/SvgSourceGenerator.cs deleted file mode 100644 index 2f5ff5b97..000000000 --- a/src/Svg.SourceGenerator.Skia/SvgSourceGenerator.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable -using System; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; -using Svg.CodeGen.Skia; - -namespace Svg.SourceGenerator.Skia; - -[Generator] -public class SvgSourceGenerator : ISourceGenerator -{ - private static readonly Model.IAssetLoader s_assetLoader = new SkiaGeneratorAssetLoader(); - - private static readonly DiagnosticDescriptor s_errorDescriptor = new( -#pragma warning disable RS2008 // Enable analyzer release tracking - "SVG0001", -#pragma warning restore RS2008 // Enable analyzer release tracking - $"Error in the {nameof(SvgSourceGenerator)} generator", - $"Error in the {nameof(SvgSourceGenerator)} generator: " + "{0}", - $"{nameof(SvgSourceGenerator)}", - DiagnosticSeverity.Error, - isEnabledByDefault: true); - - public void Initialize(GeneratorInitializationContext context) - { - // System.Diagnostics.Debugger.Launch(); - } - - public void Execute(GeneratorExecutionContext context) - { - try - { - context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.NamespaceName", out var globalNamespaceName); - - var files = context.AdditionalFiles.Where(at => at.Path.EndsWith(".svg", StringComparison.InvariantCultureIgnoreCase)); - - foreach (var file in files) - { - string? namespaceName = null; - - if (!string.IsNullOrWhiteSpace(globalNamespaceName)) - { - namespaceName = globalNamespaceName; - } - - if (context.AnalyzerConfigOptions.GetOptions(file).TryGetValue("build_metadata.AdditionalFiles.NamespaceName", out var perFilenamespaceName)) - { - if (!string.IsNullOrWhiteSpace(perFilenamespaceName)) - { - namespaceName = perFilenamespaceName; - } - } - - if (string.IsNullOrWhiteSpace(namespaceName)) - { - namespaceName = "Svg"; - } - - context.AnalyzerConfigOptions.GetOptions(file).TryGetValue("build_metadata.AdditionalFiles.ClassName", out var className); - - if (string.IsNullOrWhiteSpace(className)) - { - className = CreateClassName(file.Path); - } - - if (string.IsNullOrWhiteSpace(namespaceName)) - { - context.ReportDiagnostic(Diagnostic.Create(s_errorDescriptor, Location.None, "The specified namespace name is invalid.")); - return; - } - - if (string.IsNullOrWhiteSpace(className)) - { - context.ReportDiagnostic(Diagnostic.Create(s_errorDescriptor, Location.None, "The specified class name is invalid.")); - return; - } - - var svg = file.GetText(context.CancellationToken)?.ToString(); - if (string.IsNullOrWhiteSpace(svg)) - { - context.ReportDiagnostic(Diagnostic.Create(s_errorDescriptor, Location.None, "Svg file is null or empty.")); - return; - } - - var svgDocument = Svg.Model.SvgExtensions.FromSvg(svg!); - if (svgDocument is { }) - { - var picture = Svg.Model.SvgExtensions.ToModel(svgDocument, s_assetLoader, out _, out _); - if (picture is { } && picture.Commands is { }) - { - var code = SkiaCSharpCodeGen.Generate(picture, namespaceName!, className!); - var sourceText = SourceText.From(code, Encoding.UTF8); - context.AddSource($"{className}.svg.cs", sourceText); - } - else - { - context.ReportDiagnostic(Diagnostic.Create(s_errorDescriptor, Location.None, "Invalid svg picture model.")); - return; - } - } - else - { - context.ReportDiagnostic(Diagnostic.Create(s_errorDescriptor, Location.None, "Could not load svg document.")); - return; - } - } - } - catch (Exception e) - { - context.ReportDiagnostic(Diagnostic.Create(s_errorDescriptor, Location.None, e.Message + " " + e.StackTrace)); - } - } - - // https://gist.github.com/FabienDehopre/5245476 - private const string FormattingCharacter = @"\p{Cf}"; - private const string ConnectingCharacter = @"\p{Pc}"; - private const string DecimalDigitCharacter = @"\p{Nd}"; - private const string CombiningCharacter = @"\p{Mn}|\p{Mc}"; - private const string LetterCharacter = @"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}"; - private const string IdentifierPartCharacter = LetterCharacter + "|" + - DecimalDigitCharacter + "|" + - ConnectingCharacter + "|" + - CombiningCharacter + "|" + - FormattingCharacter; - private const string InvalidIdentifierCharacterRegex = "(?!" + IdentifierPartCharacter + ")."; - private static readonly Regex s_regexReplaceName = new Regex(InvalidIdentifierCharacterRegex, RegexOptions.Compiled); - - private string CreateClassName(string path) - { - string name = System.IO.Path.GetFileNameWithoutExtension(path); - string className = s_regexReplaceName.Replace(name, "_"); - return $"Svg_{className}"; - } -}