1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- namespace Terminal.Gui;
- /// <summary>
- /// Represents a single row/column in a Terminal.Gui rendering surface (e.g. <see cref="LineCanvas"/> and
- /// <see cref="ConsoleDriver"/>).
- /// </summary>
- public record struct Cell ()
- {
- /// <summary>The attributes to use when drawing the Glyph.</summary>
- public Attribute? Attribute { get; set; } = null;
- /// <summary>
- /// Gets or sets a value indicating whether this <see cref="T:Terminal.Gui.Cell"/> has been modified since the
- /// last time it was drawn.
- /// </summary>
- public bool IsDirty { get; set; } = false;
- private Rune _rune = default;
- /// <summary>The character to display. If <see cref="Rune"/> is <see langword="null"/>, then <see cref="Rune"/> is ignored.</summary>
- public Rune Rune
- {
- get => _rune;
- set
- {
- CombiningMarks.Clear ();
- _rune = value;
- }
- }
- /// <summary>
- /// The combining marks for <see cref="Rune"/> that when combined makes this Cell a combining sequence. If
- /// <see cref="CombiningMarks"/> empty, then <see cref="CombiningMarks"/> is ignored.
- /// </summary>
- /// <remarks>
- /// Only valid in the rare case where <see cref="Rune"/> is a combining sequence that could not be normalized to a
- /// single Rune.
- /// </remarks>
- internal List<Rune> CombiningMarks { get; } = new ();
- /// <inheritdoc/>
- public override string ToString () { return $"[{Rune}, {Attribute}]"; }
- }
|