ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
terminal_screen.h
Go to the documentation of this file.
1
12
13#pragma once
14
17#include <libplatform/terminal.h>
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/* Forward declaration of session_log_buffer_t */
28
47 terminal_size_t term_size,
48 void *user_data);
49
65
86void terminal_screen_compose(frame_buffer_t *output, terminal_size_t size,
87 const terminal_screen_config_t *config,
89
99
109
116
124
134
145
150bool terminal_screen_logs_handle_key_sized(int key, terminal_size_t size);
154size_t terminal_screen_logs_offset(void);
156void terminal_screen_logs_set_offset(size_t rows);
159 size_t appended_rows,
160 size_t maximum_offset);
167
170 terminal_size_t size);
171
172#ifdef __cplusplus
173}
174#endif
Buffered terminal frame rendering.
struct frame_buffer frame_buffer_t
Opaque frame buffer handle.
unsigned long long uint64_t
struct session_log_buffer session_log_buffer_t
Thread-safe fixed-size history ring for session-screen log lines.
Thread-safe fixed-size history ring for session-screen log lines.
Configuration for terminal screen rendering.
terminal_screen_header_fn render_header
Callback to draw header content.
bool show_logs
Whether to show log feed below header.
bool hide_cursor
Hide cursor while this screen owns the terminal.
void * user_data
Passed to render_header callback.
size_t terminal_screen_logs_offset(void)
void terminal_screen_logs_set_offset(size_t rows)
bool terminal_screen_logs_help_open(void)
void(* terminal_screen_header_fn)(frame_buffer_t *buf, terminal_size_t term_size, void *user_data)
Configuration for terminal screen rendering.
void terminal_screen_log_destroy(void)
Standard log cleanup for terminal screens.
void terminal_screen_compose(frame_buffer_t *output, terminal_size_t size, const terminal_screen_config_t *config, session_log_buffer_t *logs)
size_t terminal_screen_logs_retain_position(uint64_t tail_sequence, size_t appended_rows, size_t maximum_offset)
bool terminal_screen_logs_handle_key_sized(int key, terminal_size_t size)
session_log_buffer_t * terminal_screen_get_log_buffer(void)
Get the current session log buffer.
void terminal_screen_render(const terminal_screen_config_t *config)
Render a terminal screen with fixed header and scrolling logs.
bool terminal_screen_logs_handle_key(int key)
void terminal_screen_cleanup(void)
Clean up terminal screen resources.
uint64_t terminal_screen_logs_last_tail_sequence(void)
void terminal_screen_logs_reset(void)
void terminal_screen_log_clear(void)
Clear buffered logs for terminal screens.
void terminal_screen_logs_render_help(frame_buffer_t *output, terminal_size_t size)
bool terminal_screen_logs_help_too_small(void)
session_log_buffer_t * terminal_screen_log_init(void)
Initialize session log buffer for terminal screens.
void terminal_screen_set_output_fd(int fd)
Set output file descriptor for terminal screens (splash/status).
ui_screen_t