X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-ui%2Fcurses.h;h=f438395000b5bbb1674445cad309ba7680654135;hb=8e39affbf1cd8a2a5ff5c9991650d54fdcea4997;hp=4e1c18351283a4277bf6ea0f5bf81346b1d2025f;hpb=b23d5033080fe9f9fba038e3cf1e3ec2b0a0d33d;p=apps%2Fmadmutt.git diff --git a/lib-ui/curses.h b/lib-ui/curses.h index 4e1c183..f438395 100644 --- a/lib-ui/curses.h +++ b/lib-ui/curses.h @@ -13,44 +13,15 @@ #include #include "mutt.h" -#ifdef USE_SLANG_CURSES - -#ifndef unix /* this symbol is not defined by the hp-ux compiler (sigh) */ -#define unix -#endif /* unix */ - -#include "slcurses.h" - -#define KEY_DC SL_KEY_DELETE -#define KEY_IC SL_KEY_IC - -/* - * ncurses and SLang seem to send different characters when the Enter key is - * pressed, so define some macros to properly detect the Enter key. - */ -#define M_ENTER_C '\r' -#define M_ENTER_S "\r" - -#else - -#ifdef HAVE_NCURSESW_NCURSES_H +#if defined(HAVE_NCURSESW_NCURSES_H) #include -#else -#ifdef HAVE_NCURSES_NCURSES_H +#elif defined(HAVE_NCURSES_NCURSES_H) #include -#else -#ifdef HAVE_NCURSES_H +#elif defined(HAVE_NCURSES_H) #include #else #include #endif -#endif -#endif - -#define M_ENTER_C '\n' -#define M_ENTER_S "\n" - -#endif /* USE_SLANG_CURSES */ /* AIX defines ``lines'' in , but it's used as a var name in * various places in Mutt @@ -59,26 +30,14 @@ #undef lines #endif /* lines */ -#define CLEARLINE_WIN(x) move(x,(option(OPTMBOXPANE)?SidebarWidth:0)), clrtoeol() -#define CLEARLINE(x) move(x,0), clrtoeol() -#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) -#define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) - -#if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET)) -#define curs_set(x) -#endif +#define CLEARLINE_WIN(x) wmove(stdscr, x,(option(OPTMBOXPANE)?SidebarWidth:0)), wclrtoeol(stdscr) +#define CLEARLINE(x) wmove(stdscr, x,0), wclrtoeol(stdscr) +#define CENTERLINE(x,y) wmove(stdscr, y, (COLS-strlen(x))/2), waddstr(stdscr, x) +#define BEEP() do { if (mod_core.beep) beep(); } while (0) -#if !defined(USE_SLANG_CURSES) && defined(HAVE_BKGDSET) -#define BKGDSET(x) bkgdset (ColorDefs[x] | ' ') -#else -#define BKGDSET(x) -#endif +#define BKGDSET(x) wbkgdset(stdscr, ColorDefs[x] | ' ') -#if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET)) void mutt_curs_set (int); -#else -#define mutt_curs_set(x) -#endif #define PAGELEN (LINES-3) #define ctrl(c) ((c)-'@') @@ -147,9 +106,11 @@ typedef struct { void mutt_progress_bar (progress_t* progress, long pos); void mutt_clear_error (void); -void mutt_edit_file (const char *, const char *); -void mutt_curses_error (const char *, ...); -void mutt_curses_message (const char *, ...); +void mutt_edit_file (const char *); +void mutt_curses_error (const char *, ...) + __attribute__((format(printf, 1, 2))); +void mutt_curses_message (const char *, ...) + __attribute__((format(printf, 1, 2))); void mutt_format_string (char *, ssize_t, int, int, int, char, const char *, ssize_t, int); void mutt_format_s (char *, ssize_t, const char *, const char *); @@ -177,13 +138,12 @@ int mutt_get_field_unbuffered (char *, char *, ssize_t, int); int mutt_index_menu (void); int mutt_is_mail_list (address_t *); int mutt_is_subscribed_list (address_t *); -int mutt_multi_choice (char *prompt, char *letters); +int mutt_multi_choice (const char *prompt, const char *letters); int mutt_parse_color (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_query_complete (char *, ssize_t); -int mutt_strwidth (const char *); int mutt_user_is_recipient (HEADER *); int mutt_yesorno (const char *, int); void mutt_set_header_color (CONTEXT *, HEADER *); @@ -203,8 +163,8 @@ void _mutt_make_string (char *, ssize_t, const char *, CONTEXT *, HEADER *, format_flag); -#define SETCOLOR(X) attrset(ColorDefs[X]) -#define ADDCOLOR(X) attron(ColorDefs[X]) +#define SETCOLOR(X) wattrset(stdscr, ColorDefs[X]) +#define ADDCOLOR(X) wattron(stdscr, ColorDefs[X]) #define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }