home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 49 / PCPP49b.iso / freebies / BeOS5-PersonalEdition / data1.cab / Data_Files / image.be / beos / etc / vattr.src < prev    next >
Encoding:
Text File  |  2000-03-24  |  8.3 KB  |  317 lines

  1.  
  2.  
  3. ########
  4. #
  5. # This file describes attributes of video terminals for use by `ve'.  It is
  6. # converted to binary by `vconv':
  7. #    vconv <vattr.src >vattr
  8. # The binary can be converted back to source:
  9. #    vconv -s <vattr >vattr.src
  10. #
  11. # Data representation in this file closely follows the C language.  Numbers
  12. # range from 0 to 255 and may be base 8, 10 or 16, e.g.  017  15  and  0xF
  13. # all mean fifteen.  Character constants range from 0 to 255 and, if ASCII
  14. # printable, may be represented directly, e.g.  'a'  '!'  '1' .  Unprintable
  15. # chars require a special notation:
  16. #    '\n'    ASCII LF
  17. #    '\r'    ASCII CR
  18. #    '\b'    ASCII BS
  19. #    '\e'    ASCII ESC
  20. #    '\t'    ASCII HT
  21. # The  \  maps other chars to themselves, notably
  22. #    '\"'    double-quote
  23. #    '\''    single-quote
  24. #    '\\'    backslash
  25. # All chars, including those from 128 to 255, are expressible in octal, e.g.
  26. #    '\12'    ASCII LF
  27. #    '\012'    ASCII LF
  28. #    '\377'    decimal 255
  29. # Another notation is available, as used by `ve' itself:
  30. #    '^@'    ASCII NUL
  31. #    '^J'    ASCII LF
  32. #    '^['    ASCII ESC
  33. # Strings are represented as printable chars surrounded by  "  "  quotes.
  34. # Unprintable chars may be included by using the special notations for chars.
  35. #
  36. # Each entry in the file consists of the `term' keyword, then a string, then
  37. # the entry body braced by `{' and `}'.  The string supplies one or more
  38. # names, separated by the | symbol, by which users refer to the entry.  The
  39. # entry body consists of zero or more attribute definitions.  An attribute
  40. # may be of type integer, string or boolean.
  41. #
  42. # Integer attributes are evaluated at `ve' run-time.  The attribute name is
  43. # followed by an expression comprising the infix operators  *  /  +  -  and
  44. # grouping with  (  )  and the following forms of operands:
  45. #    * numbers, e.g.  15  017  0xF
  46. #    * char constants, e.g.  'j'  '\12'  '\n'  '^J'
  47. #    * positional parameters, e.g.  $1  $2  $3
  48. #    * window report parameters, e.g.  ^1  ^2  ^3
  49. #    * the repeat parameter  &
  50. # Parameters are described below.
  51. #
  52. # String attributes closely resemble the `printf' function in C.  The
  53. # attribute name is followed by a format string, then a list of zero or more
  54. # comma-separated arguments, which have the same syntax as the expressions
  55. # used by integer attributes.  While integer attributes yield a value when
  56. # evaluated, a string attribute is evaluated to generate output, usually an
  57. # escape sequence.  As the string is scanned, any char which is not a  %  is
  58. # output directly.  Otherwise, a conversion is performed according to the
  59. # following char.  First, the next argument in the list is evaluated.  The
  60. # resultant integer is then converted and output:
  61. #    %c    output the byte directly
  62. #    %d    convert to digits (base 10) and output
  63. #
  64. # A boolean definition consists of the attribute name, followed by the keyword
  65. # `true' or `false'.
  66. #
  67. # If the string attribute `wreport' is defined, `ve' evaluates it at startup.
  68. # The terminal or window must respond with an ANSI-standard escape sequence,
  69. # which `ve' saves in the window report parameters.  These parameters may be
  70. # referenced by any integer expression, especially by the integer attributes
  71. # `lines' and `cols'.
  72. #
  73. # Some escape sequences (e.g. ANSI) permit an iteration count.  If ten lines
  74. # need to be deleted, the `ldelete' string attribute could be evaluated ten
  75. # times.  However, if `ldelete' uses the repeat parameter  &  then the string
  76. # is evaluated only once: only one escape sequence is output.  The repeat
  77. # param is only meaningful with certain attributes: see the attribute table
  78. # below.
  79. #
  80. # Certain terminal functions require extra info, e.g. the cursor seek function
  81. # obviously needs the line and column.  `ve' supplies this info via the
  82. # positional parameters.  The positional params supplied will depend on the
  83. # particular attribute: see the attribute table below.
  84. #
  85. # The following attributes are supported:
  86. # attribute    notes    description & positional params (if any)
  87. # ---------    ----    ----------------------------------------
  88. # latin1    (B)    tty supports ISO Latin 1 characters, otherwise ASCII
  89. # wreport    (S)    request window size info
  90. # init        (S)    terminal initialization, e.g. setting tabs
  91. # lines        I    how many lines of display
  92. # cols        I    how many columns of display
  93. # seek        S    move cursor to line $1, column $2
  94. # up        (S)    move cursor straight up one line
  95. # right        (S)    move cursor right one column without erasing
  96. # lopen        S &    open blank line before current, shift down
  97. # ldelete    S &    delete current line, shift up
  98. # eoserase    S    erase to end-of-screen
  99. # eolerase    S    erase to end-of-line
  100. # starti    S ?    start insert character mode
  101. # stopi        S ?    stop insert mode
  102. # cinsert    S & ?    insert a blank before current char
  103. # cdelete    S &    delete current char
  104. # normal_attr    S a    set normal char attribute
  105. # zone_attr    (S)    set attribute for chars in a zone
  106. # error_attr    (S)    set char attribute for error messages
  107. # normal_cursor    (S)    set normal cursor appearance
  108. # insert_cursor    (S)    set cursor appearance when inserting
  109. #
  110. # Notes:    I    is type integer
  111. #        S    is type string
  112. #        B    is type boolean
  113. #        ()    optional
  114. #        &    repeat parameter is available
  115. #        ?    either starti/stopi or cinsert must be defined
  116. #        a    optional if both zone_attr & error_attr omitted
  117.  
  118.  
  119. # Zenith/Heathkit
  120. #
  121. term "z19|h19" {
  122.     lines        24
  123.     cols        80
  124.     seek        "\eY%c%c", $1+' ', $2+' '
  125.     up        "\eA"
  126.     right        "\eC"
  127.     lopen        "\eL"
  128.     ldelete        "\eM"
  129.     eoserase    "\eJ"
  130.     eolerase    "\eK"
  131.     starti        "\e@"
  132.     stopi        "\eO"
  133.     cdelete        "\eN"
  134.     normal_attr    "\eq"
  135.     zone_attr    "\ep"
  136.     error_attr    "\ep"
  137. }
  138.  
  139. # Zenith/Heathkit
  140. #
  141. term "z29|h29" {
  142.     lines        24
  143.     cols        80
  144.     seek        "\eY%c%c", $1+' ', $2+' '
  145.     up        "\eA"
  146.     right        "\eC"
  147.     lopen        "\eL"
  148.     ldelete        "\eM"
  149.     eoserase    "\eJ"
  150.     eolerase    "\eK"
  151.     starti        "\e@"
  152.     stopi        "\eO"
  153.     cdelete        "\eN"
  154.     normal_attr    "\es0"
  155.     zone_attr    "\es1"
  156.     error_attr    "\es1"
  157. }
  158.  
  159. # SUN Shelltool
  160. #
  161. term "sun" {
  162.     wreport        "\e[18t"
  163.     lines        ^2
  164.     cols        ^3
  165.     seek        "\e[%d;%dH", $1+1, $2+1
  166.     up        "\e[A"
  167.     right        "\e[C"
  168.     lopen        "\e[%dL", &
  169.     ldelete        "\e[%dM", &
  170.     eoserase    "\e[J"
  171.     eolerase    "\e[K"
  172.     cinsert        "\e[%d@", &
  173.     cdelete        "\e[%dP", &
  174.     normal_attr    "\e[0m"
  175.     zone_attr    "\e[7m"
  176.     error_attr    "\e[7m"
  177. }
  178.  
  179. # MacTerminal
  180. #
  181. term "mac" {
  182.     lines        24
  183.     cols        80
  184.     seek        "\e[%d;%dH", $1+1, $2+1
  185.     lopen        "\e[%dL\r", &
  186.     ldelete        "\e[%dM\r", &
  187.     eoserase    "\e[J"
  188.     eolerase    "\e[K"
  189.     cinsert        "\e[%d@", &
  190.     cdelete        "\e[%dP", &
  191.     normal_attr    "\e[0m"
  192.     zone_attr    "\e[1m"
  193.     error_attr    "\e[7m"
  194. }
  195.  
  196. # Amiga console (Z19 but 25 lines).
  197. #
  198. term "aconsole" {
  199.     lines        25
  200.     cols        80
  201.     seek        "\eY%c%c", $1+' ', $2+' '
  202.     up        "\eA"
  203.     right        "\eC"
  204.     lopen        "\eL"
  205.     ldelete        "\eM"
  206.     eoserase    "\eJ"
  207.     eolerase    "\eK"
  208.     starti        "\e@"
  209.     stopi        "\eO"
  210.     cdelete        "\eN"
  211.     normal_attr    "\eq"
  212.     zone_attr    "\ep"
  213.     error_attr    "\ep"
  214. }
  215.  
  216. # Amix screens & windowing system (vaguely ansi standard)
  217. #
  218. term "amiga" {
  219.     lines        24
  220.     cols        79
  221.     seek        "\e[%d;%dH", $1+1, $2+1
  222.     up        "\e[A"
  223.     right        "\e[C"
  224.     lopen        "\e[L"
  225.     ldelete        "\e[M"
  226.     eoserase    "\e[J"
  227.     eolerase    "\e[K"
  228.     cinsert        "\e[%d@", &
  229.     cdelete        "\e[%dP", &
  230.     normal_attr    "\e[m"
  231.     zone_attr    "\e[7m\e[2m"        # works on screens & windows
  232.     error_attr    "\e[7m"
  233. }
  234.  
  235. # the Amiga windowing system (vaguely ansi standard)
  236. # Rico's version has window size report a la SUN Shelltool.
  237. #
  238. term "amiga.rico" {
  239.     latin1        true
  240.     wreport        "\e[18t"
  241.     lines        ^2
  242.     cols        ^3 + 1
  243.     seek        "\e[%d;%dH", 24-^2+$1+1, $2+1
  244.     up        "\e[A"
  245.     right        "\e[C"
  246.     lopen        "\e[L"
  247.     ldelete        "\e[M"
  248.     eoserase    "\e[J"
  249.     eolerase    "\e[K"
  250.     cinsert        "\e[%d@", &
  251.     cdelete        "\e[%dP", &
  252.     normal_attr    "\e[m"
  253.     zone_attr    "\e[2m"
  254.     error_attr    "\e[4m"
  255. }
  256.  
  257. # ANSI terminal (e.g. Erich's SCO odtterm, xterm, bebox Terminal)
  258. # This has window size reporting via escape sequence.
  259. #
  260. term "beterm|ansi|xterm" {
  261.     latin1        true
  262.     wreport        "\e[999;999H\e[6n\r"
  263.     lines        ^1
  264.     cols        ^2
  265.     seek        "\e[%d;%dH", $1+1, $2+1
  266.     up        "\e[A"
  267.     right        "\e[C"
  268.     lopen        "\e[%dL", &
  269.     ldelete        "\e[%dM", &
  270.     eoserase    "\e[J"
  271.     eolerase    "\e[K"
  272.     cinsert        "\e[%d@", &
  273.     cdelete        "\e[%dP", &
  274.     normal_attr    "\e[m"
  275.     zone_attr    "\e[31m"
  276.     error_attr    "\e[35;7m"
  277. }
  278.  
  279. # ansi terminal
  280. # This entry is used with SCO full screen virtual terminals, because they
  281. # don't support window size reporting.
  282. #
  283. term "ansi80x25" {
  284.     lines        25
  285.     cols        80
  286.     seek        "\e[%d;%dH", $1+1, $2+1
  287.     up        "\e[A"
  288.     right        "\e[C"
  289.     lopen        "\e[%dL", &
  290.     ldelete        "\e[%dM", &
  291.     eoserase    "\e[J"
  292.     eolerase    "\e[K"
  293.     cinsert        "\e[%d@", &
  294.     cdelete        "\e[%dP", &
  295.     normal_attr    "\e[m"
  296.     zone_attr    "\e[1m"
  297.     error_attr    "\e[7m"
  298. }
  299.  
  300. # bebox newsh (not ansi)
  301. #
  302. term "bebox" {
  303.     init        "\eX  "
  304.     lines        25
  305.     cols        88
  306.     seek        "\eH%c%c", $1, $2
  307.     lopen        "\eL%c ",  &
  308.     ldelete        "\eM%c ",  &
  309.     eoserase    "\eJ  "
  310.     eolerase    "\eK  "
  311.     cinsert        "\e@%c ",  &
  312.     cdelete        "\eP%c ",  &
  313.     normal_attr    "\en  "
  314.     zone_attr    "\ez  "
  315.     error_attr    "\ee  "
  316. }
  317.