diff --git a/Demos/Sharpie.Demos.Bounce/Program.cs b/Demos/Sharpie.Demos.Bounce/Program.cs index d48c6da..e879253 100644 --- a/Demos/Sharpie.Demos.Bounce/Program.cs +++ b/Demos/Sharpie.Demos.Bounce/Program.cs @@ -35,7 +35,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE [assembly: ExcludeFromCodeCoverage] // Create the main terminal instance. -using var terminal = new Terminal(NativeCursesProvider.Instance, new(CaretMode: CaretMode.Invisible)); +using var terminal = new Terminal(CursesBackend.NCurses(), new(CaretMode: CaretMode.Invisible)); // Prepare styles var styles = Enum.GetValues() diff --git a/Demos/Sharpie.Demos.Events/Program.cs b/Demos/Sharpie.Demos.Events/Program.cs index b73a386..d2a7449 100644 --- a/Demos/Sharpie.Demos.Events/Program.cs +++ b/Demos/Sharpie.Demos.Events/Program.cs @@ -34,8 +34,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE [assembly: ExcludeFromCodeCoverage] + + // Create the terminal instance without any non-standard settings. -using var terminal = new Terminal(NativeCursesProvider.Instance, new()); +using var terminal = new Terminal(CursesBackend.NCurses(), new()); // Set the main screen attributes for text and drawings. terminal.Screen.ColorMixture = terminal.Colors.MixColors(StandardColor.Green, StandardColor.Blue); diff --git a/Demos/Sharpie.Demos.Font/Program.cs b/Demos/Sharpie.Demos.Font/Program.cs index 3a6eab8..f751223 100644 --- a/Demos/Sharpie.Demos.Font/Program.cs +++ b/Demos/Sharpie.Demos.Font/Program.cs @@ -36,7 +36,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE [assembly: ExcludeFromCodeCoverage] // Create a new terminal instance with an invisible cursor. -using var terminal = new Terminal(NativeCursesProvider.Instance, new(CaretMode: CaretMode.Invisible)); +using var terminal = new Terminal(CursesBackend.NCurses(), new(CaretMode: CaretMode.Invisible)); // Setup the message and a number of rotating styles that will be applied for each letter of the message. var message = "\x001 Let the ASCII fun begin! \x003"; diff --git a/Demos/Sharpie.Demos.Slk/Program.cs b/Demos/Sharpie.Demos.Slk/Program.cs index 05711a4..ad48e2d 100644 --- a/Demos/Sharpie.Demos.Slk/Program.cs +++ b/Demos/Sharpie.Demos.Slk/Program.cs @@ -36,7 +36,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE [assembly: ExcludeFromCodeCoverage] // Create the main terminal instance and enable 4 * 4 SLK mode, -using var terminal = new Terminal(NativeCursesProvider.Instance, +using var terminal = new Terminal(CursesBackend.NCurses(), new(CaretMode: CaretMode.Invisible, UseMouse: true, SoftLabelKeyMode: SoftLabelKeyMode.FourFour, AllocateHeader: true)); diff --git a/Demos/Sharpie.Demos.Snake/Program.cs b/Demos/Sharpie.Demos.Snake/Program.cs index 15d550e..3785eb2 100644 --- a/Demos/Sharpie.Demos.Snake/Program.cs +++ b/Demos/Sharpie.Demos.Snake/Program.cs @@ -37,7 +37,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE [assembly: ExcludeFromCodeCoverage] // Create the main terminal instance. -using var terminal = new Terminal(NativeCursesProvider.Instance, +using var terminal = new Terminal(CursesBackend.NCurses(), new(CaretMode: CaretMode.Invisible, UseMouse: false, AllocateHeader: true)); // Configure the header. diff --git a/Demos/Sharpie.Demos.Windows/Program.cs b/Demos/Sharpie.Demos.Windows/Program.cs index ad54c5d..9d22089 100644 --- a/Demos/Sharpie.Demos.Windows/Program.cs +++ b/Demos/Sharpie.Demos.Windows/Program.cs @@ -34,7 +34,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE [assembly: ExcludeFromCodeCoverage] using var terminal = - new Terminal(NativeCursesProvider.Instance, new(CaretMode: CaretMode.Visible, ManagedWindows: true)); + new Terminal(CursesBackend.NCurses(), new(CaretMode: CaretMode.Visible, ManagedWindows: true)); var rnd = new Random(); diff --git a/Sharpie.Tests/CanvasTests.cs b/Sharpie.Tests/CanvasTests.cs index e6e994a..0056c83 100644 --- a/Sharpie.Tests/CanvasTests.cs +++ b/Sharpie.Tests/CanvasTests.cs @@ -100,12 +100,13 @@ public void DrawOnto_DrawsTheAdjustedArea() _canvas2X2.Glyph(new(1, 0), new('B'), _style1); _canvas2X2.Glyph(new(0, 1), new('C'), _style1); _canvas2X2.Glyph(new(1, 1), new('D'), _style1); - + _canvas2X2.DrawOnto(_drawSurfaceMock.Object, new(0, 0, 2, 2), new(9, 8)); _drawSurfaceMock.Verify(v => v.DrawCell(new(9, 8), new('A'), _style1), Times.Once); _drawSurfaceMock.Verify(v => v.DrawCell(new(9, 9), new('C'), _style1), Times.Once); - _drawSurfaceMock.Verify(v => v.DrawCell(It.IsAny(), It.IsAny(), It.IsAny