CHECK_FUNCTION_EXISTS(strlimit HAVE_SETRLIMIT)
CHECK_FUNCTION_EXISTS(getsid HAVE_GETSID)
CHECK_FUNCTION_EXISTS(setegid HAVE_SETEGID)
-CHECK_FUNCTION_EXISTS(isctype HAVE_ISCTYPE)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
-CHECK_FUNCTION_EXISTS(regcomp HAVE_REGCOMP)
-CHECK_FUNCTION_EXISTS(iswalnum HAVE_ISWALNUM)
-CHECK_FUNCTION_EXISTS(iswalpha HAVE_ISWALPHA)
-CHECK_FUNCTION_EXISTS(iswcntrl HAVE_ISWCNTRL)
-CHECK_FUNCTION_EXISTS(iswdigit HAVE_ISWDIGIT)
-CHECK_FUNCTION_EXISTS(iswgraph HAVE_ISWGRAPH)
-CHECK_FUNCTION_EXISTS(iswlower HAVE_ISWLOWER)
-CHECK_FUNCTION_EXISTS(iswprint HAVE_ISWPRINT)
-CHECK_FUNCTION_EXISTS(iswpunct HAVE_ISWPUNCT)
-CHECK_FUNCTION_EXISTS(iswspace HAVE_ISWSPACE)
-CHECK_FUNCTION_EXISTS(iswupper HAVE_ISWUPPER)
-CHECK_FUNCTION_EXISTS(iswxdigit HAVE_ISWXDIGIT)
-CHECK_FUNCTION_EXISTS(towupper HAVE_TOWUPPER)
-CHECK_FUNCTION_EXISTS(towlower HAVE_TOWLOWER)
CHECK_FUNCTION_EXISTS(nl_langinfo HAVE_LANGINFO_CODESET)
# }}}
MESSAGE(FATAL_ERROR "could not find ncurses.h")
ENDIF(HAVE_NCURSESW_NCURSES_H)
SET(CMAKE_REQUIRED_LIBRARIES ${MUTTLIBS})
-CHECK_FUNCTION_EXISTS(start_color HAVE_START_COLOR)
-CHECK_FUNCTION_EXISTS(typeahead HAVE_TYPEAHEAD)
-CHECK_FUNCTION_EXISTS(bkgdset HAVE_BKGDSET)
-CHECK_FUNCTION_EXISTS(curs_set HAVE_CURS_SET)
-CHECK_FUNCTION_EXISTS(meta HAVE_META)
-CHECK_FUNCTION_EXISTS(use_default_colors HAVE_USE_DEFAULT_COLORS)
CHECK_FUNCTION_EXISTS(resizeterm HAVE_RESIZETERM)
SET(CMAKE_REQUIRED_LIBRARIES)
SET(CMAKE_REQUIRED_INCLUDES)
/* functions */
#cmakedefine HAVE_GETSID 1
#cmakedefine HAVE_SETEGID 1
-#cmakedefine HAVE_ISCTYPE 1
#cmakedefine HAVE_GETOPT 1
-#cmakedefine HAVE_REGCOMP 1
-#cmakedefine HAVE_ISWALNUM 1
-#cmakedefine HAVE_ISWALPHA 1
-#cmakedefine HAVE_ISWCNTRL 1
-#cmakedefine HAVE_ISWDIGIT 1
-#cmakedefine HAVE_ISWGRAPH 1
-#cmakedefine HAVE_ISWLOWER 1
-#cmakedefine HAVE_ISWPRINT 1
-#cmakedefine HAVE_ISWPUNCT 1
-#cmakedefine HAVE_ISWSPACE 1
-#cmakedefine HAVE_ISWUPPER 1
-#cmakedefine HAVE_ISWXDIGIT 1
-#cmakedefine HAVE_TOWUPPER 1
-#cmakedefine HAVE_TOWLOWER 1
-#cmakedefine HAVE_TYPEAHEAD 1
-#cmakedefine HAVE_BKGDSET 1
-#cmakedefine HAVE_CURS_SET 1
-#cmakedefine HAVE_META 1
-#cmakedefine HAVE_USE_DEFAULT_COLORS 1
#cmakedefine HAVE_RESIZETERM 1
/* libraries */
if (!IsEndwin)
refresh ();
mutt_curs_set (-1);
-#if defined (HAVE_RESIZETERM)
/* We don't receive SIGWINCH when suspended; however, no harm is done by
* just assuming we received one, and triggering the 'resize' anyway. */
- SigWinch = 1;
-#endif
- break;
-
-#if defined (HAVE_RESIZETERM)
case SIGWINCH:
SigWinch = 1;
break;
-#endif
case SIGINT:
SigInt = 1;
sigaction (SIGCONT, &act, NULL);
sigaction (SIGTSTP, &act, NULL);
sigaction (SIGINT, &act, NULL);
-#if defined (HAVE_RESIZETERM)
sigaction (SIGWINCH, &act, NULL);
-#endif
/* POSIX doesn't allow us to ignore SIGCHLD,
* so we just install a dummy handler for it
sigaddset (&Sigset, SIGHUP);
sigaddset (&Sigset, SIGTSTP);
sigaddset (&Sigset, SIGINT);
-#if defined (HAVE_RESIZETERM)
sigaddset (&Sigset, SIGWINCH);
-#endif
sigprocmask (SIG_BLOCK, &Sigset, 0);
set_option (OPTSIGNALSBLOCKED);
}
history.c
menu.c
query.c
- resize.c
sidebar.c
status.c
)
{"red", COLOR_RED},
{"white", COLOR_WHITE},
{"yellow", COLOR_YELLOW},
-#if defined (HAVE_USE_DEFAULT_COLORS)
{"default", COLOR_DEFAULT},
-#endif
{0, 0}
};
p->bg = bg;
p->fg = fg;
-#if defined (HAVE_USE_DEFAULT_COLORS)
if (fg == COLOR_DEFAULT)
fg = -1;
if (bg == COLOR_DEFAULT)
bg = -1;
-#endif
init_pair (i, fg, bg);
return 0;
-#ifdef HAVE_USE_DEFAULT_COLORS
if (!option (OPTNOCURSES) && has_colors ()
/* delay use_default_colors() until needed, since it initializes things */
&& (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
m_strcpy(err->data, err->dsize, _("default colors not supported"));
return (-1);
}
-#endif /* HAVE_USE_DEFAULT_COLORS */
if (object == MT_COLOR_HEADER)
r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err, 0);
#include <lib-lib/lib-lib.h>
#include <termios.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#elif defined(HAVE_IOCTL_H)
+# include <ioctl.h>
+#endif
#include <langinfo.h>
#include <lib-lua/lib-lua.h>
flushinp ();
}
-#if defined(HAVE_CURS_SET)
/* The argument can take 3 values:
* -1: restore the value of the last call
* 0: make the cursor invisible
curs_set (2); /* cvvis */
}
}
-#endif
int mutt_multi_choice (const char *prompt, const char *letters)
{
addch (' ');
}
+/* this routine should be called after receiving SIGWINCH */
+void mutt_resize_screen (void)
+{
+ char *cp;
+ int fd;
+ struct winsize w;
+
+ int rows, cols;
+
+ rows = -1;
+ cols = -1;
+ if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
+ if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
+ rows = w.ws_row;
+ cols = w.ws_col;
+ }
+ close (fd);
+ }
+ if (rows <= 0) {
+ if ((cp = getenv ("LINES")) != NULL) {
+ rows = atoi (cp);
+ }
+ else
+ rows = 24;
+ }
+ if (cols <= 0) {
+ if ((cp = getenv ("COLUMNS")) != NULL)
+ cols = atoi (cp);
+ else
+ cols = 80;
+ }
+ resizeterm (rows, cols);
+}
move (menu->current - menu->top + menu->offset, COLS - 1);
mutt_refresh ();
-#if defined (HAVE_RESIZETERM)
if (SigWinch) {
mutt_flushinp ();
mutt_resize_screen ();
clearok (stdscr, TRUE);
continue;
}
-#endif
op = km_dokey (MENU_MAIN);
-
if (op == -1)
continue; /* either user abort or timeout */
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
#define BEEP() do { if (mod_core.beep) beep(); } while (0)
-#if !defined(HAVE_CURS_SET)
-#define curs_set(x)
-#endif
-
-#if defined(HAVE_BKGDSET)
-#define BKGDSET(x) bkgdset (ColorDefs[x] | ' ')
-#else
-#define BKGDSET(x)
-#endif
+#define BKGDSET(x) bkgdset(ColorDefs[x] | ' ')
-#if defined(HAVE_CURS_SET)
void mutt_curs_set (int);
-#else
-#define mutt_curs_set(x)
-#endif
#define PAGELEN (LINES-3)
#define ctrl(c) ((c)-'@')
mutt_curs_set (1);
-#if defined (HAVE_RESIZETERM)
if (SigWinch) {
mutt_resize_screen ();
menu->redraw = REDRAW_FULL;
SigWinch = 0;
clearok (stdscr, TRUE); /*force complete redraw */
}
-#endif
if (i == -1)
continue;
+++ /dev/null
-/*
- * Copyright notice from original mutt:
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-
-#include <lib-lib/lib-lib.h>
-
-#if defined(HAVE_RESIZETERM)
-
-#include <termios.h>
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#elif defined(HAVE_IOCTL_H)
-# include <ioctl.h>
-#endif
-
-#include <lib-ui/curses.h>
-#include "mutt.h"
-
-/* this routine should be called after receiving SIGWINCH */
-void mutt_resize_screen (void)
-{
- char *cp;
- int fd;
- struct winsize w;
-
- int rows, cols;
-
- rows = -1;
- cols = -1;
- if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
- if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
- rows = w.ws_row;
- cols = w.ws_col;
- }
- close (fd);
- }
- if (rows <= 0) {
- if ((cp = getenv ("LINES")) != NULL) {
- rows = atoi (cp);
- }
- else
- rows = 24;
- }
- if (cols <= 0) {
- if ((cp = getenv ("COLUMNS")) != NULL)
- cols = atoi (cp);
- else
- cols = 80;
- }
- resizeterm (rows, cols);
-}
-
-#endif /* defined(HAVE_RESIZETERM) */
keypad (stdscr, TRUE);
cbreak ();
noecho ();
-#ifdef HAVE_TYPEAHEAD
typeahead (-1); /* simulate smooth scrolling */
-#endif
-#ifdef HAVE_META
meta (stdscr, TRUE);
-#endif
}
#define M_IGNORE (1<<0) /* -z */
static short InHelp = 0;
-#if defined (HAVE_RESIZETERM)
static struct resize {
int line;
int SearchCompiled;
int SearchBack;
} *Resize = NULL;
-#endif
#define NumSigLines 4
SETCOLOR (MT_COLOR_NORMAL);
}
-#if defined (HAVE_RESIZETERM)
if (Resize != NULL) {
if ((SearchCompiled = Resize->SearchCompiled)) {
REGCOMP
p_delete(&Resize);
}
-#endif
if (IsHeader (extra) && PagerIndexLines) {
if (pager_index == NULL) {
mutt_query_exit ();
continue;
}
-#if defined (HAVE_RESIZETERM)
else if (SigWinch) {
mutt_resize_screen ();
clearok (stdscr, TRUE); /*force complete redraw */
continue;
}
-#endif
else if (ch == -1) {
ch = 0;
continue;