/* $LynxId: LYCurses.h,v 1.95 2016/10/11 23:43:51 tom Exp $ */ #ifndef LYCURSES_H #define LYCURSES_H #ifndef HTUTILS_H #include #endif /* * Because we have to configure PDCURSES last, we may get bogus definitions * from the system curses library - cancel these now. */ #ifdef HAVE_XCURSES #undef ASSUME_DEFAULT_COLORS #undef COLOR_CURSES #undef FANCY_CURSES #undef HAVE_CBREAK #undef HAVE_RESIZETERM #undef HAVE_USE_DEFAULT_COLORS #undef NCURSES #undef USE_DEFAULT_COLORS #define HAVE_CBREAK 1 #define COLOR_CURSES 1 #define FANCY_CURSES 1 #endif /* * The simple color scheme maps the 8 combinations of bold/underline/reverse * to the standard 8 ANSI colors (with some variations based on context). */ #undef USE_COLOR_TABLE #ifdef USE_COLOR_STYLE #define USE_COLOR_TABLE 1 /* default color logic is used */ #else #if defined(USE_SLANG) || defined(COLOR_CURSES) #define USE_COLOR_TABLE 1 #endif #endif #ifdef TRUE #undef TRUE /* to prevent parse error :( */ #endif /* TRUE */ #ifdef FALSE #undef FALSE /* to prevent parse error :( */ #endif /* FALSE */ #ifdef USE_SLANG #define ENABLE_SLFUTURE_CONST 1 #include #ifndef SLFUTURE_CONST #define SLFUTURE_CONST /* nothing */ #endif typedef unsigned long chtype; #undef WINDOW typedef struct { int top_y; int left_x; int height; int width; } WINDOW; /* slang doesn't really do windows... */ #define waddch(w,c) LYaddch(c) #define waddstr(w,s) addstr(s) #define wmove(win, row, col) SLsmg_gotorc(((win)?(win)->top_y:0) + (row), ((win)?(win)->left_x:0) + (col)) #ifndef SLSMG_UARROW_CHAR #define SLSMG_UARROW_CHAR '^' #endif #ifndef SLSMG_DARROW_CHAR #define SLSMG_DARROW_CHAR 'v' #endif #ifndef SLSMG_LARROW_CHAR #define SLSMG_LARROW_CHAR '<' #endif #ifndef SLSMG_RARROW_CHAR #define SLSMG_RARROW_CHAR '>' #endif #ifndef SLSMG_CKBRD_CHAR #define SLSMG_CKBRD_CHAR '#' #endif #ifndef SLSMG_BLOCK_CHAR #define SLSMG_BLOCK_CHAR '#' #endif #ifndef ACS_UARROW #define ACS_UARROW SLSMG_UARROW_CHAR #endif #ifndef ACS_DARROW #define ACS_DARROW SLSMG_DARROW_CHAR #endif #ifndef ACS_LARROW #define ACS_LARROW SLSMG_LARROW_CHAR #endif #ifndef ACS_RARROW #define ACS_RARROW SLSMG_RARROW_CHAR #endif #ifndef ACS_CKBOARD #define ACS_CKBOARD SLSMG_CKBRD_CHAR #endif #ifndef ACS_BLOCK #define ACS_BLOCK SLSMG_BLOCK_CHAR #endif #else /* Using curses: */ #ifdef VMS #define FANCY_CURSES #endif /* VMS */ #ifndef HAVE_TYPE_CHTYPE #ifdef __PDCURSES__ #define HAVE_TYPE_CHTYPE 1 #endif #if defined(_VMS_CURSES) || defined(VMS) typedef char chtype; #define HAVE_TYPE_CHTYPE 1 #endif #endif /* ! HAVE_TYPE_CHTYPE */ /* * CR may be defined before the curses.h include occurs. * There is a conflict between the termcap char *CR and the define. * Assuming that the definition of CR will always be carriage return. * 06-09-94 Lynx 2-3-1 Garrett Arch Blythe */ #ifdef CR #undef CR /* to prevent parse error :( */ #define REDEFINE_CR #endif /* CR */ #ifdef HZ #undef HZ /* to prevent parse error :( */ #endif /* HZ */ /* SunOS 4.x has a redefinition between ioctl.h and termios.h */ #if defined(sun) && !defined(__SVR4) #undef NL0 #undef NL1 #undef CR0 #undef CR1 #undef CR2 #undef CR3 #undef TAB0 #undef TAB1 #undef TAB2 #undef XTABS #undef BS0 #undef BS1 #undef FF0 #undef FF1 #undef ECHO #undef NOFLSH #undef TOSTOP #undef FLUSHO #undef PENDIN #endif #if defined(_MSC_VER) #undef MOUSE_MOVED /* conflict between PDCURSES and _WIN32 */ #endif /* _MSC_VER */ /* * Do this to build with glibc 2.1.3 (apparently it was not used to build a * system before release). */ #include #undef CS /* some BSD versions of curses use this */ #define CS curses_CS /* ...but we don't */ #ifdef ERR #undef ERR /* all versions of curses define this */ #endif #ifdef KEY_EVENT #undef KEY_EVENT /* wincon.h or Cy
#ifndef LYHISTORY_H
#define LYHISTORY_H

