VT52TerminalView.st
author Claus Gittinger <cg@exept.de>
Thu, 24 Jun 1999 11:56:09 +0200
changeset 1420 7564d09aa1b2
parent 1419 55972fc3268f
child 2192 5f3bf896d334
permissions -rw-r--r--
documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1362
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     1
"
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     3
              All Rights Reserved
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     4
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     5
 This software is furnished under a license and may be used
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     6
 only in accordance with the terms of that license and with the
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     8
 be provided or otherwise made available to, or used by, any
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
     9
 other person.  No title to or ownership of the software is
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    10
 hereby transferred.
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    11
"
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    12
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    13
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    14
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
TerminalView subclass:#VT52TerminalView
998
4915be34a1d7 state instvar moved
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
    16
	instanceVariableNames:'param1 param2'
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Views-TerminalViews'
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!VT52TerminalView class methodsFor:'documentation'!
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
1362
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    24
copyright
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    25
"
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    26
 COPYRIGHT (c) 1998 by eXept Software AG
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    27
              All Rights Reserved
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    28
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    29
 This software is furnished under a license and may be used
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    30
 only in accordance with the terms of that license and with the
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    32
 be provided or otherwise made available to, or used by, any
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    33
 other person.  No title to or ownership of the software is
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    34
 hereby transferred.
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    35
"
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    36
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    37
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    38
!
178613e27d74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    39
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
1419
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    42
    A VT52 terminal emulator.
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    43
    Most of the functionality is inherited from my superclass,
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    44
    I redefine/specialize certain methods for VT52 escape sequences
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    45
    and vt52 keyboard codes
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    46
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    47
    [start with:]
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    48
        VT52TerminalView openShell
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    49
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    50
    [see also:]
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    51
        VT100TerminalView
55972fc3268f documentation
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    52
        TelnetTool
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [start with:]
916
d9626e722c21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
    55
        VT52TerminalView openShell
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
"
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
! !
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
!VT52TerminalView methodsFor:'defaults'!
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
vt52KeyCodes
1420
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
    63
    "return a vt52 keyCode table"
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
    64
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    ^ IdentityDictionary withKeysAndValues:
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
        #(
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
             #CursorUp    '\eA'
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
             #CursorDown  '\eB'
927
b0b5b368e80f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    69
             #CursorRight '\eC'
b0b5b368e80f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    70
             #CursorLeft  '\eD'
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
             #Home        '\eH'
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
             #Escape      '\e'
927
b0b5b368e80f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    73
             #BackSpace   '\b'
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
             #Return      '\r'
976
40af522dda86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
    75
             #Delete      '\0177'
1356
68b9f4468961 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    76
             #Tab         '\t'
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
         )
927
b0b5b368e80f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    78
1356
68b9f4468961 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    79
    "Modified: / 5.5.1999 / 15:01:37 / cg"
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
! !
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    82
!VT52TerminalView methodsFor:'events'!
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    83
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    84
defineWindowSize
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    85
    super defineWindowSize.
980
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
    86
    rangeEndLine := numberOfLines
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    87
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    88
    "Created: / 13.6.1998 / 18:15:43 / cg"
