Browse Source

Get rid of not needed interfaces.

Dariusz Komosinski 6 years ago
parent
commit
1b869ff27b

+ 0 - 12
src/Avalonia.Visuals/Platform/IEllipseGeometryImpl.cs

@@ -1,12 +0,0 @@
-// Copyright (c) The Avalonia Project. All rights reserved.
-// Licensed under the MIT license. See licence.md file in the project root for full license information.
-
-namespace Avalonia.Platform
-{
-    /// <summary>
-    /// Defines the platform-specific interface for a <see cref="Avalonia.Media.EllipseGeometry"/>.
-    /// </summary>
-    public interface IEllipseGeometryImpl : IGeometryImpl
-    {
-    }
-}

+ 0 - 12
src/Avalonia.Visuals/Platform/ILineGeometryImpl.cs

@@ -1,12 +0,0 @@
-// Copyright (c) The Avalonia Project. All rights reserved.
-// Licensed under the MIT license. See licence.md file in the project root for full license information.
-
-namespace Avalonia.Platform
-{
-    /// <summary>
-    /// Defines the platform-specific interface for a <see cref="Avalonia.Media.LineGeometry"/>.
-    /// </summary>
-    public interface ILineGeometryImpl : IGeometryImpl
-    {
-    }
-}

+ 6 - 6
src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs

@@ -40,23 +40,23 @@ namespace Avalonia.Platform
         /// Creates an ellipse geometry implementation.
         /// </summary>
         /// <param name="rect">The bounds of the ellipse.</param>
-        /// <returns>An <see cref="IEllipseGeometryImpl"/>.</returns>
-        IEllipseGeometryImpl CreateEllipseGeometry(Rect rect);
+        /// <returns>An ellipse geometry..</returns>
+        IGeometryImpl CreateEllipseGeometry(Rect rect);
 
         /// <summary>
         /// Creates a line geometry implementation.
         /// </summary>
         /// <param name="p1">The start of the line.</param>
         /// <param name="p2">The end of the line.</param>
-        /// <returns>An <see cref="ILineGeometryImpl"/>.</returns>
-        ILineGeometryImpl CreateLineGeometry(Point p1, Point p2);
+        /// <returns>A line geometry.</returns>
+        IGeometryImpl CreateLineGeometry(Point p1, Point p2);
 
         /// <summary>
         /// Creates a rectangle geometry implementation.
         /// </summary>
         /// <param name="rect">The bounds of the rectangle.</param>
-        /// <returns>An <see cref="IRectangleGeometryImpl"/>.</returns>
-        IRectangleGeometryImpl CreateRectangleGeometry(Rect rect);
+        /// <returns>A rectangle.</returns>
+        IGeometryImpl CreateRectangleGeometry(Rect rect);
 
         /// <summary>
         /// Creates a stream geometry implementation.

+ 0 - 12
src/Avalonia.Visuals/Platform/IRectangleGeometryImpl.cs

@@ -1,12 +0,0 @@
-// Copyright (c) The Avalonia Project. All rights reserved.
-// Licensed under the MIT license. See licence.md file in the project root for full license information.
-
-namespace Avalonia.Platform
-{
-    /// <summary>
-    /// Defines the platform-specific interface for a <see cref="Avalonia.Media.RectangleGeometry"/>.
-    /// </summary>
-    public interface IRectangleGeometryImpl : IGeometryImpl
-    {
-    }
-}

+ 1 - 2
src/Skia/Avalonia.Skia/EllipseGeometryImpl.cs

@@ -1,7 +1,6 @@
 // Copyright (c) The Avalonia Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
-using Avalonia.Platform;
 using SkiaSharp;
 
 namespace Avalonia.Skia
@@ -9,7 +8,7 @@ namespace Avalonia.Skia
     /// <summary>
     /// A Skia implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>.
     /// </summary>
-    internal class EllipseGeometryImpl : GeometryImpl, IEllipseGeometryImpl
+    internal class EllipseGeometryImpl : GeometryImpl
     {
         public override Rect Bounds { get; }
         public override SKPath EffectivePath { get; }

+ 1 - 2
src/Skia/Avalonia.Skia/LineGeometryImpl.cs

@@ -2,7 +2,6 @@
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
 using System;
-using Avalonia.Platform;
 using SkiaSharp;
 
 namespace Avalonia.Skia
@@ -10,7 +9,7 @@ namespace Avalonia.Skia
     /// <summary>
     /// A Skia implementation of a <see cref="Avalonia.Media.LineGeometry"/>.
     /// </summary>
-    internal class LineGeometryImpl : GeometryImpl, ILineGeometryImpl
+    internal class LineGeometryImpl : GeometryImpl
     {
         public override Rect Bounds { get; }
         public override SKPath EffectivePath { get; }

+ 3 - 3
src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

@@ -50,11 +50,11 @@ namespace Avalonia.Skia
             return new FormattedTextImpl(text, typeface, textAlignment, wrapping, constraint, spans);
         }
 
-        public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);
+        public IGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);
 
-        public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2);
+        public IGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2);
 
