Browse Source

Split to one type per file

Brandon Thetford 1 year ago
parent
commit
b4795c722a

+ 20 - 0
Terminal.Gui/Drawing/IntersectionDefinition.cs

@@ -0,0 +1,20 @@
+namespace Terminal.Gui;
+
+internal class IntersectionDefinition
+{
+    internal IntersectionDefinition (Point point, IntersectionType type, StraightLine line)
+    {
+        Point = point;
+        Type = type;
+        Line = line;
+    }
+
+    /// <summary>The line that intersects <see cref="Point"/></summary>
+    internal StraightLine Line { get; }
+
+    /// <summary>The point at which the intersection happens</summary>
+    internal Point Point { get; }
+
+    /// <summary>Defines how <see cref="Line"/> position relates to <see cref="Point"/>.</summary>
+    internal IntersectionType Type { get; }
+}

+ 19 - 0
Terminal.Gui/Drawing/IntersectionRuneType.cs

@@ -0,0 +1,19 @@
+namespace Terminal.Gui;
+
+/// <summary>The type of Rune that we will use before considering double width, curved borders etc</summary>
+internal enum IntersectionRuneType
+{
+    None,
+    Dot,
+    ULCorner,
+    URCorner,
+    LLCorner,
+    LRCorner,
+    TopTee,
+    BottomTee,
+    RightTee,
+    LeftTee,
+    Cross,
+    HLine,
+    VLine
+}

+ 28 - 0
Terminal.Gui/Drawing/IntersectionType.cs

@@ -0,0 +1,28 @@
+namespace Terminal.Gui;
+
+internal enum IntersectionType
+{
+    /// <summary>There is no intersection</summary>
+    None,
+
+    /// <summary>A line passes directly over this point traveling along the horizontal axis</summary>
+    PassOverHorizontal,
+
+    /// <summary>A line passes directly over this point traveling along the vertical axis</summary>
+    PassOverVertical,
+
+    /// <summary>A line starts at this point and is traveling up</summary>
+    StartUp,
+
+    /// <summary>A line starts at this point and is traveling right</summary>
+    StartRight,
+
+    /// <summary>A line starts at this point and is traveling down</summary>
+    StartDown,
+
+    /// <summary>A line starts at this point and is traveling left</summary>
+    StartLeft,
+
+    /// <summary>A line exists at this point who has 0 length</summary>
+    Dot
+}

+ 2 - 112
Terminal.Gui/Drawing/LineCanvas.cs

@@ -1,52 +1,6 @@
-#nullable enable
+#nullable enable
 namespace Terminal.Gui;
 
-/// <summary>Defines the style of lines for a <see cref="LineCanvas"/>.</summary>
-public enum LineStyle
-{
-    /// <summary>No border is drawn.</summary>
-    None,
-
-    /// <summary>The border is drawn using thin line CM.Glyphs.</summary>
-    Single,
-
-    /// <summary>The border is drawn using thin line glyphs with dashed (double and triple) straight lines.</summary>
-    Dashed,
-
-    /// <summary>The border is drawn using thin line glyphs with short dashed (triple and quadruple) straight lines.</summary>
-    Dotted,
-
-    /// <summary>The border is drawn using thin double line CM.Glyphs.</summary>
-    Double,
-
-    /// <summary>The border is drawn using heavy line CM.Glyphs.</summary>
-    Heavy,
-
-    /// <summary>The border is drawn using heavy line glyphs with dashed (double and triple) straight lines.</summary>
-    HeavyDashed,
-
-    /// <summary>The border is drawn using heavy line glyphs with short dashed (triple and quadruple) straight lines.</summary>
-    HeavyDotted,
-
-    /// <summary>The border is drawn using thin line glyphs with rounded corners.</summary>
-    Rounded,
-
-    /// <summary>The border is drawn using thin line glyphs with rounded corners and dashed (double and triple) straight lines.</summary>
-    RoundedDashed,
-
-    /// <summary>
-    ///     The border is drawn using thin line glyphs with rounded corners and short dashed (triple and quadruple)
-    ///     straight lines.
-    /// </summary>
-    RoundedDotted
-
-    // TODO: Support Ruler
-    ///// <summary> 
-    ///// The border is drawn as a diagnostic ruler ("|123456789...").
-    ///// </summary>
-    //Ruler
-}
-
 /// <summary>Facilitates box drawing and line intersection detection and rendering.  Does not support diagonal lines.</summary>
 public class LineCanvas : IDisposable
 {
@@ -892,68 +846,4 @@ public class LineCanvas : IDisposable
             _normal = Glyphs.URCorner;
         }
     }
