VT52TerminalView.st
changeset 2192 5f3bf896d334
parent 1420 7564d09aa1b2
child 2202 263eab24b870
equal deleted inserted replaced
2191:221cae81c950 2192:5f3bf896d334
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 
    13 
       
    14 
       
    15 "{ Package: 'stx:libwidg2' }"
    14 
    16 
    15 TerminalView subclass:#VT52TerminalView
    17 TerminalView subclass:#VT52TerminalView
    16 	instanceVariableNames:'param1 param2'
    18 	instanceVariableNames:'param1 param2'
    17 	classVariableNames:''
    19 	classVariableNames:''
    18 	poolDictionaries:''
    20 	poolDictionaries:''
   102     "setup my keyboard sequences for a vt52"
   104     "setup my keyboard sequences for a vt52"
   103 
   105 
   104     kbdSequences := (self vt52KeyCodes)
   106     kbdSequences := (self vt52KeyCodes)
   105 
   107 
   106 
   108 
       
   109 !
       
   110 
       
   111 setTerminalModes
       
   112 
       
   113     ^ self.
   107 ! !
   114 ! !
   108 
   115 
   109 !VT52TerminalView methodsFor:'processing - input'!
   116 !VT52TerminalView methodsFor:'processing - input'!
   110 
   117 
   111 nextPut:char
   118 nextPut:char
   112     "process a character (i.e. the shells output)"
   119     "process a character (i.e. the shells output)"
   113 
   120 
   114 "/ Transcript show:state; show:' '; showCR:char storeString.
   121     Debug ifTrue:[
       
   122         Transcript show:state; show:' '; showCR:char storeString.
       
   123     ].
   115 
   124 
   116     state == #gotReturn ifTrue:[
   125     state == #gotReturn ifTrue:[
   117         state := 0.
   126         state := 0.
   118         char == Character nl ifTrue:[
   127         char == Character nl ifTrue:[
   119             "/ cr-nl
   128             "/ cr-nl
   157             ^ self 
   166             ^ self 
   158         ].
   167         ].
   159         char asciiValue < 32 ifTrue:[
   168         char asciiValue < 32 ifTrue:[
   160             char ~~ Character tab ifTrue:[
   169             char ~~ Character tab ifTrue:[
   161                 char asciiValue ~~ 0 ifTrue:[
   170                 char asciiValue ~~ 0 ifTrue:[
   162                     Transcript show:'unhandled control key: '; showCR:char storeString.
   171                     Debug ifTrue:[
       
   172                         Transcript show:'unhandled control key: '; showCR:char storeString.
       
   173                     ].
   163                 ].
   174                 ].
   164                 ^ self.
   175                 ^ self.
   165             ]
   176             ]
   166         ].
   177         ].
   167         ^ super nextPut:char
   178         ^ super nextPut:char
   209         char == $Y ifTrue: [
   220         char == $Y ifTrue: [
   210             "/ ESC-Y - cursor positioning
   221             "/ ESC-Y - cursor positioning
   211             state := #motion1.
   222             state := #motion1.
   212             ^ self 
   223             ^ self 
   213         ].
   224         ].
   214         Transcript show:'unhandled esc-key: '; showCR:char storeString.
   225         Debug ifTrue:[
       
   226             Transcript show:'unhandled esc-key: '; showCR:char storeString.
       
   227         ].
   215     ].
   228     ].
   216 
   229 
   217     state == #motion1 ifTrue:[
   230     state == #motion1 ifTrue:[
   218         "/ char-value - 32 is line
   231         "/ char-value - 32 is line
   219         param1 := (char asciiValue - 32).
   232         param1 := (char asciiValue - 32).
   221         ^ self.
   234         ^ self.
   222     ].
   235     ].
   223     state == #motion2 ifTrue:[
   236     state == #motion2 ifTrue:[
   224         "/ char-value - 32 is col
   237         "/ char-value - 32 is col
   225         param2 := (char asciiValue - 32).
   238         param2 := (char asciiValue - 32).
   226 "/        Transcript show:'motion '; show:param1+1; show:' '; showCR:param2+1.
   239         Debug ifTrue:[
       
   240             Transcript show:'motion '; show:param1+1; show:' '; showCR:param2+1.
       
   241         ].
   227         self cursorVisibleLine:param1+1 col:param2+1.
   242         self cursorVisibleLine:param1+1 col:param2+1.
   228         ^ self endOfSequence
   243         ^ self endOfSequence
   229     ].
   244     ].
   230 
   245 
   231     self doNothing
   246     self doNothing
   247 ! !
   262 ! !
   248 
   263 
   249 !VT52TerminalView class methodsFor:'documentation'!
   264 !VT52TerminalView class methodsFor:'documentation'!
   250 
   265 
   251 version
   266 version
   252     ^ '$Header: /cvs/stx/stx/libwidg2/VT52TerminalView.st,v 1.16 1999-06-24 09:56:09 cg Exp $'
   267     ^ '$Header: /cvs/stx/stx/libwidg2/VT52TerminalView.st,v 1.17 2002-09-18 14:32:06 penk Exp $'
   253 ! !
   268 ! !