2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
19 #ifdef USE_SLANG_CURSES
21 #ifndef unix /* this symbol is not defined by the hp-ux compiler (sigh) */
27 #define KEY_DC SL_KEY_DELETE
28 #define KEY_IC SL_KEY_IC
31 * ncurses and SLang seem to send different characters when the Enter key is
32 * pressed, so define some macros to properly detect the Enter key.
34 #define M_ENTER_C '\r'
35 #define M_ENTER_S "\r"
39 #ifdef HAVE_NCURSESW_NCURSES_H
40 #include <ncursesw/ncurses.h>
49 #define M_ENTER_C '\n'
50 #define M_ENTER_S "\n"
52 #endif /* USE_SLANG_CURSES */
54 /* AIX defines ``lines'' in <term.h>, but it's used as a var name in
55 * various places in Mutt
61 #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
62 #define CLEARLINE(x) move(x,0), clrtoeol()
63 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
64 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
66 #if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
70 #if !defined(USE_SLANG_CURSES) && defined(HAVE_BKGDSET)
71 #define BKGDSET(x) bkgdset (ColorDefs[x] | ' ')
76 #if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
77 void mutt_curs_set (int);
79 #define mutt_curs_set(x)
81 #define PAGELEN (LINES-3)
83 #define ctrl(c) ((c)-'@')
86 #define CI_is_return(c) ((c) == '\r' || (c) == '\n' || (c) == KEY_ENTER)
88 #define CI_is_return(c) ((c) == '\r' || (c) == '\n')
91 event_t mutt_getch (void);
93 void mutt_endwin (const char *);
94 void mutt_flushinp (void);
95 void mutt_refresh (void);
96 void mutt_resize_screen (void);
97 void mutt_ungetch (int, int);
99 /* ----------------------------------------------------------------------------
105 MT_COLOR_HDEFAULT = 0,
127 typedef struct color_line
131 pattern_t *color_pattern; /* compiled pattern to speed up index color
136 struct color_line *next;
139 extern int *ColorQuote;
140 extern int ColorQuoteUsed;
141 extern int ColorDefs[];
142 extern COLOR_LINE *ColorHdrList;
143 extern COLOR_LINE *ColorBodyList;
144 extern COLOR_LINE *ColorIndexList;
146 void ci_init_color (void);
147 void ci_start_color (void);
149 #define SETCOLOR(X) attrset(ColorDefs[X])
150 #define ADDCOLOR(X) attron(ColorDefs[X])
152 #define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }
154 /* ----------------------------------------------------------------------------
155 * These are here to avoid compiler warnings with -Wall under SunOS 4.1.x
158 #if !defined(STDC_HEADERS) && !defined(NCURSES_VERSION) && !defined(USE_SLANG_CURSES)
162 extern int isendwin();
163 extern int w32addch();
165 extern int wclrtobot();
166 extern int mvprintw();
167 extern int getcurx();
168 extern int getcury();
171 extern int wrefresh();
174 extern int waddstr();
175 extern int wclrtoeol();