home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d166 / stevie.lha / Stevie / source / term.h < prev    next >
C/C++ Source or Header  |  1988-11-22  |  5KB  |  118 lines

  1. /*
  2.  * STEVIE - Simply Try this Editor for VI Enthusiasts
  3.  *
  4.  * Code Contributions By : Tim Thompson           twitch!tjt
  5.  *                         Tony Andrews           onecom!wldrdg!tony 
  6.  *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  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.  * Currently, insert/delete line sequences are used for screen scrolling. There
  17.  * are lots of terminals that have 'index' and 'reverse index' capabilities,
  18.  * but no line insert/delete. For this reason, the editor routines s_ins()
  19.  * and s_del() should be modified to use 'index' sequences when the line to
  20.  * be inserted or deleted at line zero. 
  21.  */
  22.  
  23. /*
  24.  * The macro names here correspond (more or less) to the actual ANSI names 
  25.  */
  26.  
  27. #ifdef    ATARI
  28. #define    T_EL    "\033l"        /* erase the entire current line */
  29. #define    T_IL    "\033L"        /* insert one line */
  30. #define    T_IL_B    ""
  31. #define    T_DL    "\033M"        /* delete one line */
  32. #define    T_DL_B    ""
  33. #define    T_SC    "\033j"        /* save the cursor position */
  34. #define    T_ED    "\033E"        /* erase display (may optionally home cursor) */
  35. #define    T_RC    "\033k"        /* restore the cursor position */
  36. #define    T_CI    "\033f"        /* invisible cursor (very optional) */
  37. #define    T_CV    "\033e"        /* visible cursor (very optional) */
  38. #define T_TP    ""        /* plain text */
  39. #define T_TI    ""        /* inverse-video text */
  40. #endif
  41.  
  42. #ifdef    UNIX
  43. /*
  44.  * The UNIX sequences are hard-wired for ansi-like terminals. I should really
  45.  * use termcap/terminfo, but the UNIX port was done for profiling, not for
  46.  * actual use, so it wasn't worth the effort. 
  47.  */
  48. #define    T_EL    "\033[2K"    /* erase the entire current line */
  49. #define    T_IL    "\033[L"    /* insert one line */
  50. #define    T_IL_B    ""
  51. #define    T_DL    "\033[M"    /* delete one line */
  52. #define    T_DL_B    ""
  53. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  54. #define    T_SC    "\0337"        /* save the cursor position */
  55. #define    T_RC    "\0338"        /* restore the cursor position */
  56. #define    T_CI    ""        /* invisible cursor (very optional) */
  57. #define    T_CV    ""        /* visible cursor (very optional) */
  58. #define T_TP    ""        /* plain text */
  59. #define T_TI    ""        /* inverse-video text */
  60. #endif
  61.  
  62. #ifdef    BSD
  63. /* The BSD 4.3 sequences are hard-wired for ansi-like terminals. */
  64. #define    T_EL    "\033[2K"    /* erase the entire current line */
  65. #define    T_IL    "\033[L"    /* insert line */
  66. #define    T_IL_B    ""
  67. #define    T_DL    "\033[M"    /* delete line */
  68. #define    T_DL_B    ""
  69. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  70. #define    T_SC    ""        /* save the cursor position */
  71. #define    T_RC    ""        /* restore the cursor position */
  72. #define    T_CI    ""        /* invisible cursor (very optional) */
  73. #define    T_CV    ""        /* visible cursor (very optional) */
  74. #define T_TP    ""        /* plain text */
  75. #define T_TI    ""        /* inverse-video text */
  76. #endif
  77.  
  78. #ifdef    OS2
  79. /*
  80.  * The OS/2 ansi console driver is pretty deficient. No insert or delete line
  81.  * sequences. The erase line sequence only erases from the cursor to the end
  82.  * of the line. For our purposes that works out okay, since the only time
  83.  * T_EL is used is when the cursor is in column 0. 
  84.  */
  85. #define    T_EL    "\033[K"    /* erase the entire current line */
  86. #define    T_IL    ""        /* insert one line */
  87. #define    T_IL_B    ""
  88. #define    T_DL    ""        /* delete one line */
  89. #define    T_DL_B    ""
  90. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  91. #define    T_SC    "\033[s"    /* save the cursor position */
  92. #define    T_RC    "\033[u"    /* restore the cursor position */
  93. #define    T_CI    ""        /* invisible cursor (very optional) */
  94. #define    T_CV    ""        /* visible cursor (very optional) */
  95. #define T_TP    ""        /* plain text */
  96. #define T_TI    ""        /* inverse-video text */
  97. #endif
  98.  
  99. #ifdef AMIGA
  100. /*
  101.  * The erase line sequence only erases from the cursor to the end of the
  102.  * line. For our purposes that works out okay, since the only time T_EL is
  103.  * used is when the cursor is in column 0. 
  104.  */
  105. #define    T_EL    "\033[K"    /* erase the entire current line */
  106. #define    T_IL    "\033["        /* insert line */
  107. #define    T_IL_B    "L"
  108. #define    T_DL    "\033["        /* delete line */
  109. #define    T_DL_B    "M"
  110. #define    T_ED    "\014"        /* erase display (may optionally home cursor) */
  111. #define    T_RC    ""        /* restore the cursor position */
  112. #define    T_SC    ""        /* save the cursor position */
  113. #define    T_CI    "\033[0 p"    /* invisible cursor (very optional) */
  114. #define    T_CV    "\033[1 p"    /* visible cursor (very optional) */
  115. #define T_TP    "\033[0m"    /* plain text */
  116. #define T_TI    "\033[7m"    /* inverse-video text */
  117. #endif
  118.