mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
vt: add size getter for render state
Add ghostty_render_state_size_get() to return cols and rows from the current render state using out pointers. The C wrapper validates null inputs, the symbol is wired through the C API export layers, and tests cover success and invalid-value paths.
This commit is contained in:
@@ -95,6 +95,24 @@ GhosttyResult ghostty_render_state_new(const GhosttyAllocator* allocator,
|
||||
GhosttyResult ghostty_render_state_update(GhosttyRenderState state,
|
||||
GhosttyTerminal terminal);
|
||||
|
||||
/**
|
||||
* Get the current viewport size from a render state.
|
||||
*
|
||||
* The returned values are the render-state dimensions in cells. These
|
||||
* match the active viewport size from the most recent successful update.
|
||||
*
|
||||
* @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)
|
||||
* @param[out] out_cols On success, receives the viewport width in cells
|
||||
* @param[out] out_rows On success, receives the viewport height in cells
|
||||
* @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state`,
|
||||
* `out_cols`, or `out_rows` is NULL
|
||||
*
|
||||
* @ingroup render
|
||||
*/
|
||||
GhosttyResult ghostty_render_state_size_get(GhosttyRenderState state,
|
||||
uint16_t* out_cols,
|
||||
uint16_t* out_rows);
|
||||
|
||||
/**
|
||||
* Get the current dirty state of a render state.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user