980
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
    89
    "Modified: / 20.6.1998 / 20:33:29 / cg"
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    90
! !
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    91
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!VT52TerminalView methodsFor:'initialization'!
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
initialize
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    super initialize.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
    96
    self endOfSequence.
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
980
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
    98
    "Modified: / 20.6.1998 / 20:34:18 / cg"
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
!
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
initializeKeyboardSequences
1420
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   102
    "setup my keyboard sequences for a vt52"
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   103
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    kbdSequences := (self vt52KeyCodes)
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
! !
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   109
!VT52TerminalView methodsFor:'processing - input'!
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   110
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   111
nextPut:char
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   112
    "process a character (i.e. the shells output)"
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   113
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   114
"/ Transcript show:state; show:' '; showCR:char storeString.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   115
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   116
    state == #gotReturn ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   117
        state := 0.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   118
        char == Character nl ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   119
            "/ cr-nl
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   120
            "/ stay in buffering mode.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   121
            super nextPut:Character cr.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   122
            ^ self.
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   123
        ].
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   124
        self endEntry.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   125
        self cursorToBeginOfLine.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   126
        "/ continue in initial state
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   127
    ].
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   128
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   129
    state == 0 ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   130
        "/ Currently, we are in initial state.  
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   131
        "/ Decide what to do on the basis of the parameter char.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   132
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   133
        (char == Character esc) ifTrue:[ 
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   134
            self endEntry.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   135
            state := #gotESC. 
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   136
            ^ self 
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   137
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   138
        (char == Character nl) ifTrue:[ 
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   139
            self doCursorDown:1.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   140
            ^ self endEntry.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   141
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   142
        (char == Character return) ifTrue:[ 
980
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   143
            (rangeEndLine notNil and:[rangeEndLine ~~ numberOfLines]) ifTrue:[
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   144
                self endEntry.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   145
                self cursorToBeginOfLine.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   146
            ] ifFalse:[
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   147
                state := #gotReturn.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   148
            ].
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   149
            ^ self.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   150
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   151
        (char == Character backspace) ifTrue:[ 
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   152
            self doCursorLeft. "/ doBackspace
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   153
            ^ self endEntry.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   154
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   155
        (char == Character bell) ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   156
            self beep.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   157
            ^ self 
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   158
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   159
        char asciiValue < 32 ifTrue:[
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   160
            char ~~ Character tab ifTrue:[
980
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   161
                char asciiValue ~~ 0 ifTrue:[
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   162
                    Transcript show:'unhandled control key: '; showCR:char storeString.
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   163
                ].
8921b6e07c9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   164
                ^ self.
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   165
            ]
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   166
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   167
        ^ super nextPut:char
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   168
    ].
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   169
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   170
    state == #gotESC ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   171
        "/ Currently, we are in ESC state.  
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   172
        "/ Decide what to do on the basis of the parameter char.
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   173
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   174
        char == $A ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   175
            "/ ESC-A
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   176
            self doCursorUp:1.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   177
            ^ self endOfSequence
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   178
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   179
        char == $B ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   180
            "/ ESC-B
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   181
            self doCursorDown:1.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   182
            ^ self endOfSequence
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   183
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   184
        char == $C ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   185
            "/ ESC-C
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   186
            self doCursorRight:1.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   187
            ^ self endOfSequence
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   188
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   189
        char == $D ifTrue:[
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   190
            "/ ESC-D
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   191
            self doCursorLeft:1.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   192
            ^ self endOfSequence
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   193
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   194
        char == $H ifTrue: [
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   195
            "/ ESC-H
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   196
            self doCursorHome.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   197
            ^ self endOfSequence
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   198
        ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   199
        char == $J ifTrue: [
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   200
            "/ ESC-J
1001
7fe14ad43ae3 fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   201
            self doClearToEndOfScreen.
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   202
            ^ self endOfSequence
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   203
        ].
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   204
        char == $K ifTrue: [
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   205
            "/ ESC-J
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   206
            self doClearToEndOfLine.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   207
            ^ self endOfSequence
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   208
        ].
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   209
        char == $Y ifTrue: [
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   210
            "/ ESC-Y - cursor positioning
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   211
            state := #motion1.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   212
            ^ self 
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   213
        ].
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   214
        Transcript show:'unhandled esc-key: '; showCR:char storeString.
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   215
    ].
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   216
956
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   217
    state == #motion1 ifTrue:[
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   218
        "/ char-value - 32 is line
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   219
        param1 := (char asciiValue - 32).
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   220
        state := #motion2.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   221
        ^ self.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   222
    ].
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   223
    state == #motion2 ifTrue:[
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   224
        "/ char-value - 32 is col
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   225
        param2 := (char asciiValue - 32).
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   226
"/        Transcript show:'motion '; show:param1+1; show:' '; showCR:param2+1.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   227
        self cursorVisibleLine:param1+1 col:param2+1.
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   228
        ^ self endOfSequence
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   229
    ].
606dee2ae341 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   230
949
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   231
    self doNothing
1a6071a5c370 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   232
1001
7fe14ad43ae3 fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   233
    "Modified: / 21.7.1998 / 20:06:04 / cg"
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   234
! !
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   235
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   236
!VT52TerminalView methodsFor:'queries'!
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   237
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   238
terminalType
1420
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   239
    "returns a string describing this terminal (usually, this is
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   240
     passed down to the shell as TERM environment variable).
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   241
     Here, 'vt52' is returned."
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   242
1353
fbac065072ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   243
    ^ 'vt52'
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   244
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   245
    "Created: / 10.6.1998 / 16:22:46 / cg"
1353
fbac065072ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   246
    "Modified: / 5.5.1999 / 11:22:50 / cg"
932
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   247
! !
af0236d38242 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   248
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
!VT52TerminalView class methodsFor:'documentation'!
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
version
1420
7564d09aa1b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   252
    ^ '$Header: /cvs/stx/stx/libwidg2/VT52TerminalView.st,v 1.16 1999-06-24 09:56:09 cg Exp $'
914
7ac6d1a53bab initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
! !