ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
frame_buffer.h
Go to the documentation of this file.
1
23#pragma once
24
25#include <stddef.h>
26#include <stdint.h>
27
32
42frame_buffer_t *frame_buffer_create(int rows, int cols);
43
50
60
70void frame_buffer_append(frame_buffer_t *buf, const char *str, size_t len);
71
81void frame_buffer_printf(frame_buffer_t *buf, const char *fmt, ...);
82
89
98
108
117size_t frame_buffer_get_length(const frame_buffer_t *buf);
118
128const char *frame_buffer_get_content(const frame_buffer_t *buf);
129
137void frame_buffer_render_border(frame_buffer_t *buf, int cols, const char *color);
138
149int frame_buffer_render_centered(frame_buffer_t *buf, const char *text, int cols);
150
160
void frame_buffer_append(frame_buffer_t *buf, const char *str, size_t len)
Append raw bytes to the buffer.
int frame_buffer_render_centered(frame_buffer_t *buf, const char *text, int cols)
Render centered text (used by both splash and status screens)
void frame_buffer_cursor_home(frame_buffer_t *buf)
Append cursor home escape code (\033[H)
void frame_buffer_set_screen_output_fd(int fd)
Set output file descriptor for terminal screen (splash/status) rendering.
void frame_buffer_reset(frame_buffer_t *buf)
Clear buffer contents while keeping allocation.
void frame_buffer_destroy(frame_buffer_t *buf)
Destroy a frame buffer.
void frame_buffer_flush(frame_buffer_t *buf)
Flush the entire buffer to stdout in one atomic write.
size_t frame_buffer_get_length(const frame_buffer_t *buf)
Get the current content length of the frame buffer.
const char * frame_buffer_get_content(const frame_buffer_t *buf)
Get a pointer to the buffer content.
frame_buffer_t * frame_buffer_create(int rows, int cols)
Create a new frame buffer.
void frame_buffer_printf(frame_buffer_t *buf, const char *fmt,...)
Printf-style append to the buffer.
int frame_buffer_get_screen_output_fd(void)
Get current output file descriptor for terminal screens.
void frame_buffer_render_border(frame_buffer_t *buf, int cols, const char *color)
Render a horizontal border line (used by both splash and status screens)
void frame_buffer_clear_screen(frame_buffer_t *buf)
Append clear screen and home escape codes (\033[2J\033[H)
Frame buffer structure.
size_t len
Current content length.