1 #include "../../util/util.h"
5 #include <sys/ttydefaults.h>
7 #include "../../util/cache.h"
8 #include "../../util/debug.h"
9 #include "../browser.h"
10 #include "../keysyms.h"
11 #include "../helpline.h"
14 #include "../libslang.h"
16 static void ui_browser__argv_write(
struct ui_browser *browser,
65 .
write = ui_browser__argv_write,
69 return popup_menu__run(&menu);
73 const char *exit_msg,
int delay_secs)
76 int max_len = 60, nr_lines = 0;
82 const char *sep =
strchr(t,
'\n');
97 y = SLtt_Screen_Rows / 2 - nr_lines / 2;
98 x = SLtt_Screen_Cols / 2 - max_len / 2;
101 SLsmg_draw_box(y, x++, nr_lines, max_len);
103 SLsmg_gotorc(y, x + 1);
104 SLsmg_write_string((
char *)title);
106 SLsmg_gotorc(++y, x);
109 SLsmg_write_wrapped_string((
unsigned char *)text, y, x,
110 nr_lines, max_len, 1);
114 SLsmg_gotorc(y + len - 1, x);
115 SLsmg_write_nstring((
char *)
" ", max_len);
117 SLsmg_draw_box(y++, x + 1, 3, max_len - 2);
119 SLsmg_gotorc(y + 3, x);
120 SLsmg_write_nstring((
char *)exit_msg, max_len);
130 SLsmg_gotorc(y, x + --len);
131 SLsmg_write_char(
' ');
134 SLsmg_gotorc(y, x + len++);
135 SLsmg_write_char(key);
140 if (len ==
sizeof(buf) - 1) {
155 const char *exit_msg,
int delay_secs)
158 int max_len = 0, nr_lines = 0;
163 const char *sep =
strchr(t,
'\n');
179 y = SLtt_Screen_Rows / 2 - nr_lines / 2,
180 x = SLtt_Screen_Cols / 2 - max_len / 2;
183 SLsmg_draw_box(y, x++, nr_lines, max_len);
185 SLsmg_gotorc(y, x + 1);
186 SLsmg_write_string((
char *)title);
188 SLsmg_gotorc(++y, x);
191 SLsmg_write_wrapped_string((
unsigned char *)text, y, x,
192 nr_lines, max_len, 1);
193 SLsmg_gotorc(y + nr_lines - 2, x);
194 SLsmg_write_nstring((
char *)
" ", max_len);
195 SLsmg_gotorc(y + nr_lines - 1, x);
196 SLsmg_write_nstring((
char *)exit_msg, max_len);
215 if (vasprintf(&s, format, args) > 0) {
225 fprintf(stderr,
"%s\n", title);
230 static int perf_tui__error(
const char *format,
va_list args)
232 return __ui__warning(
"Error:", format, args);
235 static int perf_tui__warning(
const char *format,
va_list args)
237 return __ui__warning(
"Warning:", format, args);
241 .error = perf_tui__error,
242 .warning = perf_tui__warning,