package miaou-driver-matrix

  1. Overview
  2. Docs

Module Miaou_driver_matrix.Matrix_cellSource

Terminal cell representation for the Matrix driver.

A cell represents a single character position on the terminal with its associated styling (colors, bold, dim, etc.).

Sourcetype style = {
  1. fg : int;
    (*

    Foreground color: -1 = default, 0-255 = 256-color palette

    *)
  2. bg : int;
    (*

    Background color: -1 = default, 0-255 = 256-color palette

    *)
  3. bold : bool;
  4. dim : bool;
  5. underline : bool;
  6. reverse : bool;
  7. url : string;
    (*

    OSC 8 hyperlink URL, "" = no link

    *)
}

Style attributes for a cell.

Sourcetype t = {
  1. mutable char : string;
    (*

    UTF-8 grapheme cluster, " " for empty/space

    *)
  2. mutable style : style;
}

A terminal cell containing a character and its style.

Sourceval default_style : style

Default style: no colors, no attributes.

Sourceval empty : unit -> t

Empty cell: space character with default style.

Sourceval create : char:string -> style:style -> t

Create a new cell with given character and style.

Sourceval copy : t -> t

Create a copy of a cell.

Sourceval reset : t -> unit

Reset a cell to empty state (space with default style).

Sourceval invalidate : t -> unit

Invalidate a cell so it never equals any valid cell. Used for force-redraw scenarios where we need to ensure the diff outputs changes even for cells that might otherwise appear unchanged. Sets char to \x00 which never appears in normal content.

Sourceval style_equal : style -> style -> bool

Check if two styles are equal.

Sourceval equal : t -> t -> bool

Check if two cells are equal (same char and style).

Sourceval is_empty : t -> bool

Check if a cell is empty (space with default style).