home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / util / vim-3.0.lha / Vim / src / term.h < prev    next >
C/C++ Source or Header  |  1994-08-09  |  16KB  |  866 lines

  1. /* vi:ts=4:sw=4
  2.  *
  3.  * VIM - Vi IMproved        by Bram Moolenaar
  4.  *
  5.  * Read the file "credits.txt" for a list of people who contributed.
  6.  * Read the file "uganda.txt" for copying and usage conditions.
  7.  */
  8.  
  9. /*
  10.  * This file contains the machine dependent escape sequences that the editor
  11.  * needs to perform various operations. Some of the sequences here are
  12.  * optional. Anything not available should be indicated by a null string. In
  13.  * the case of insert/delete line sequences, the editor checks the capability
  14.  * and works around the deficiency, if necessary.
  15.  */
  16.  
  17. #ifdef SASC
  18. /*
  19.  * the SAS C compiler has a bug that makes typedefs being forget sometimes
  20.  */
  21. typedef unsigned char char_u;
  22. #endif
  23.  
  24. /*
  25.  * the terminal capabilities are stored in this structure
  26.  * keep in sync with array in term.c
  27.  */
  28. typedef struct _tcarr
  29. {
  30. /* output codes */
  31.   char_u *t_name;    /* name of this terminal entry */
  32.   char_u *t_el;        /* el       ce    clear to end of line */
  33.   char_u *t_il;        /* il1      al    add new blank line */
  34.   char_u *t_cil;    /* il       AL    add number of blank lines */
  35.   char_u *t_dl;        /* dl1      dl    delete line */
  36.   char_u *t_cdl;    /* dl       DL    delete number of lines */
  37.   char_u *t_cs;        /*          cs    scroll region */
  38.   char_u *t_ed;        /* clear    cl    clear screen */
  39.   char_u *t_ci;        /* civis    vi    cursur invisible */
  40.   char_u *t_cv;        /* cnorm    ve    cursur visible */
  41.   char_u *t_cvv;    /* cvvis    vs  cursor very visible */
  42.   char_u *t_tp;        /* sgr0     me    normal mode */
  43.   char_u *t_ti;        /* rev      mr    reverse mode */
  44.   char_u *t_tb;        /* bold     md    bold mode */
  45.   char_u *t_se;        /* rmso     se    normal mode */
  46.   char_u *t_so;        /* smso     so    standout mode */
  47.   char_u *t_ms;        /* msgr     ms    save to move cursor in reverse mode */
  48.   char_u *t_cm;        /* cup      cm    cursor motion */
  49.   char_u *t_sr;        /* ri       sr    scroll reverse (backward) */
  50.   char_u *t_cri;    /* cuf      RI    cursor number of chars right */
  51.   char_u *t_vb;        /* flash    vb    visual bell */
  52.   char_u *t_ks;        /* smkx     ks    put terminal in "keypad transmit" mode */
  53.   char_u *t_ke;        /* rmkx     ke    out of "keypad transmit" mode */
  54.   char_u *t_ts;        /*          ti    put terminal in termcap mode */
  55.   char_u *t_te;        /*          te    out of termcap mode */
  56.  
  57. /* key codes */
  58.   char_u *t_ku;        /* kcuu1    ku    arrow up */
  59.   char_u *t_kd;        /* kcud1    kd    arrow down */
  60.   char_u *t_kl;        /* kcub1    kl    arrow left */
  61.   char_u *t_kr;        /* kcuf1    kr    arrow right */
  62.   char_u *t_sku;    /* shift arrow up */
  63.   char_u *t_skd;    /* shift arrow down */
  64.   char_u *t_skl;    /* kLFT     #4    shift arrow left */
  65.   char_u *t_skr;    /* kRIT     %    shift arrow right */
  66.   char_u *t_f1;        /* kf1      k1    function key 1 */
  67.   char_u *t_f2;        /* kf2      k2    function key 2 */
  68.   char_u *t_f3;        /* kf3      k3    function key 3 */
  69.   char_u *t_f4;        /* kf4      k4    function key 4 */
  70.   char_u *t_f5;        /* kf5      k5    function key 5 */
  71.   char_u *t_f6;        /* kf6      k6    function key 6 */
  72.   char_u *t_f7;        /* kf7      k7    function key 7 */
  73.   char_u *t_f8;        /* kf8      k8    function key 8 */
  74.   char_u *t_f9;        /* kf9      k9    function key 9 */
  75.   char_u *t_f10;    /* kf10     k;    function key 10 */
  76.   char_u *t_sf1;    /* kf11     F1    shifted function key 1 */
  77.   char_u *t_sf2;    /* kf12     F2    shifted function key 2 */
  78.   char_u *t_sf3;    /* kf13     F3    shifted function key 3 */
  79.   char_u *t_sf4;    /* kf14     F4    shifted function key 4 */
  80.   char_u *t_sf5;    /* kf15     F5    shifted function key 5 */
  81.   char_u *t_sf6;    /* kf16     F6    shifted function key 6 */
  82.   char_u *t_sf7;    /* kf17     F7    shifted function key 7 */
  83.   char_u *t_sf8;    /* kf18     F8    shifted function key 8 */
  84.   char_u *t_sf9;    /* kf19     F9    shifted function key 9 */
  85.   char_u *t_sf10;    /* kf20     FA    shifted function key 10 */
  86.   char_u *t_help;    /* khlp     %1    help key */
  87.   char_u *t_undo;    /* kund     &8    undo key */
  88.   /* adjust inchar() for last key entry! */
  89.  
  90.   char_u *t_csc;    /* -        -    cursor relative to scrolling region */
  91. } Tcarr;
  92.  
  93. extern Tcarr term_strings;    /* currently used terminal strings */
  94.  
  95. /*
  96.  * strings used for terminal
  97.  */
  98. #define T_EL    (term_strings.t_el)
  99. #define T_IL    (term_strings.t_il)
  100. #define T_CIL    (term_strings.t_cil)
  101. #define T_DL    (term_strings.t_dl)
  102. #define T_CDL    (term_strings.t_cdl)
  103. #define T_CS    (term_strings.t_cs)
  104. #define T_ED    (term_strings.t_ed)
  105. #define T_CI    (term_strings.t_ci)
  106. #define T_CV    (term_strings.t_cv)
  107. #define T_CVV    (term_strings.t_cvv)
  108. #define T_TP    (term_strings.t_tp)
  109. #define T_TI    (term_strings.t_ti)
  110. #define T_TB    (term_strings.t_tb)
  111. #define T_SE    (term_strings.t_se)
  112. #define T_SO    (term_strings.t_so)
  113. #define T_MS    (term_strings.t_ms)
  114. #define T_CM    (term_strings.t_cm)
  115. #define T_SR    (term_strings.t_sr)
  116. #define T_CRI    (term_strings.t_cri)
  117. #define T_VB    (term_strings.t_vb)
  118. #define T_KS    (term_strings.t_ks)
  119. #define T_KE    (term_strings.t_ke)
  120. #define T_TS    (term_strings.t_ts)
  121. #define T_TE    (term_strings.t_te)
  122. #define T_CSC    (term_strings.t_csc)
  123.  
  124.  
  125. #ifndef TERMINFO
  126. # ifndef NO_BUILTIN_TCAPS
  127. /*
  128.  * here are the builtin termcap entries.
  129.  * They not stored as complete Tcarr structures, as such a structure 
  130.  * is to big. 
  131.  * Each termcap is a concatenated string of entries, where '\0' characters
  132.  * followed by a skip character sepereate the capabilities. The skip 
  133.  * character is the relative structure offset for the following entry.
  134.  * See parse_builtin_tcap() in term.c for all details.
  135.  */
  136. #  define AMIGA_TCAP "amiga\0\
  137. \0\033[K\0\
  138. \0\033[L\0\
  139. \0\033[%dL\0\
  140. \0\033[M\0\
  141. \0\033[%dM\0\
  142. \1\014\0\
  143. \0\033[0 p\0\
  144. \0\033[1 p\0\
  145. \1\033[0m\0\
  146. \0\033[7m\0\
  147. \0\033[1m\0\
  148. \0\033[0m\0\
  149. \0\033[33m\0\
  150. \0\001\0\
  151. \0\033[%i%d;%dH\0\
  152. \1\033[%dC\0\
  153. \5\233A\0\
  154. \0\233B\0\
  155. \0\233D\0\
  156. \0\233C\0\
  157. \0\233T\0\
  158. \0\233S\0\
  159. \0\233 A\0\
  160. \0\233 @\0\
  161. \0\233\060~\0\
  162. \0\233\061~\0\
  163. \0\233\062~\0\
  164. \0\233\063~\0\
  165. \0\233\064~\0\
  166. \0\233\065~\0\
  167. \0\233\066~\0\
  168. \0\233\067~\0\
  169. \0\233\070~\0\
  170. \0\233\071~\0\
  171. \0\233\061\060~\0\
  172. \0\233\061\061~\0\
  173. \0\233\061\062~\0\
  174. \0\233\061\063~\0\
  175. \0\233\061\064~\0\
  176. \0\233\061\065~\0\
  177. \0\233\061\066~\0\
  178. \0\233\061\067~\0\
  179. \0\233\061\070~\0\
  180. \0\233\061\071~\0\
  181. \0\233?~\0\
  182. \0\0"
  183.  
  184. #  define ATARI_TCAP "atari\0\
  185. \0\033l\0\
  186. \0\033L\0\
  187. \1\033M\0\
  188. \2\033E\0\
  189. \0\033f\0\
  190. \0\033e\0\
  191. \0\0"
  192.  
  193. #  define ANSI_TCAP "ansi\0\
  194. \0\033[2K\0\
  195. \0\033[L\0\
  196. \0\033[%dL\0\
  197. \0\033[M\0\
  198. \0\033[%dM\0\
  199. \1\033[2J\0\
  200. \3\033[0m\0\
  201. \0\033[7m\0\
  202. \3\001\0\
  203. \0\033[%i%d;%dH\0\
  204. \1\033[%dC\0\
  205. \0\0"
  206.  
  207. /*
  208.  * These codes are valid when nansi.sys or equivalent has been installed.
  209.  * Function keys on a PC are preceded with a NUL. These are converted into
  210.  * K_NUL '\316' in GetChars(), because we cannot handle NULs in key codes.
  211.  * CTRL-arrow is used instead of SHIFT-arrow.
  212.  */
  213. #  define PCANSI_TCAP "pcansi\0\
  214. \0\033[K\0\
  215. \0\033[L\0\
  216. \1\033[M\0\
  217. \2\033[2J\0\
  218. \3\033[0m\0\
  219. \0\033[7m\0\
  220. \3\001\0\
  221. \0\033[%i%d;%dH\0\
  222. \1\033[%dC\0\
  223. \5\316H\0\
  224. \0\316P\0\
  225. \0\316K\0\
  226. \0\316M\0\
  227. \2\316s\0\
  228. \0\316t\0\
  229. \0\316;\0\
  230. \0\316<\0\
  231. \0\316=\0\
  232. \0\316>\0\
  233. \0\316?\0\
  234. \0\316@\0\
  235. \0\316A\0\
  236. \0\316B\0\
  237. \0\316C\0\
  238. \0\316D\0\
  239. \0\316T\0\
  240. \0\316U\0\
  241. \0\316V\0\
  242. \0\316W\0\
  243. \0\316X\0\
  244. \0\316Y\0\
  245. \0\316Z\0\
  246. \0\316[\0\
  247. \0\316\\\0\
  248. \0\316]\0\
  249. \0\0"
  250.  
  251. /*
  252.  * These codes are valid for the pc video.
  253.  * The entries that start with ESC | are translated into conio calls in msdos.c.
  254.  */
  255. #  define PCTERM_TCAP "pcterm\0\
  256. \0\033|K\0\
  257. \0\033|L\0\
  258. \1\033|M\0\
  259. \1\033|%i%d;%dr\0\
  260. \0\033|J\0\
  261. \3\033|0m\0\
  262. \0\033|112m\0\
  263. \0\033|63m\0\
  264. \0\033|0m\0\
  265. \0\033|31m\0\
  266. \0\001\0\
  267. \0\033|%i%d;%dH\0\
  268. \7\316H\0\
  269. \0\316P\0\
  270. \0\316K\0\
  271. \0\316M\0\
  272. \2\316s\0\
  273. \0\316t\0\
  274. \0\316;\0\
  275. \0\316<\0\
  276. \0\316=\0\
  277. \0\316>\0\
  278. \0\316?\0\
  279. \0\316@\0\
  280. \0\316A\0\
  281. \0\316B\0\
  282. \0\316C\0\
  283. \0\316D\0\
  284. \0\316T\0\
  285. \0\316U\0\
  286. \0\316V\0\
  287. \0\316W\0\
  288. \0\316X\0\
  289. \0\316Y\0\
  290. \0\316Z\0\
  291. \0\316[\0\
  292. \0\316\\\0\
  293. \0\316]\0\
  294. \0\0"
  295.  
  296. /*
  297.  * These codes are valid for the NT Console 
  298.  * The entries that start with ESC | are translated into console calls 
  299.  * in winnt.c.
  300.  */
  301. #  define NTCONSOLE_TCAP "ntconsole\0\
  302. \0\033|K\0\
  303. \0\033|L\0\
  304. \0\033|%dL\0\
  305. \0\033|M\0\
  306. \0\033|%dM\0\
  307. \1\033|J\0\
  308. \0\033|v\0\
  309. \0\033|V\0\
  310. \1\033|0m\0\
  311. \0\033|112m\0\
  312. \0\033|63m\0\
  313. \0\033|0m\0\
  314. \0\033|31m\0\
  315. \0\001\0\
  316. \0\033|%i%d;%dH\0\
  317. \7\316H\0\
  318. \0\316P\0\
  319. \0\316K\0\
  320. \0\316M\0\
  321. \2\316s\0\
  322. \0\316t\0\
  323. \0\316;\0\
  324. \0\316<\0\
  325. \0\316=\0\
  326. \0\316>\0\
  327. \0\316?\0\
  328. \0\316@\0\
  329. \0\316A\0\
  330. \0\316B\0\
  331. \0\316C\0\
  332. \0\316D\0\
  333. \0\316T\0\
  334. \0\316U\0\
  335. \0\316V\0\
  336. \0\316W\0\
  337. \0\316