ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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
16#include <stdbool.h>
17#include <stddef.h>
18#include <stdint.h>
19#include <libplatform/terminal.h>
21
22/* Forward declaration of session_log_buffer_t */
24
40typedef void (*terminal_screen_header_fn)(frame_buffer_t *buf, terminal_size_t term_size, void *user_data);
41
56
77void terminal_screen_compose(frame_buffer_t *output, terminal_size_t size, const terminal_screen_config_t *config,
79
89
99
106
114
124
134
138bool terminal_screen_logs_handle_key_sized(int key, terminal_size_t size);
142size_t terminal_screen_logs_offset(void);
144void terminal_screen_logs_set_offset(size_t rows);
146size_t terminal_screen_logs_retain_position(uint64_t tail_sequence, size_t appended_rows, size_t maximum_offset);
153
155void terminal_screen_logs_render_help(frame_buffer_t *output, terminal_size_t size);
Buffered terminal frame rendering.
struct frame_buffer frame_buffer_t
Opaque frame buffer handle.
unsigned long long uint64_t
Definition common.h:63
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.
int fixed_header_lines
How many lines the header takes (e.g., 4 for status, 8 for splash).
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