ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
options/registry/terminal.c
Go to the documentation of this file.
1
13#include <ascii-chat/options/registry/common.h>
14#include <ascii-chat/options/registry/metadata.h>
15
16#include <ascii-chat/options/parsers.h>
17
18// ============================================================================
19// TERMINAL CATEGORY - Terminal display options
20// ============================================================================
21const registry_entry_t g_terminal_entries[] = {
22 // TERMINAL GROUP (client, mirror, discovery)
23 {"width",
24 'x',
25 OPTION_TYPE_INT,
26 offsetof(options_t, width),
27 &default_width_value,
28 sizeof(int),
29 "Terminal width in characters. Can be controlled using $COLUMNS. By default your terminal width is detected at "
30 "runtime and this value is updated automatically.",
31 "TERMINAL",
32 NULL,
33 false,
34 "ASCII_CHAT_WIDTH",
35 NULL,
36 NULL,
37 false,
38 false,
39 OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY,
40 {.numeric_range = {20, 512, 0}, .examples = g_width_examples, .input_type = OPTION_INPUT_NUMERIC},
41 NULL},
42 {"height",
43 'y',
44 OPTION_TYPE_INT,
45 offsetof(options_t, height),
46 &default_height_value,
47 sizeof(int),
48 "Terminal height in characters. Can be controlled using $ROWS. By default your terminal height is detected at "
49 "runtime and this value is updated automatically.",
50 "TERMINAL",
51 NULL,
52 false,
53 "ASCII_CHAT_HEIGHT",
54 NULL,
55 NULL,
56 false,
57 false,
58 OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY,
59 {.numeric_range = {10, 256, 0}, .examples = g_height_examples, .input_type = OPTION_INPUT_NUMERIC},
60 NULL},
61 {"color-mode",
62 '\0',
63 OPTION_TYPE_CALLBACK,
64 offsetof(options_t, color_mode),
65 &default_color_mode_value,
66 sizeof(terminal_color_mode_t),
67 "Terminal color level (auto, none, 16, 256, truecolor). This controls what ANSI escape codes ascii-chat will use "
68 "for console logging and display output if color is enabled. Press 'c' during rendering to cycle. See also "
69 "--color.",
70 "TERMINAL",
71 NULL,
72 false,
73 "ASCII_CHAT_COLOR_MODE",
74 NULL,
76 false,
77 false,
78 OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY,
79 {.enum_values = g_color_mode_values,
80 .enum_descriptions = g_color_mode_descs,
81 .enum_integer_values = g_color_mode_integers,
82 .input_type = OPTION_INPUT_ENUM},
83 NULL},
84 {"show-capabilities",
85 '\0',
86 OPTION_TYPE_ACTION,
87 0,
88 NULL,
89 0,
90 "Show detected terminal capabilities and exit (useful for debugging and scripting).",
91 "TERMINAL",
92 NULL,
93 false,
94 NULL,
95 NULL,
96 NULL,
97 false,
98 false,
99 OPTION_MODE_BINARY,
100 {0},
101 NULL},
102 {"utf8",
103 '\0',
104 OPTION_TYPE_CALLBACK,
105 offsetof(options_t, force_utf8),
106 &default_force_utf8_value,
107 sizeof(int),
108 "UTF-8 support setting: 'auto' (default, auto-detect), 'true' (force UTF-8 on), or 'false' (force UTF-8 off).",
109 "TERMINAL",
110 NULL,
111 false,
112 "ASCII_CHAT_UTF8",
113 NULL,
115 false,
116 true,
117 OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY,
118 {.enum_values = g_utf8_setting_values,
119 .enum_descriptions = g_utf8_setting_descs,
120 .enum_integer_values = g_utf8_setting_integers,
121 .input_type = OPTION_INPUT_ENUM},
122 NULL},
123 {"strip-ansi",
124 '\0',
125 OPTION_TYPE_BOOL,
126 offsetof(options_t, strip_ansi),
127 &default_strip_ansi_value,
128 sizeof(bool),
129 "Strip ANSI escape sequences from output before printing. Useful for scripting and debugging.",
130 "TERMINAL",
131 NULL,
132 false,
133 "ASCII_CHAT_STRIP_ANSI",
134 NULL,
135 NULL,
136 false,
137 false,
138 OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY,
139 {0},
140 NULL},
141 {"color",
142 '\0',
143 OPTION_TYPE_CALLBACK,
144 offsetof(options_t, color),
145 &default_color_value,
146 sizeof(int),
147 "Color output setting: 'auto' (default, smart detection), 'true' (force colors on), or 'false' (force colors "
148 "off).",
149 "TERMINAL",
150 NULL,
151 false,
152 "ASCII_CHAT_COLOR",
153 NULL,
155 false,
156 true,
157 OPTION_MODE_BINARY,
158 {.enum_values = g_color_setting_values,
159 .enum_descriptions = g_color_setting_descs,
160 .enum_integer_values = g_color_setting_integers,
161 .input_type = OPTION_INPUT_ENUM},
162 NULL},
163
164 REGISTRY_TERMINATOR()};
const char * g_height_examples[]
Definition metadata.c:141
const int g_color_setting_integers[]
Definition metadata.c:37
const char * g_color_mode_values[]
Definition metadata.c:56
const char * g_width_examples[]
Definition metadata.c:140
const char * g_color_setting_descs[]
Definition metadata.c:38
const char * g_utf8_setting_values[]
Definition metadata.c:46
const int g_utf8_setting_integers[]
Definition metadata.c:47
const char * g_utf8_setting_descs[]
Definition metadata.c:48
const char * g_color_setting_values[]
Definition metadata.c:36
const char * g_color_mode_descs[]
Definition metadata.c:59
const int g_color_mode_integers[]
Definition metadata.c:57
const registry_entry_t g_terminal_entries[]
bool parse_color_setting(const char *arg, void *dest, char **error_msg)
Definition parsers.c:161
bool parse_color_mode(const char *arg, void *dest, char **error_msg)
Definition parsers.c:211
bool parse_utf8_setting(const char *arg, void *dest, char **error_msg)
Definition parsers.c:192
#define bool
Definition stdbool.h:22