-        public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect);
+        public IGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect);
 
         /// <inheritdoc />
         public IStreamGeometryImpl CreateStreamGeometry()

+ 1 - 2
src/Skia/Avalonia.Skia/RectangleGeometryImpl.cs

@@ -1,7 +1,6 @@
 // Copyright (c) The Avalonia Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
-using Avalonia.Platform;
 using SkiaSharp;
 
 namespace Avalonia.Skia
@@ -9,7 +8,7 @@ namespace Avalonia.Skia
     /// <summary>
     /// A Skia implementation of a <see cref="Avalonia.Media.RectangleGeometry"/>.
     /// </summary>
-    internal class RectangleGeometryImpl : GeometryImpl, IRectangleGeometryImpl
+    internal class RectangleGeometryImpl : GeometryImpl
     {
         public override Rect Bounds { get; }
         public override SKPath EffectivePath { get; }

+ 3 - 3
src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

@@ -182,9 +182,9 @@ namespace Avalonia.Direct2D1
             return new WriteableWicBitmapImpl(size, dpi, format);
         }
 
-        public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);
-        public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2);
-        public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect);
+        public IGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);
+        public IGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2);
+        public IGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect);
         public IStreamGeometryImpl CreateStreamGeometry() => new StreamGeometryImpl();
 
         public IBitmapImpl LoadBitmap(string fileName)

+ 1 - 2
src/Windows/Avalonia.Direct2D1/Media/EllipseGeometryImpl.cs

@@ -1,7 +1,6 @@
 // Copyright (c) The Avalonia Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
-using Avalonia.Platform;
 using SharpDX.Direct2D1;
 
 namespace Avalonia.Direct2D1.Media
@@ -9,7 +8,7 @@ namespace Avalonia.Direct2D1.Media
     /// <summary>
     /// A Direct2D implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>.
     /// </summary>
-    internal class EllipseGeometryImpl : GeometryImpl, IEllipseGeometryImpl
+    internal class EllipseGeometryImpl : GeometryImpl
     {
         /// <summary>
         /// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class.

+ 1 - 2
src/Windows/Avalonia.Direct2D1/Media/LineGeometryImpl.cs

@@ -1,7 +1,6 @@
 // Copyright (c) The Avalonia Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
-using Avalonia.Platform;
 using SharpDX.Direct2D1;
 
 namespace Avalonia.Direct2D1.Media
@@ -9,7 +8,7 @@ namespace Avalonia.Direct2D1.Media
     /// <summary>
     /// A Direct2D implementation of a <see cref="Avalonia.Media.LineGeometry"/>.
     /// </summary>
-    internal class LineGeometryImpl : StreamGeometryImpl, ILineGeometryImpl
+    internal class LineGeometryImpl : StreamGeometryImpl
     {
         /// <summary>
         /// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class.

+ 1 - 2
src/Windows/Avalonia.Direct2D1/Media/RectangleGeometryImpl.cs

@@ -1,7 +1,6 @@
 // Copyright (c) The Avalonia Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
-using Avalonia.Platform;
 using SharpDX.Direct2D1;
 
 namespace Avalonia.Direct2D1.Media
@@ -9,7 +8,7 @@ namespace Avalonia.Direct2D1.Media
     /// <summary>
     /// A Direct2D implementation of a <see cref="Avalonia.Media.RectangleGeometry"/>.
     /// </summary>
-    internal class RectangleGeometryImpl : GeometryImpl, IRectangleGeometryImpl
+    internal class RectangleGeometryImpl : GeometryImpl
     {
         /// <summary>
         /// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class.

+ 6 - 6
tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs

@@ -22,19 +22,19 @@ namespace Avalonia.UnitTests
             return Mock.Of<IFormattedTextImpl>();
         }
 
-        public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect)
+        public IGeometryImpl CreateEllipseGeometry(Rect rect)
         {
-            return Mock.Of<IEllipseGeometryImpl>();
+            return Mock.Of<IGeometryImpl>();
         }
 
-        public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2)
+        public IGeometryImpl CreateLineGeometry(Point p1, Point p2)
         {
-            return Mock.Of<ILineGeometryImpl>();
+            return Mock.Of<IGeometryImpl>();
         }
 
-        public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect)
+        public IGeometryImpl CreateRectangleGeometry(Rect rect)
         {
-            return Mock.Of<IRectangleGeometryImpl>();
+            return Mock.Of<IGeometryImpl>();
         }
 
         public IRenderTarget CreateRenderTarget(IEnumerable<object> surfaces)

+ 3 - 3
tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs

@@ -56,17 +56,17 @@ namespace Avalonia.Visuals.UnitTests.VisualTree
             throw new NotImplementedException();
         }
 
-        public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect)
+        public IGeometryImpl CreateEllipseGeometry(Rect rect)
         {
             throw new NotImplementedException();
         }
 
-        public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2)
+        public IGeometryImpl CreateLineGeometry(Point p1, Point p2)
         {
             throw new NotImplementedException();
         }
 
-        public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect)
+        public IGeometryImpl CreateRectangleGeometry(Rect rect)
         {
             throw new NotImplementedException();
         }