aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/include/ghostty/vt/render.h
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-01 23:05:23 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-01 23:05:51 +0300
commit5bd21b7ed468b5ff4d1a5b2ed7e211f401eb138a (patch)
tree672fa4625cca0ecb3e9376fc7f8e33d7b0e9deef /vendor/libghostty-vt/include/ghostty/vt/render.h
parent32abb3776668ee768200019c170956f67fe33a86 (diff)
chore: update libghostty vendor
refs #276
Diffstat (limited to 'vendor/libghostty-vt/include/ghostty/vt/render.h')
-rw-r--r--vendor/libghostty-vt/include/ghostty/vt/render.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/include/ghostty/vt/render.h b/vendor/libghostty-vt/include/ghostty/vt/render.h
index d1a3687d..c5b1d0d4 100644
--- a/vendor/libghostty-vt/include/ghostty/vt/render.h
+++ b/vendor/libghostty-vt/include/ghostty/vt/render.h
@@ -221,6 +221,9 @@ typedef enum GHOSTTY_ENUM_TYPED {
* valid as long as the underlying render state is not updated.
* It is unsafe to use cell data after updating the render state. */
GHOSTTY_RENDER_STATE_ROW_DATA_CELLS = 3,
+
+ /** Row-local selected cell range (GhosttyRenderStateRowSelection). */
+ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION = 4,
GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
} GhosttyRenderStateRowData;
@@ -236,6 +239,29 @@ typedef enum GHOSTTY_ENUM_TYPED {
} GhosttyRenderStateRowOption;
/**
+ * Row-local selection range.
+ *
+ * This struct uses the sized-struct ABI pattern. Initialize with
+ * GHOSTTY_INIT_SIZED(GhosttyRenderStateRowSelection) before querying
+ * GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION.
+ *
+ * Querying GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION returns GHOSTTY_NO_VALUE
+ * if the current row does not intersect the current selection.
+ *
+ * @ingroup render
+ */
+typedef struct {
+ /** Size of this struct in bytes. Must be set to sizeof(GhosttyRenderStateRowSelection). */
+ size_t size;
+
+ /** Start column of the row-local selection range, inclusive. */
+ uint16_t start_x;
+
+ /** End column of the row-local selection range, inclusive. */
+ uint16_t end_x;
+} GhosttyRenderStateRowSelection;
+
+/**
* Render-state color information.
*
* This struct uses the sized-struct ABI pattern. Initialize with
@@ -571,6 +597,36 @@ typedef enum GHOSTTY_ENUM_TYPED {
* color, in which case the caller should use whatever default foreground
* color it wants (e.g. the terminal foreground). */
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR = 6,
+
+ /** Whether the cell is contained within the current selection (bool).
+ * This returns true when the cell's column is within the current row's
+ * row-local selection range, and false otherwise. Rendering policy for
+ * selected cells (colors, inversion, etc.) is left to the caller.
+ *
+ * Renderers that can draw cells in spans may be more efficient querying
+ * GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION once per row and applying that
+ * range directly, avoiding one C API call per cell for selection state. */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED = 7,
+
+ /** Whether the cell has any explicit styling (bool).
+ * This is equivalent to querying the raw cell's
+ * GHOSTTY_CELL_DATA_HAS_STYLING value, but avoids materializing the raw
+ * GhosttyCell for renderers that only need to know whether fetching the
+ * full style is necessary. */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING = 8,
+
+ /**
+ * Encode the current cell's full grapheme cluster as UTF-8 into a
+ * caller-provided buffer (GhosttyBuffer).
+ *
+ * The base codepoint is encoded first, followed by any extra grapheme
+ * codepoints. Returns GHOSTTY_SUCCESS with len=0 when the cell has no text.
+ *
+ * If ptr is NULL or cap is too small for a non-empty cell, returns
+ * GHOSTTY_OUT_OF_SPACE without writing any bytes and sets len to the required
+ * buffer size in bytes.
+ */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8 = 9,
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
} GhosttyRenderStateRowCellsData;