]> git.deb.at Git - pkg/abook.git/blob - ui.h
Revert "Fix FTBFS with clang (Closes: #756536)"
[pkg/abook.git] / ui.h
1 #ifndef _UI_H
2 #define _UI_H
3
4 #include "abook_curses.h"
5
6 enum {
7         HELP_MAIN,
8         HELP_EDITOR
9 };
10
11 int             is_ui_initialized();
12 void            ui_init_curses();
13 void            ui_init_color_pairs_user();
14 void            ui_enable_mouse(bool enabled);
15 int             init_ui();
16 void            close_ui();
17 void            headerline(const char *str);
18 void            refresh_screen();
19 int             statusline_msg(const char *msg);
20 int             statusline_askchoice(const char *msg, const char *choices,
21                         short dflt);
22 char            *ask_filename(const char *prompt);
23 int             statusline_ask_boolean(const char *msg, int def);
24 void            clear_statusline();
25 void            display_help(int help);
26 void            statusline_addstr(const char *str);
27 char *          ui_readline(const char *prompt, char *s, size_t limit,
28                         bool use_completion);
29 void            refresh_statusline();
30 void            get_commands();
31 void            ui_remove_items();
32 void            ui_merge_items();
33 void            ui_remove_duplicates();
34 void            ui_clear_database();
35 void            ui_find(int next);
36 void            ui_print_number_of_items();
37 void            ui_read_database();
38 char            *get_surname(char *s);
39 void            ui_print_database();
40 void            ui_open_datafile();
41
42 #if NCURSES_MOUSE_VERSION != 2
43 #define BUTTON5_PRESSED (0x80 | 0x8000000)
44 #endif
45
46 #include "options.h" /* needed for options_get_bool */
47
48 #define UI_HLINE_CHAR           opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
49                                         '-' : ACS_HLINE
50 #define UI_VLINE_CHAR           opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
51                                         '|' : ACS_VLINE
52 #define UI_TEE_CHAR             opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
53                                         '-' : ACS_BTEE
54 #define UI_LBOXLINE_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
55                                         '/' : ACS_HLINE
56 #define UI_RBOXLINE_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
57                                         '\\' : ACS_HLINE
58 #define UI_ULCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
59                                         ' ' : ACS_ULCORNER
60 #define UI_URCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
61                                         ' ' : ACS_URCORNER
62 #define UI_LLCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
63                                         '+' : ACS_LLCORNER
64 #define UI_LRCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
65                                         '+' : ACS_LRCORNER
66
67 #endif