1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com>
5 * Derived from menuconfig.
35 extern int attr_normal;
36 extern int attr_main_heading;
37 extern int attr_main_menu_box;
38 extern int attr_main_menu_fore;
39 extern int attr_main_menu_back;
40 extern int attr_main_menu_grey;
41 extern int attr_main_menu_heading;
42 extern int attr_scrollwin_text;
43 extern int attr_scrollwin_heading;
44 extern int attr_scrollwin_box;
45 extern int attr_dialog_text;
46 extern int attr_dialog_menu_fore;
47 extern int attr_dialog_menu_back;
48 extern int attr_dialog_box;
49 extern int attr_input_box;
50 extern int attr_input_heading;
51 extern int attr_input_text;
52 extern int attr_input_field;
53 extern int attr_function_text;
54 extern int attr_function_highlight;
68 void set_colors(void);
70 typedef int (*extra_key_cb_fn)(int, size_t, size_t, void *);
72 /* this changes the windows attributes !!! */
73 void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs);
74 int get_line_length(const char *line);
75 int get_line_no(const char *text);
76 const char *get_line(const char *text, int line_no);
77 void fill_window(WINDOW *win, const char *text);
78 int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...);
79 int dialog_inputbox(WINDOW *main_window,
80 const char *title, const char *prompt,
81 const char *init, char **resultp, int *result_len);
82 void refresh_all_windows(WINDOW *main_window);
83 int show_scroll_win_ext(WINDOW *main_window, const char *title, char *text,
84 int *vscroll, int *hscroll,
85 extra_key_cb_fn extra_key_cb, void *data);
86 void show_scroll_win(WINDOW *main_window,