Refactored Application into smaller files.

Made Application #nullable enable
This commit is contained in:
Tig
2024-07-22 16:52:02 -06:00
parent 14d8bf5ba3
commit 44ce74a5c0
71 changed files with 1449 additions and 1441 deletions

View File

@@ -29,7 +29,7 @@ public class RulerTests
[AutoInitShutdown]
public void Draw_Default ()
{
((FakeDriver)Application.Driver).SetBufferSize (25, 25);
((FakeDriver)Application.Driver!).SetBufferSize (25, 25);
var r = new Ruler ();
r.Draw (Point.Empty);
@@ -47,7 +47,7 @@ public class RulerTests
var top = new Toplevel ();
top.Add (f);
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (len + 5, 5);
((FakeDriver)Application.Driver!).SetBufferSize (len + 5, 5);
Assert.Equal (new (0, 0, len + 5, 5), f.Frame);
var r = new Ruler ();
@@ -121,7 +121,7 @@ public class RulerTests
var top = new Toplevel ();
top.Add (f);
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (len + 5, 5);
((FakeDriver)Application.Driver!).SetBufferSize (len + 5, 5);
Assert.Equal (new (0, 0, len + 5, 5), f.Frame);
var r = new Ruler ();
@@ -168,7 +168,7 @@ public class RulerTests
var top = new Toplevel ();
top.Add (f);
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (5, len + 5);
((FakeDriver)Application.Driver!).SetBufferSize (5, len + 5);
Assert.Equal (new (0, 0, 5, len + 5), f.Frame);
var r = new Ruler ();
@@ -302,7 +302,7 @@ public class RulerTests
var top = new Toplevel ();
top.Add (f);
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (5, len + 5);
((FakeDriver)Application.Driver!).SetBufferSize (5, len + 5);
Assert.Equal (new (0, 0, 5, len + 5), f.Frame);
var r = new Ruler ();

View File

@@ -51,13 +51,13 @@ public class ThicknessTests (ITestOutputHelper output)
[AutoInitShutdown]
public void DrawTests ()
{
((FakeDriver)Application.Driver).SetBufferSize (60, 60);
((FakeDriver)Application.Driver!).SetBufferSize (60, 60);
var t = new Thickness (0, 0, 0, 0);
var r = new Rectangle (5, 5, 40, 15);
View.Diagnostics |= ViewDiagnosticFlags.Padding;
Application.Driver.FillRect (
new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
Application.Driver?.FillRect (
new Rectangle (0, 0, Application.Driver!.Cols, Application.Driver!.Rows),
(Rune)' '
);
t.Draw (r, "Test");
@@ -73,8 +73,8 @@ public class ThicknessTests (ITestOutputHelper output)
r = new Rectangle (5, 5, 40, 15);
View.Diagnostics |= ViewDiagnosticFlags.Padding;
Application.Driver.FillRect (
new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
Application.Driver?.FillRect (
new Rectangle (0, 0, Application.Driver!.Cols, Application.Driver!.Rows),
(Rune)' '
);
t.Draw (r, "Test");
@@ -104,8 +104,8 @@ public class ThicknessTests (ITestOutputHelper output)
r = new Rectangle (5, 5, 40, 15);
View.Diagnostics |= ViewDiagnosticFlags.Padding;
Application.Driver.FillRect (
new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
Application.Driver?.FillRect (
new Rectangle (0, 0, Application.Driver!.Cols, Application.Driver!.Rows),
(Rune)' '
);
t.Draw (r, "Test");
@@ -135,8 +135,8 @@ public class ThicknessTests (ITestOutputHelper output)
r = new Rectangle (5, 5, 40, 15);
View.Diagnostics |= ViewDiagnosticFlags.Padding;
Application.Driver.FillRect (
new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
Application.Driver?.FillRect (
new Rectangle (0, 0, Application.Driver!.Cols, Application.Driver!.Rows),
(Rune)' '
);
t.Draw (r, "Test");
@@ -174,7 +174,7 @@ public class ThicknessTests (ITestOutputHelper output)
top.Add (f);
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (45, 20);
((FakeDriver)Application.Driver!).SetBufferSize (45, 20);
var t = new Thickness (0, 0, 0, 0);
var r = new Rectangle (2, 2, 40, 15);
Application.Refresh ();