2 * Copyright notice from original mutt:
3 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4 * Copyright (C) 2004 g10 Code GmbH
6 * This file is part of mutt-ng, see http://www.muttng.org/.
7 * It's licensed under the GNU General Public License,
8 * please see the file GPL in the top level source directory.
11 #ifdef USE_SLANG_CURSES
13 #ifndef unix /* this symbol is not defined by the hp-ux compiler (sigh) */
19 #define KEY_DC SL_KEY_DELETE
20 #define KEY_IC SL_KEY_IC
23 * ncurses and SLang seem to send different characters when the Enter key is
24 * pressed, so define some macros to properly detect the Enter key.
26 #define M_ENTER_C '\r'
27 #define M_ENTER_S "\r"
31 #ifdef HAVE_NCURSESW_NCURSES_H
32 #include <ncursesw/ncurses.h>
41 #define M_ENTER_C '\n'
42 #define M_ENTER_S "\n"
44 #endif /* USE_SLANG_CURSES */
46 /* AIX defines ``lines'' in <term.h>, but it's used as a var name in
47 * various places in Mutt
53 #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
54 #define CLEARLINE(x) move(x,0), clrtoeol()
55 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
56 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
58 #if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
62 #if !defined(USE_SLANG_CURSES) && defined(HAVE_BKGDSET)
63 #define BKGDSET(x) bkgdset (ColorDefs[x] | ' ')
68 #if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
69 void mutt_curs_set (int);
71 #define mutt_curs_set(x)
73 #define PAGELEN (LINES-3)
75 #define ctrl(c) ((c)-'@')
78 #define CI_is_return(c) ((c) == '\r' || (c) == '\n' || (c) == KEY_ENTER)
80 #define CI_is_return(c) ((c) == '\r' || (c) == '\n')
83 event_t mutt_getch (void);
85 void mutt_endwin (const char *);
86 void mutt_flushinp (void);
87 void mutt_refresh (void);
88 void mutt_resize_screen (void);
89 void mutt_ungetch (int, int);
90 void mutt_need_hard_redraw (void);
92 /* ----------------------------------------------------------------------------
97 MT_COLOR_HDEFAULT = 0,
121 typedef struct color_line {
124 pattern_t *color_pattern; /* compiled pattern to speed up index color
129 struct color_line *next;
132 extern int *ColorQuote;
133 extern int ColorQuoteUsed;
134 extern int ColorDefs[];
135 extern COLOR_LINE *ColorHdrList;
136 extern COLOR_LINE *ColorBodyList;
137 extern COLOR_LINE *ColorIndexList;
139 void ci_init_color (void);
140 void ci_start_color (void);
142 #define SETCOLOR(X) attrset(ColorDefs[X])
143 #define ADDCOLOR(X) attron(ColorDefs[X])
145 #define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }
147 /* ----------------------------------------------------------------------------
148 * These are here to avoid compiler warnings with -Wall under SunOS 4.1.x
151 #if !defined(STDC_HEADERS) && !defined(NCURSES_VERSION) && !defined(USE_SLANG_CURSES)
152 extern int endwin ();
153 extern int printw ();
155 extern int isendwin ();
156 extern int w32addch ();
157 extern int keypad ();
158 extern int wclrtobot ();
159 extern int mvprintw ();
160 extern int getcurx ();
161 extern int getcury ();
162 extern int noecho ();
163 extern int wdelch ();
164 extern int wrefresh ();
166 extern int wclear ();
167 extern int waddstr ();
168 extern int wclrtoeol ();