class: VT100TerminalView
authorClaus Gittinger <cg@exept.de>
Tue, 23 Jul 2013 23:08:35 +0200
changeset 4296 c52538ab6102
parent 4295 5bd43114a67b
child 4297 da54726fd311
class: VT100TerminalView added:7 methods comment/format in: #terminalType changed: #displayMode: #processStateGotCSI:
VT100TerminalView.st
--- a/VT100TerminalView.st	Tue Jul 23 23:08:07 2013 +0200
+++ b/VT100TerminalView.st	Tue Jul 23 23:08:35 2013 +0200
@@ -260,6 +260,17 @@
     "Modified: / 12.6.1998 / 21:19:15 / cg"
 !
 
+deleteLines
+    "Delete the appropriate number of lines (param 1)
+     at the cursor position."
+
+    |n|
+
+    n := ((parameters at: 1) max: 1).
+self halt:'untested code'.
+    self deleteFromLine:cursorLine toLine:cursorLine+n-1.
+!
+
 displayMode:p1
     "Set the current display mode (emphasis) as specified by param 1."
 
@@ -311,6 +322,11 @@
         self color:(Color perform:clrName).
         ^ self.
     ].
+    p1 == 39 ifTrue:[
+        "/ normal fg color
+        self color:nil.
+        ^ self
+    ].
     (p1 between:40 and:47) ifTrue:[
         "/ ESC-[-40-m  -> black bg color
         "/ ...
@@ -319,6 +335,22 @@
         self bgColor:(Color perform:clrName).
         ^ self.
     ].
+    p1 == 49 ifTrue:[
+        "/ normal fg color
+        self bgColor:nil.
+        ^ self
+    ].
+
+    (p1 between:90 and:97) ifTrue:[
+        clrName := #(black red green yellow blue magenta cyan white) at:(p1-30+1).
+        self color:(Color perform:clrName) lightened.
+        ^ self.
+    ].
+    (p1 between:100 and:107) ifTrue:[
+        clrName := #(black red green yellow blue magenta cyan white) at:(p1-30+1).
+        self bgColor:(Color perform:clrName) lightened.
+        ^ self.
+    ].
 
     "/ ESC-[-any-m  -> normal
     self normal.
@@ -342,6 +374,14 @@
     "Modified: / 21.7.1998 / 20:07:36 / cg"
 !
 
+doCursorNextLine:n
+    self halt:'unimplemented function'.
+!
+
+doCursorPreviousLine:n
+    self halt:'unimplemented function'.
+!
+
 insertCharacters
     "Insert the appropriate number of spaces (param 1) at the cursor position."
 
@@ -354,6 +394,16 @@
     "Created: / 28.7.1998 / 00:53:51 / cg"
 !
 
+insertLines
+    "Insert the appropriate number of lines (param 1) at the cursor position."
+
+    |n|
+
+    n := (parameters at: 1) max: 1.
+    self halt:'untested code'.
+    self insertLines:(Array new:n) before:cursorLine
+!
+
 move
     "Move to the locations indicated by the first and second parameters."
 
@@ -370,6 +420,30 @@
     "Modified: / 20.6.1998 / 18:49:12 / cg"
 !
 
+moveToColumn
+    "Move to the column indicated by the first."
+
+    | column |
+
+    column := (self getParameter:1 withDefault:1).
+    Debug ifTrue:[
+        Transcript show:'move to column:'; showCR:column.
+    ].    
+    self cursorVisibleLine:cursorLine col:column.
+!
+
+moveToLine
+    "Move to the line indicated by the first param."
+
+    | row |
+
+    row := (self getParameter:1 withDefault:1).
+    Debug ifTrue:[
+        Transcript show:'move to row:'; showCR:row.
+    ].    
+    self cursorVisibleLine:row col:cursorCol.
+!
+
 moveToX: xLocation y: yLocation
     "Position the cursor at the location given by xLocation and yLocation.
      Ignore the command if the parameters are outside the allowable range."
@@ -387,6 +461,10 @@
     "Modified: / 20.6.1998 / 20:27:11 / cg"
 !
 
+report
+    self halt:'unimplemented function'
+!
+
 reportTerminalType
     "currently, only cursor position is supported (param 6)"
 
@@ -820,6 +898,24 @@
         self doCursorLeft:(self getParameter:1 withDefault:1).
         ^ #sequenceComplete
     ].
+    char == $E ifTrue: [
+        "/ ESC[#E                         
+        self endEntry.
+        self doCursorNextLine:(self getParameter:1 withDefault:1).
+        ^ #sequenceComplete
+    ].
+    char == $F ifTrue: [
+        "/ ESC[#F                         
+        self endEntry.
+        self doCursorPreviousLine:(self getParameter:1 withDefault:1).
+        ^ #sequenceComplete
+    ].
+    (char == $G) ifTrue: [
+        "/ ESC[#;#G                       - Moves cusor to column # in current line
+        self endEntry.
+        self moveToColumn.
+        ^ #sequenceComplete
+    ].
     (char == $H or:[char == $f]) ifTrue: [
         "/ ESC[#;#H or ESC[#;#f           - Moves cusor to line #, column #
         self endEntry.
@@ -862,16 +958,23 @@
         "/ ESC[#;#R                       - Reports current cursor line & column
         ^ #unknown
     ].
-    (char == $c) ifTrue:[
+
+    char == $c ifTrue:[
         "/ terminal-type query 3
         self reportTerminalType.
         ^ #sequenceComplete
     ].
+    char == $d ifTrue:[
+        self endEntry.
+        self moveToLine.
+        ^ #sequenceComplete
+    ].
     char == $n ifTrue: [
         self report.
         ^ #sequenceComplete
     ].
     char == $m ifTrue: [
+        "/ character attributes (SGR)
         self displayMode:(self getParameter:1 withDefault:0).
         ^ #sequenceComplete
     ].
@@ -1056,6 +1159,7 @@
      passed down to the shell as TERM environment variable).
      Here, 'vt100' is returned."
 
+    "/ ^ 'xterm'.
     ^ 'vt100'
 
     "Created: / 10.6.1998 / 16:22:39 / cg"
@@ -1065,10 +1169,10 @@
 !VT100TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.53 2013-07-23 14:25:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.54 2013-07-23 21:08:35 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.53 2013-07-23 14:25:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.54 2013-07-23 21:08:35 cg Exp $'
 ! !