ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
display.h File Reference

ascii-chat Client Display Management Interface More...

Go to the source code of this file.

Typedefs

typedef struct session_display_ctx session_display_ctx_t
 session display config is intentionally a small, concrete record. Fields such as snapshot_mode, palette_type, custom_palette, color_mode give callers the identity and current value they need. It is normally borrowed from, or owned by, the surrounding subsystem—not independently managed.

Functions

void display_set_context (session_display_ctx_t *display_ctx)
 Set the display context created by session_client_like framework.
int display_init ()
 Initialize what is necessary to display ascii frames.
bool display_has_tty ()
 Check if display has TTY capability.
void display_full_reset ()
 Perform full display reset.
void display_reset_for_new_connection (client_connection_t *connection)
 Reset display state for new connection.
void display_disable_logging_for_first_frame (client_connection_t *connection)
 Disable terminal logging for first frame.
void display_render_frame (client_connection_t *connection, const char *frame_data)
 Render ASCII frame to display.
void display_poll_keyboard (client_connection_t *connection)
void display_cleanup ()
 Cleanup display subsystem.

Variables

tty_info_t g_tty_info

Detailed Description

ascii-chat Client Display Management Interface

Defines the display subsystem interface for terminal rendering, TTY management, frame output operations, and terminal capability detection.

The display subsystem handles all interactions with the terminal:

  • Terminal capability detection (color depth, Unicode, half-blocks)
  • TTY control (raw mode, terminal reset)
  • ASCII frame rendering to stdout
  • Terminal logging suppression during rendering
  • Clean terminal restoration on shutdown
Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
2025
See also
topic_client_display "Terminal Display Architecture"

Definition in file src/client/display.h.

Function Documentation

◆ display_poll_keyboard()

void display_poll_keyboard ( client_connection_t * connection)

Poll interactive controls from the connection owner, independently of received frames.

Definition at line 335 of file src/client/display.c.

335 {
336 if (!g_keyboard_enabled || !connection->display_context)
337 return;
339 if (key != KEY_NONE)
341}
keyboard_key_t
Options for interactive line editing.
Definition keyboard.h:53
@ KEY_NONE
No key pressed or no input available.
Definition keyboard.h:54
void session_handle_keyboard_input(session_capture_ctx_t *capture, session_display_ctx_t *display, keyboard_key_t key)
Handle keyboard input in a session.
session_capture_ctx_t * capture_context
session_display_ctx_t * display_context
@ UI_SCREEN_MEDIA
keyboard_key_t ui_input_read_key(ui_screen_t screen)
Definition tui/input.c:353

References client_connection::capture_context, client_connection::display_context, KEY_NONE, session_handle_keyboard_input(), ui_input_read_key(), and UI_SCREEN_MEDIA.

Variable Documentation

◆ g_tty_info

tty_info_t g_tty_info
extern