1 2 /* $Id: elm_curses.h,v 1.4 1999/03/24 14:03:41 wfp5p Exp $ */ 3 4 /******************************************************************************* 5 * The Elm Mail System - $Revision: 1.4 $ $State: Exp $ 6 * 7 * Copyright (c) 1988-1995 USENET Community Trust 8 * Copyright (c) 1986,1987 Dave Taylor 9 ******************************************************************************* 10 * Bug reports, patches, comments, suggestions should be sent to: 11 * 12 * Bill Pemberton, Elm Coordinator 13 * flash@virginia.edu 14 * 15 ******************************************************************************* 16 * $Log: elm_curses.h,v $ 17 * Revision 1.4 1999/03/24 14:03:41 wfp5p 18 * elm 2.5PL0 19 * 20 * Revision 1.3 1997/10/20 20:24:22 wfp5p 21 * Incomingfolders no longer set Magic mode on for all remaining folders. 22 * 23 * Revision 1.2 1996/03/14 17:27:20 wfp5p 24 * Alpha 9 25 * 26 * Revision 1.1 1995/09/29 17:40:46 wfp5p 27 * Alpha 8 (Chip's big changes) 28 * 29 * Revision 1.1.1.1 1995/04/19 20:38:30 wfp5p 30 * Initial import of elm 2.4 PL0 as base for elm 2.5. 31 * 32 ******************************************************************************/ 33 34 #define OFF 0 35 #define ON 1 36 37 #define CarriageReturn() WriteChar('\r') 38 #define NewLine() (WriteChar('\r'), WriteChar('\n')) 39 #define ClearLine(n) ((void) (MoveCursor((n), 0), CleartoEOLN())) 40 #define Beep() WriteChar(07) 41 42 /* special codes returned by GetKey() procedure */ 43 #define KEY_DOWN 0402 /* down arrow */ 44 #define KEY_UP 0403 /* up arrow */ 45 #define KEY_LEFT 0404 /* left arrow */ 46 #define KEY_RIGHT 0405 /* right arrow */ 47 #define KEY_HOME 0406 /* home */ 48 #define KEY_DC 0512 /* delete char */ 49 #define KEY_IC 0513 /* insert char */ 50 #define KEY_NPAGE 0522 /* next-page (or page down) */ 51 #define KEY_PPAGE 0523 /* previous-page (or page up) */ 52 #define KEY_BTAB 0541 /* back-tab */ 53 #define KEY_END 0550 /* end */ 54 #define KEY_REDRAW 0775 /* redraw signal condition */ 55 #define KEY_TIMEOUT 0776 /* timeout signal condition */ 56 #define KEY_UNKNOWN 0777 /* a key we don't recognize */ 57 58 /* options to the enter_string() routine */ 59 #define ESTR_ENTER 0 /* enter a new value */ 60 #define ESTR_REPLACE 1 /* replace current value */ 61 #define ESTR_UPDATE 2 /* update current value */ 62 #define ESTR_NUMBER 3 /* like ENTER, but accept digits only */ 63 #define ESTR_PASSWORD 4 /* like ENTER, but no output displayed */ 64 65 /* selections for define_softkeys() routine */ 66 #define SOFTKEYS_MAIN 0 67 #define SOFTKEYS_ALIAS 1 68 #define SOFTKEYS_YESNO 2 69 #define SOFTKEYS_CHANGE 3 70 #define SOFTKEYS_READ 4 71 72 /* term "status" settings */ 73 #define TERM_IS_INIT (1<<0) /* InitScreen() has been performed */ 74 #define TERM_IS_RAW (1<<1) /* keyboard is in raw state */ 75 #define TERM_IS_FKEY (1<<2) /* function keys in transmit mode */ 76 #define TERM_CAN_SO (1<<3) /* supports "standout" function */ 77 #define TERM_CAN_DC (1<<4) /* supports "delete char" function */ 78 #define TERM_CAN_IC (1<<5) /* supports "insert char" function */ 79 80 /* public information about terminal status */ 81 struct term_info { 82 int lines; /* screen height */ 83 int cols; /* screen width */ 84 int status; /* terminal status flags */ 85 int erase_char; /* commonly CTRL/H */ 86 int kill_char; /* commonly CTRL/U */ 87 int werase_char; /* commonly CTRL/W */ 88 int intr_char; /* commonly CTRL/C */ 89 }; 90 91 #define LINES (Term.lines) 92 #define COLS (Term.cols) 93 94 /* 95 * global data 96 */ 97 EXTERN struct term_info Term; /* current terminal settings */ 98 #if defined(_JBLEN) || defined(_SETJMP_H) || defined(_SETJMP_H_) || defined(_SETJMP_H_INCLUDED) 99 EXTERN int GetKey_active; /* set if in GetKey() in read() */ 100 EXTERN JMP_BUF GetKey_jmpbuf; /* setjmp buffer */ 101 #endif 102 #if defined(SIGWINCH) || defined(SIGCONT) 103 EXTERN int caught_screen_change_sig; /* SIGWINCH or SIGCONT occurred? */ 104 #endif 105 106 /* curses.c */ 107 108 int InitScreen P_((void)); 109 void ShutdownTerm P_((void)); 110 int knode_parse P_((int)); 111 #if defined(SIGWINCH) || defined(SIGCONT) 112 void ResizeScreen P_((void)); 113 #endif 114 void GetCursorPos P_((int *, int *)); 115 void InvalidateCursor P_((void)); 116 void MoveCursor P_((int, int)); 117 void ClearScreen P_((void)); 118 void CleartoEOLN P_((void)); 119 void CleartoEOS P_((void)); 120 void StartStandout P_((void)); 121 void EndStandout P_((void)); 122 void WriteChar P_((int)); 123 void InsertChar P_((int)); 124 void DeleteChar P_((int)); 125 void Raw P_((int)); 126 void EnableFkeys P_((int)); 127 int ReadCh P_((void)); 128 void UnreadCh P_((int)); 129 void FlushOutput P_((void)); 130 void FlushInput P_((void)); 131 void debug_terminal P_((void)); 132 133 134 /* in_utils.c */ 135 136 int enter_yn P_((char *, int, int, int)); 137 int enter_number P_((int, int, char *)); 138 int enter_string P_((char *, int, int, int, int)); 139 int GetKey P_((int)); 140 141 142 /* out_utils.c */ 143 144 void PutLine0 P_((int, int, const char *)); 145 void PutLine1(); 146 void PutLine2(); 147 void PutLine3(); 148 void CenterLine P_((int, const char *)); 149 void show_last_error P_((void)); 150 int clear_error P_((void)); 151 void set_error P_((const char *)); 152 void error P_((const char *)); 153 void error1(); 154 void error2(); 155 void error3(); 156 void lower_prompt P_((const char *)); 157 void prompt P_((const char *)); 158 void set_central_message P_((const char *, const char *)); 159 void display_central_message P_((void)); 160 void clear_central_message P_((void)); 161 162 163 /* softkeys.c */ 164 165 int define_softkeys P_((int)); 166 void softkeys_on P_((void)); 167 void softkeys_off P_((void)); 168 169