#ifndef LYSTRUCTS_H
#include <LYStructs.h>
#endif /* LYSTRUCTS_H */

extern BOOLEAN LYwouldPush(const char *title, const char *docurl);
extern BOOLEAN historytarget(DocInfo *newdoc);
extern int LYShowVisitedLinks(char **newfile);
extern int LYhist_next(DocInfo *doc, DocInfo *newdoc);
extern int LYpush(DocInfo *doc, BOOLEAN force_push);
extern int showhistory(char **newfile);
extern void LYAddVisitedLink(DocInfo *doc);
extern void LYFreePostData(DocInfo *data);
extern void LYFreeDocInfo(DocInfo *data);
extern void LYhist_prev(DocInfo *doc);
extern void LYhist_prev_register(DocInfo *doc);
extern void LYpop(DocInfo *doc);
extern void LYpop_num(int number, DocInfo *doc);
extern void LYstatusline_messages_on_exit(char **buf);
extern void LYstore_message(const char *message);
extern void LYstore_message2(const char *message, const char *argument);

extern int nhist_extra;

#endif /* LYHISTORY_H */
and subtract, respectively, the attributes * _UNDERLINE, _BOLD, _REVERSE, and _BLINK. - FM */ #define start_bold() setattr(LYUnderlineLinks ? _UNDERLINE : _BOLD) #define stop_bold() clrattr(LYUnderlineLinks ? _UNDERLINE : _BOLD) #define start_underline() setattr(LYUnderlineLinks ? _BOLD : _UNDERLINE) #define stop_underline() clrattr(LYUnderlineLinks ? _BOLD : _UNDERLINE) #define start_reverse() setattr(_REVERSE) #define wstart_reverse(w) wsetattr(w, _REVERSE) #define stop_reverse() clrattr(_REVERSE) #define wstop_reverse(w) wclrattr(w, _REVERSE) #else /* Not VMS: */ extern int string_to_attr(const char *name); /* * For Unix FANCY_FANCY curses we interpose * our own functions to add or subtract the * A_foo attributes. - FM */ #if defined(USE_COLOR_TABLE) && !defined(USE_COLOR_STYLE) extern void LYaddWAttr(WINDOW * win, int a); extern void LYsubWAttr(WINDOW * win, int a); extern void LYaddWAttr(WINDOW * win, int a); extern void LYsubWAttr(WINDOW * win, int a); #undef standout #define standout() lynx_standout(TRUE) #undef standend #define standend() lynx_standout(FALSE) #else #define LYaddAttr(attr) LYaddWAttr(LYwin,attr) #define LYaddWAttr(win,attr) wattron(win,attr) #define LYsubAttr(attr) LYsubWAttr(LYwin,attr) #define LYsubWAttr(win,attr) wattroff(win,attr) #endif #if defined(USE_COLOR_TABLE) extern void lynx_set_color(int a); extern void lynx_standout(int a); extern char *LYgetTableString(int code); extern int LYgetTableAttr(void); extern int lynx_chg_color(int, int, int); #endif #define start_bold() LYaddAttr(LYUnderlineLinks ? A_UNDERLINE : A_BOLD) #define stop_bold() LYsubAttr(LYUnderlineLinks ? A_UNDERLINE : A_BOLD) #define start_underline() LYaddAttr(LYUnderlineLinks ? A_BOLD : A_UNDERLINE) #define stop_underline() LYsubAttr(LYUnderlineLinks ? A_BOLD : A_UNDERLINE) #if defined(SNAKE) && defined(HP_TERMINAL) #define start_reverse() LYaddWAttr(LYwin, A_DIM) #define wstart_reverse(w) LYaddWAttr(w, A_DIM) #define stop_reverse() LYsubWAttr(LYwin, A_DIM) #define wstop_reverse(w) LYsubWAttr(w, A_DIM) #else #define start_reverse() LYaddAttr(A_REVERSE) #define wstart_reverse(w) LYaddWAttr(w, A_REVERSE) #define stop_reverse() LYsubAttr(A_REVERSE) #define wstop_reverse(w) LYsubWAttr(w, A_REVERSE) #endif /* SNAKE && HP_TERMINAL */ #endif /* VMS */ #else /* Not FANCY_CURSES: */ /* *INDENT-OFF* */ #ifdef COLOR_CURSES #undef COLOR_CURSES Error FANCY_CURSES There is a problem with the configuration. We expect to have FANCY_CURSES defined when COLOR_CURSES is defined, since we build on the attributes used in FANCY_CURSES. Check your config.log to see why the FANCY_CURSES test failed. #endif /* *INDENT-ON* */ /* * We only have [w]standout() and [w]standin(), * so we'll use them synonymously for bold and * reverse, and ignore underline. - FM */ #define start_bold() standout() #define start_underline() /* nothing */ #define start_reverse() standout() #define wstart_reverse(a) wstandout(a) #define stop_bold() standend() #define stop_underline() /* nothing */ #define stop_reverse() standend() #define wstop_reverse(a) wstandend(a) #endif /* FANCY_CURSES */ #ifdef __hpux /* FIXME: configure check */ #undef ACS_UARROW #undef ACS_DARROW #undef ACS_LARROW #undef ACS_RARROW #undef ACS_BLOCK #undef ACS_CKBOARD #endif #ifndef ACS_UARROW #define ACS_UARROW '^' #endif #ifndef ACS_DARROW #define ACS_DARROW 'V' #endif #ifndef ACS_LARROW #define ACS_LARROW '{' #endif #ifndef ACS_RARROW #define ACS_RARROW '}' #endif #ifndef ACS_BLOCK #define ACS_BLOCK '}' #endif #ifndef ACS_CKBOARD #define ACS_CKBOARD '}' #endif #define LYaddch(ch) waddch(LYwin, ch) #define addch_raw(ch) LYaddch(ch) #endif /* USE_SLANG */ #ifdef USE_SLANG #define LYGetYX(y, x) y = SLsmg_get_row(), x = SLsmg_get_column() #else #ifdef getyx #define LYGetYX(y, x) getyx(LYwin, y, x) #else #define LYGetYX(y, x) y = LYwin->_cury, x = LYwin->_curx #endif /* getyx */ #endif /* USE_SLANG */ /* * If the screen library allows us to specify "default" color, allow user to * control it. */ #ifdef USE_DEFAULT_COLORS #if defined(USE_SLANG) || defined(HAVE_ASSUME_DEFAULT_COLORS) #define EXP_ASSUMED_COLOR 1 #endif #endif extern void lynx_enable_mouse(int); extern void lynx_force_repaint(void); extern void lynx_nl2crlf(int normal); extern void lynx_start_title_color(void); extern void lynx_stop_title_color(void); extern void lynx_start_link_color(int flag, int pending); extern void lynx_stop_link_color(int flag, int pending); extern void lynx_stop_target_color(void); extern void lynx_start_target_color(void); extern void lynx_start_status_color(void); extern void lynx_stop_status_color(void); extern void lynx_start_h1_color(void); extern void lynx_stop_h1_color(void); extern void lynx_start_prompt_color(void); extern void lynx_stop_prompt_color(void); extern void lynx_start_radio_color(void); extern void lynx_stop_radio_color(void); extern void lynx_stop_all_colors(void); extern void lynx_start_bold(void); extern void lynx_start_reverse(void); extern void lynx_start_underline(void); extern void lynx_stop_bold(void); extern void lynx_stop_reverse(void); extern void lynx_stop_underline(void); extern void restart_curses(void); /* * To prevent corrupting binary data on DOS, MS-WINDOWS or OS/2 we open files * and stdout in BINARY mode by default. Where necessary we should open and * (close!) TEXT mode. * * Note: EMX has no corresponding variable like _fmode on DOS, but it does * have setmode. */ #if defined(_WINDOWS) || defined(DJGPP) || defined(__EMX__) || defined(WIN_EX) #define SetOutputMode(mode) fflush(stdout), setmode(fileno(stdout), mode) #else #define SetOutputMode(mode) /* nothing */ #endif #if defined(_WINDOWS) || defined(DJGPP) #define SetDefaultMode(mode) _fmode = mode #else #define SetDefaultMode(mode) /* nothing */ #endif /* * Very old versions of curses cannot put the cursor on the lower right corner. * Adjust our "hidden" cursor position accordingly. */ #if defined(FANCY_CURSES) || defined(USE_SLANG) #define LYHideCursor() LYmove((LYlines - 1), (LYcolLimit - 1)) #else #define LYHideCursor() LYmove((LYlines - 1), (LYcolLimit - 2)) #endif #define LYParkCursor() LYmove((LYlines - 1), 0); LYclrtoeol() extern void LYstowCursor(WINDOW * win, int row, int col); extern void LYSetDisplayLines(void); #ifdef __cplusplus } #endif #endif /* LYCURSES_H */