2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
3 * Copyright (C) 2004 g10 Code GmbH
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 #ifdef USE_SLANG_CURSES
22 #ifndef unix /* this symbol is not defined by the hp-ux compiler (sigh) */
28 #define KEY_DC SL_KEY_DELETE
29 #define KEY_IC SL_KEY_IC
32 * ncurses and SLang seem to send different characters when the Enter key is
33 * pressed, so define some macros to properly detect the Enter key.
35 #define M_ENTER_C '\r'
36 #define M_ENTER_S "\r"
40 #ifdef HAVE_NCURSESW_NCURSES_H
41 #include <ncursesw/ncurses.h>
50 #define M_ENTER_C '\n'
51 #define M_ENTER_S "\n"
53 #endif /* USE_SLANG_CURSES */
55 /* AIX defines ``lines'' in <term.h>, but it's used as a var name in
56 * various places in Mutt
62 #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
63 #define CLEARLINE(x) move(x,0), clrtoeol()
64 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
65 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
67 #if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
71 #if !defined(USE_SLANG_CURSES) && defined(HAVE_BKGDSET)
72 #define BKGDSET(x) bkgdset (ColorDefs[x] | ' ')
77 #if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
78 void mutt_curs_set (int);
80 #define mutt_curs_set(x)
82 #define PAGELEN (LINES-3)
84 #define ctrl(c) ((c)-'@')
87 #define CI_is_return(c) ((c) == '\r' || (c) == '\n' || (c) == KEY_ENTER)
89 #define CI_is_return(c) ((c) == '\r' || (c) == '\n')
92 event_t mutt_getch (void);
94 void mutt_endwin (const char *);
95 void mutt_flushinp (void);
96 void mutt_refresh (void);
97 void mutt_resize_screen (void);
98 void mutt_ungetch (int, int);
99 void mutt_need_hard_redraw (void);
101 /* ----------------------------------------------------------------------------
107 MT_COLOR_HDEFAULT = 0,
131 typedef struct color_line
135 pattern_t *color_pattern; /* compiled pattern to speed up index color
140 struct color_line *next;
143 extern int *ColorQuote;
144 extern int ColorQuoteUsed;
145 extern int ColorDefs[];
146 extern COLOR_LINE *ColorHdrList;
147 extern COLOR_LINE *ColorBodyList;
148 extern COLOR_LINE *ColorIndexList;
150 void ci_init_color (void);
151 void ci_start_color (void);
153 #define SETCOLOR(X) attrset(ColorDefs[X])
154 #define ADDCOLOR(X) attron(ColorDefs[X])
156 #define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }
158 /* ----------------------------------------------------------------------------
159 * These are here to avoid compiler warnings with -Wall under SunOS 4.1.x
162 #if !defined(STDC_HEADERS) && !defined(NCURSES_VERSION) && !defined(USE_SLANG_CURSES)
166 extern int isendwin();
167 extern int w32addch();
169 extern int wclrtobot();
170 extern int mvprintw();
171 extern int getcurx();
172 extern int getcury();
175 extern int wrefresh();
178 extern int waddstr();
179 extern int wclrtoeol();