-}
-
-internal class IntersectionDefinition
-{
-    internal IntersectionDefinition (Point point, IntersectionType type, StraightLine line)
-    {
-        Point = point;
-        Type = type;
-        Line = line;
-    }
-
-    /// <summary>The line that intersects <see cref="Point"/></summary>
-    internal StraightLine Line { get; }
-
-    /// <summary>The point at which the intersection happens</summary>
-    internal Point Point { get; }
-
-    /// <summary>Defines how <see cref="Line"/> position relates to <see cref="Point"/>.</summary>
-    internal IntersectionType Type { get; }
-}
-
-/// <summary>The type of Rune that we will use before considering double width, curved borders etc</summary>
-internal enum IntersectionRuneType
-{
-    None,
-    Dot,
-    ULCorner,
-    URCorner,
-    LLCorner,
-    LRCorner,
-    TopTee,
-    BottomTee,
-    RightTee,
-    LeftTee,
-    Cross,
-    HLine,
-    VLine
-}
-
-internal enum IntersectionType
-{
-    /// <summary>There is no intersection</summary>
-    None,
-
-    /// <summary>A line passes directly over this point traveling along the horizontal axis</summary>
-    PassOverHorizontal,
-
-    /// <summary>A line passes directly over this point traveling along the vertical axis</summary>
-    PassOverVertical,
-
-    /// <summary>A line starts at this point and is traveling up</summary>
-    StartUp,
-
-    /// <summary>A line starts at this point and is traveling right</summary>
-    StartRight,
-
-    /// <summary>A line starts at this point and is traveling down</summary>
-    StartDown,
-
-    /// <summary>A line starts at this point and is traveling left</summary>
-    StartLeft,
-
-    /// <summary>A line exists at this point who has 0 length</summary>
-    Dot
-}
+}

+ 48 - 0
Terminal.Gui/Drawing/LineStyle.cs

@@ -0,0 +1,48 @@
+#nullable enable
+namespace Terminal.Gui;
+
+/// <summary>Defines the style of lines for a <see cref="LineCanvas"/>.</summary>
+public enum LineStyle
+{
+    /// <summary>No border is drawn.</summary>
+    None,
+
+    /// <summary>The border is drawn using thin line CM.Glyphs.</summary>
+    Single,
+
+    /// <summary>The border is drawn using thin line glyphs with dashed (double and triple) straight lines.</summary>
+    Dashed,
+
+    /// <summary>The border is drawn using thin line glyphs with short dashed (triple and quadruple) straight lines.</summary>
+    Dotted,
+
+    /// <summary>The border is drawn using thin double line CM.Glyphs.</summary>
+    Double,
+
+    /// <summary>The border is drawn using heavy line CM.Glyphs.</summary>
+    Heavy,
+
+    /// <summary>The border is drawn using heavy line glyphs with dashed (double and triple) straight lines.</summary>
+    HeavyDashed,
+
+    /// <summary>The border is drawn using heavy line glyphs with short dashed (triple and quadruple) straight lines.</summary>
+    HeavyDotted,
+
+    /// <summary>The border is drawn using thin line glyphs with rounded corners.</summary>
+    Rounded,
+
+    /// <summary>The border is drawn using thin line glyphs with rounded corners and dashed (double and triple) straight lines.</summary>
+    RoundedDashed,
+
+    /// <summary>
+    ///     The border is drawn using thin line glyphs with rounded corners and short dashed (triple and quadruple)
+    ///     straight lines.
+    /// </summary>
+    RoundedDotted
+
+    // TODO: Support Ruler
+    ///// <summary> 
+    ///// The border is drawn as a diagnostic ruler ("|123456789...").
+    ///// </summary>
+    //Ruler
+}