"   TERMINAL DEFINITION FILE FOR TAB 132 EDIT TERMINAL                        "

"   VARIABLES                                                                 "

prefix              = (esc '[')
prefix_2            = (esc '_')
suffix              = (esc '\')

ansi                = (esc '<')
ascii               = (esc '(B' esc ')0' si)
clear_home          = (prefix '2J')
deckpam             = (esc '=')        " shifted keypad                "
deckpnm             = (esc '>')        " normal keypad                 "
deckckm             = (prefix '?1l')   " ansi cursor keys              "
decstbm             = (prefix 'r')     " set margins                   "
exit_edit           = (prefix '?10l')
lock_keyboard       = (prefix '2h')
normal_attributes   = (prefix 'm')
null                = ( nul nul nul nul nul nul nul nul nul nul )
reset_mode_ansi     = (prefix '1l')
reset_mode_dec      = (prefix '?1;6;11;13l')
reset_mode_tab      = (prefix '=4l')
send_nulls          = ( null null null null null null null null null null )
set_mode_ansi       = (prefix '6;16h')
set_mode_dec        = (prefix '?7;10;14;16h')
set_mode_tab1       = (prefix '=6h')
set_mode_tab2       = (prefix '=7h')
set_to_24x80        = (prefix '?3l')
set_to_24x132       = (prefix '?3h')
soft_key1 = ( prefix_2 'L1   S1    ' suffix ..
              prefix_2 'M1' esc 'Oa' suffix )
soft_key2 = ( prefix_2 'L2   S2    ' suffix ..
              prefix_2 'M2' esc 'OA' suffix )
soft_key3 = ( prefix_2 'L3   S3    ' suffix ..
              prefix_2 'M3' esc 'Ob' suffix )
soft_key4 = ( prefix_2 'L4   S4    ' suffix ..
              prefix_2 'M4' esc 'OB' suffix )
soft_key5 = ( prefix_2 'L5   S5    ' suffix ..
              prefix_2 'M5' esc 'Oc' suffix )
soft_key6 = ( prefix_2 'L6   S6    ' suffix ..
              prefix_2 'M6' esc 'OC' suffix )
soft_key7 = ( prefix_2 'L7   S7    ' suffix ..
              prefix_2 'M7' esc 'Od' suffix )
soft_key8 = ( prefix_2 'L8   S8    ' suffix ..
              prefix_2 'M8' esc 'OD' suffix )
start_alternate     = (prefix '1m')
start_blink         = (prefix '5m')
start_inverse       = (prefix '7m')
start_underline     = (prefix '4m')
stop_alternate      = (prefix 'm')
stop_blink          = (prefix 'm')
stop_inverse        = (prefix 'm')
stop_underline      = (prefix 'm')
taboff              = (prefix_2 'TABOFF' suffix)
tabon               = (prefix_2 'TABON' suffix)
tbc                 = (prefix '3g')    " clear tabs                    "
unlock_keyboard     = (prefix '2l')
vt132               = (prefix '=2l')

"   MODEL NAME AND COMMUNICATION TYPE                                         "
model_name          value = 'TAB_132_EDIT'
communications      type  = asynch
application_string name='driver_procedure' out='tup$bootstrap_VT132_driver'

"   END OF INFORMATION SPECIFICATION                                          "
end_of_information  in    = (0)

"   CURSOR POSITIONING INFORMATION                                            "
cursor_pos_encoding      bias  = (1)   type = ansi_cursor
cursor_pos_column_first  value = FALSE
cursor_pos_column_length value = (0)
cursor_pos_row_length    value = (0)
cursor_pos_begin         out   = (prefix)
cursor_pos_second        out   = (';')
cursor_pos_third         out   = ('H')

"   CURSOR MOVEMENT INFORMATION                                               "
cursor_home              inout = (prefix 'H')
cursor_up                inout = (prefix 'A')
cursor_down              inout = (prefix 'B')
cursor_left              inout = (prefix 'D')
cursor_right             inout = (prefix 'C')

"   CURSOR BEHAVIOR (for cursor movement keys)                                "
move_past_right          type  = wrap_adjacent_next
move_past_left           type  = stop_next
move_past_top            type  = stop_next
move_past_bottom         type  = stop_next

"   CURSOR BEHAVIOR (for character keys)                                      "
char_past_right          type  = wrap_adjacent_next
char_past_left           type  = stop_next
char_past_last_position  type  = stop_next

"   TERMINAL ATTRIBUTES                                                       "
automatic_tabbing        value = FALSE
clears_when_change_size  value = TRUE
function_key_leaves_mark value = 0
has_hidden               value = FALSE
has_protect              value = TRUE
home_at_top              value = TRUE
multiple_sizes           value = TRUE
tabs_to_home             value = FALSE
tabs_to_tab_stops        value = FALSE
tabs_to_unprotected      value = TRUE
type_ahead               value = FALSE

"   SCREEN SIZES                                                              "
set_size    rows = 24 columns = 80   out = (set_to_24x80 clear_home esc '9')
set_size    rows = 24 columns = 132  out = (set_to_24x132 clear_home esc '9')

"   SCREEN AND LINE MODE TRANSITION                                           "
initialize_terminal sc='$system.change_terminal_attributes fkc=dec_vt100'
screen_init    out = ( ansi ascii vt132 tabon deckpnm send_nulls )
screen_init    out = ( reset_mode_dec set_mode_dec decstbm send_nulls )
screen_init    out = ( reset_mode_ansi set_mode_ansi tbc send_nulls )
screen_init    out = ( reset_mode_tab set_mode_tab1 set_mode_tab2 send_nulls )
screen_init    out = ( soft_key1 soft_key2 soft_key3 soft_key4 send_nulls )
screen_init    out = ( soft_key5 soft_key6 soft_key7 soft_key8 send_nulls )

set_line_mode  out = ( ansi ascii vt132 exit_edit deckpnm send_nulls ..
                       unlock_keyboard tbc set_to_24x80 taboff )

"   TERMINAL CAPABILITIES                                                     "
delete_char         in    = (prefix 'P')
delete_line_bol     in    = (prefix 'M')
erase_end_of_line   inout = (prefix 'K')
erase_line_stay     inout = (prefix '2K')
erase_page_home     inout = (clear_home)
insert_line_bol     in    = (prefix 'L')
insert_mode_begin   in    = (prefix '4h')
insert_mode_end     in    = (prefix '4l')
tab_forward         in    = (rs)
tab_clear_all       inout = (tbc)

"   MISCELLANEOUS TERMINAL SEQUENCES                                          "
bell_nak            out = (bel)
backspace           in = bs

"   PROGRAMMABLE FUNCTION KEY INPUT INFORMATION                               "

f1        in = (esc 'Oa') label='S1'
f2        in = (esc 'OA') label='S2'
f3        in = (esc 'Ob') label='S3'
f4        in = (esc 'OB') label='S4'
f5        in = (esc 'Oc') label='S5'
f6        in = (esc 'OC') label='S6'
f7        in = (esc 'Od') label='S7'
f8        in = (esc 'OD') label='S8'
f9        in = ()
f10       in = ()
f11       in = ()
f12       in = ()
f13       in = ()
f14       in = ()
f15       in = ()
f16       in = ()
f1_s      in = ()
f2_s      in = ()
f3_s      in = ()
f4_s      in = ()
f5_s      in = ()
f6_s      in = ()
f7_s      in = ()
f8_s      in = ()
f9_s      in = ()
f10_s     in = ()
f11_s     in = ()
f12_s     in = ()
f13_s     in = ()
f14_s     in = ()
f15_s     in = ()
f16_s     in = ()

"   CDC STANDARD FUNCTION KEY INPUT INFORMATION                               "
next      in = 13            label = 'RETURN'
next_s    in = ()
bkw       in = ()
fwd       in = ()
back      in = ()
help      in = ()
undo      in = ()
stop      in = ()
bkw_s     in = ()
fwd_s     in = ()
undo_s    in = ()
stop_s    in = ()
down      in = ()
down_s    in = ()
up        in = ()
up_s      in = ()
edit      in = ()
edit_s    in = ()
data      in = ()
data_s    in = ()

"   TERMINAL VIDEO ATTRIBUTES                                                 "
alt_begin           out = (start_inverse)
alt_end             out = (stop_inverse)
blink_begin         out = (start_blink)
blink_end           out = normal_attributes
high_intensity_begin  out = (start_inverse)
high_intensity_end  out = (stop_inverse)
inverse_begin       out = (start_inverse)
inverse_end         out = (stop_inverse)
output_begin        out = (lock_keyboard prefix '}')
output_end          out = (prefix '1}' unlock_keyboard)
protect_begin       out = (start_alternate)
protect_end         out = (stop_alternate)
underline_begin     out = (start_underline)
underline_end       out = (stop_underline)



"   LOGICAL ATTRIBUTE SPECIFICATIONS                                          "
error_begin         out = (start_inverse)
error_end           out = (stop_inverse)
input_text_begin    out = (start_underline)
input_text_end      out = (stop_underline)
italic_begin        out = (start_inverse)
italic_end          out = (stop_inverse)

"   LINE DRAWING CHARACTER SPECIFICATION                                      "
ld_fine_begin            out = so
ld_fine_end              out = si
ld_fine_horizontal       out = 'q'
ld_fine_vertical         out = 'x'
ld_fine_upper_left       out = 'l'
ld_fine_upper_right      out = 'k'
ld_fine_lower_left       out = 'm'
ld_fine_lower_right      out = 'j'
ld_fine_up_t             out = 'w'
ld_fine_down_t           out = 'v'
ld_fine_left_t           out = 't'
ld_fine_right_t          out = 'u'
ld_fine_cross            out = 'n'
ld_medium_begin          out = (so start_alternate)
ld_medium_end            out = (si stop_alternate)
ld_medium_horizontal     out = 'q'
ld_medium_vertical       out = 'x'
ld_medium_upper_left     out = 'l'
ld_medium_upper_right    out = 'k'
ld_medium_lower_left     out = 'm'
ld_medium_lower_right    out = 'j'
ld_medium_up_t           out = 'w'
ld_medium_down_t         out = 'v'
ld_medium_left_t         out = 't'
ld_medium_right_t        out = 'u'
ld_medium_cross          out = 'n'
ld_bold_begin            out = (start_inverse)
ld_bold_end              out = (stop_inverse)
ld_bold_horizontal       out = (' ')
ld_bold_vertical         out = (' ')
ld_bold_upper_left       out = (' ')
ld_bold_upper_right      out = (' ')
ld_bold_lower_left       out = (' ')
ld_bold_lower_right      out = (' ')
ld_bold_up_t             out = (' ')
ld_bold_down_t           out = (' ')
ld_bold_left_t           out = (' ')
ld_bold_right_t          out = (' ')
ld_bold_cross            out = (' ')

"   DEFAULT KEY DEFINITIONS FOR THE FULL SCREEN EDITOR                        "

"   END OF TERMINAL DEFINITION FILE FOR TAB 132 EDIT TERMINAL                 "
