mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-20 06:20:32 +00:00
vt: add color data getters to render state
Add individual color data kinds to GhosttyRenderStateData so callers can query background, foreground, cursor color, cursor-color presence, and the full 256-color palette through ghostty_render_state_get() without using the sized-struct colors API. COLOR_CURSOR returns GHOSTTY_INVALID_VALUE when no explicit cursor color is set; callers can check COLOR_CURSOR_HAS_VALUE first.
This commit is contained in:
@@ -126,6 +126,23 @@ typedef enum {
|
||||
* It is unsafe to use row data after updating the render state.
|
||||
* */
|
||||
GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR = 4,
|
||||
|
||||
/** Default/current background color (GhosttyColorRgb). */
|
||||
GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND = 5,
|
||||
|
||||
/** Default/current foreground color (GhosttyColorRgb). */
|
||||
GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND = 6,
|
||||
|
||||
/** Cursor color when explicitly set by terminal state (GhosttyColorRgb).
|
||||
* Returns GHOSTTY_INVALID_VALUE if no explicit cursor color is set;
|
||||
* use COLOR_CURSOR_HAS_VALUE to check first. */
|
||||
GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR = 7,
|
||||
|
||||
/** Whether an explicit cursor color is set (bool). */
|
||||
GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE = 8,
|
||||
|
||||
/** The active 256-color palette (GhosttyColorRgb[256]). */
|
||||
GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE = 9,
|
||||
} GhosttyRenderStateData;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user