|
@@ -1,52 +1,6 @@
|
|
-#nullable enable
|
|
|
|
|
|
+#nullable enable
|
|
namespace Terminal.Gui;
|
|
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>
|
|
/// <summary>Facilitates box drawing and line intersection detection and rendering. Does not support diagonal lines.</summary>
|
|
public class LineCanvas : IDisposable
|
|
public class LineCanvas : IDisposable
|
|
{
|
|
{
|
|
@@ -892,68 +846,4 @@ public class LineCanvas : IDisposable
|
|
_normal = Glyphs.URCorner;
|
|
_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
|
|
|
|
-}
|
|
|
|
|
|
+}
|