author | Claus Gittinger <cg@exept.de> |
Tue, 09 Jul 2013 11:32:30 +0200 | |
changeset 4269 | edb108492a92 |
parent 4221 | 78dfbf10887b |
child 4270 | d109ce8a73a8 |
permissions | -rw-r--r-- |
1361 | 1 |
" |
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2076 | 12 |
"{ Package: 'stx:libwidg2' }" |
13 |
||
930 | 14 |
TerminalView subclass:#VT100TerminalView |
998 | 15 |
instanceVariableNames:'currentParam parameters lastCursorLine' |
4269 | 16 |
classVariableNames:'TraceCSI' |
920 | 17 |
poolDictionaries:'' |
18 |
category:'Views-TerminalViews' |
|
19 |
! |
|
20 |
||
927 | 21 |
!VT100TerminalView class methodsFor:'documentation'! |
22 |
||
2116 | 23 |
ansiEscapes |
24 |
" |
|
25 |
ANSI ESCAPE SEQUENCES |
|
26 |
=============================================================================== |
|
27 |
Wherever you see '#', that should be replaced by the appropriate number. |
|
28 |
||
29 |
ESC code sequence Function |
|
30 |
------------------- --------------------------- |
|
31 |
Cursor Controls: |
|
32 |
ESC[#;#H or ESC[#;#f Moves cusor to line #, column # |
|
33 |
ESC[#A Moves cursor up # lines |
|
34 |
ESC[#B Moves cursor down # lines |
|
35 |
ESC[#C Moves cursor forward # spaces |
|
36 |
ESC[#D Moves cursor back # spaces |
|
37 |
ESC[#;#R Reports current cursor line & column |
|
38 |
ESC[s Saves cursor position for recall later |
|
39 |
ESC[u Return to saved cursor position |
|
40 |
||
41 |
Erase Functions: |
|
42 |
ESC[2J Clear screen and home cursor |
|
43 |
ESC[K Clear to end of line |
|
44 |
||
45 |
Set Graphics Rendition: |
|
46 |
ESC[#;#;....;#m Set display attributes where # is |
|
47 |
0 for normal display |
|
48 |
1 for bold on |
|
49 |
4 underline (mono only) |
|
50 |
5 blink on |
|
51 |
7 reverse video on |
|
52 |
8 nondisplayed (invisible) |
|
53 |
30 black foreground |
|
54 |
31 red foreground |
|
55 |
32 green foreground |
|
56 |
33 yellow foreground |
|
57 |
34 blue foreground |
|
58 |
35 magenta foreground |
|
59 |
36 cyan foreground |
|
60 |
37 white foreground |
|
61 |
40 black background |
|
62 |
41 red background |
|
63 |
42 green background |
|
64 |
43 yellow background |
|
65 |
44 blue background |
|
66 |
45 magenta background |
|
67 |
46 cyan background |
|
68 |
47 white background |
|
69 |
||
70 |
ESC[=#;7h or Put screen in indicated mode where # is |
|
71 |
ESC[=h or 0 for 40 x 25 black & white |
|
72 |
ESC[=0h or 1 for 40 x 25 color |
|
73 |
ESC[?7h 2 for 80 x 25 b&w |
|
74 |
3 for 80 x 25 color |
|
75 |
4 for 320 x 200 color graphics |
|
76 |
5 for 320 x 200 b & w graphics |
|
77 |
6 for 640 x 200 b & w graphics |
|
78 |
7 to wrap at end of line |
|
79 |
||
80 |
ESC[=#;7l or ESC[=l or Resets mode # set with above command |
|
81 |
ESC[=0l or ESC[?7l |
|
82 |
||
83 |
Keyboard Reassignments: |
|
84 |
ESC[#;#;...p Keyboard reassignment. The first ASCII |
|
85 |
or ESC[""string""p code defines which code is to be |
|
86 |
or ESC[#;""string"";#; changed. The remaining codes define |
|
87 |
#;""string"";#p what it is to be changed to. |
|
88 |
||
89 |
E.g. Reassign the Q and q keys to the A and a keys (and vice versa). |
|
90 |
ESC [65;81p A becomes Q |
|
91 |
ESC [97;113p a becomes q |
|
92 |
ESC [81;65p Q becomes A |
|
93 |
ESC [113;97p q becomes a |
|
94 |
||
95 |
E.g. Reassign the F10 key to a DIR command. |
|
96 |
ESC [0;68;""dir"";13p The 0;68 is the extended ASCII code |
|
97 |
for the F10 key and 13 is the ASCII |
|
98 |
code for a carriage return. |
|
99 |
||
100 |
Other function key codes F1=59,F2=60,F3=61,F4=62,F5=63 |
|
101 |
F6=64,F7=65,F8=66,F9=67,F10=68 |
|
102 |
" |
|
103 |
! |
|
104 |
||
1361 | 105 |
copyright |
106 |
" |
|
107 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
108 |
All Rights Reserved |
|
109 |
||
110 |
This software is furnished under a license and may be used |
|
111 |
only in accordance with the terms of that license and with the |
|
112 |
inclusion of the above copyright notice. This software may not |
|
113 |
be provided or otherwise made available to, or used by, any |
|
114 |
other person. No title to or ownership of the software is |
|
115 |
hereby transferred. |
|
116 |
" |
|
117 |
||
118 |
||
119 |
! |
|
120 |
||
927 | 121 |
documentation |
122 |
" |
|
1418 | 123 |
A VT100 terminal emulator. |
124 |
Most of the functionality is inherited from my superclass, |
|
125 |
I redefine/specialize certain methods for VT100 escape sequences |
|
126 |
and vt100 keyboard codes |
|
927 | 127 |
|
1419 | 128 |
BUGS: |
129 |
VT100 wrapMode (at right margin) is not supported |
|
130 |
this may lead to wrong display when a vi is started in a small window. |
|
131 |
||
927 | 132 |
[start with:] |
133 |
VT100TerminalView openShell |
|
1418 | 134 |
|
135 |
[see also:] |
|
136 |
VT52TerminalView |
|
137 |
TelnetTool |
|
927 | 138 |
" |
139 |
||
140 |
||
141 |
! ! |
|
920 | 142 |
|
932 | 143 |
!VT100TerminalView methodsFor:'defaults'! |
927 | 144 |
|
145 |
vt100KeyCodes |
|
1420 | 146 |
"return a vt100 keyCode table" |
147 |
||
927 | 148 |
^ IdentityDictionary withKeysAndValues: |
149 |
#( |
|
150 |
#CursorUp '\e[A' |
|
151 |
#CursorDown '\e[B' |
|
152 |
#CursorRight '\e[C' |
|
153 |
#CursorLeft '\e[D' |
|
154 |
#Home '\e[H' |
|
155 |
#Escape '\e' |
|
156 |
#BackSpace '\b' |
|
157 |
#Return '\r' |
|
976 | 158 |
#Delete '\0177' |
1357 | 159 |
#Tab '\t' |
1352 | 160 |
|
161 |
#F1 '\eOP' |
|
162 |
#F2 '\eOQ' |
|
163 |
#F3 '\eOR' |
|
164 |
#F4 '\eOS' |
|
165 |
#F5 '\eOt' |
|
166 |
#F6 '\eOu' |
|
167 |
#F7 '\eOv' |
|
168 |
#F8 '\eOl' |
|
169 |
#F9 '\eOw' |
|
927 | 170 |
) |
171 |
||
172 |
"Created: / 10.6.1998 / 15:13:01 / cg" |
|
1357 | 173 |
"Modified: / 5.5.1999 / 15:01:32 / cg" |
927 | 174 |
! ! |
175 |
||
176 |
!VT100TerminalView methodsFor:'functions'! |
|
177 |
||
178 |
addLines |
|
1420 | 179 |
"Add the appropriate number of blank lines (param 1) |
180 |
at the cursor position." |
|
927 | 181 |
|
1420 | 182 |
self addLines:((parameters at:1) max:1). |
927 | 183 |
self endOfSequence |
184 |
||
185 |
"Created: / 10.6.1998 / 14:48:03 / cg" |
|
186 |
! |
|
187 |
||
1420 | 188 |
addLines:aNumber |
927 | 189 |
"Add aNumber blank lines at the position indicated by the cursor." |
190 |
||
1420 | 191 |
aNumber timesRepeat:[ |
927 | 192 |
self insertLine:'' before:cursorLine |
193 |
] |
|
194 |
||
195 |
"Created: / 10.6.1998 / 14:49:30 / cg" |
|
196 |
! |
|
197 |
||
949 | 198 |
autoMargin:aBoolean |
199 |
"set/clear autowrap at end of line (not yet implemented)" |
|
200 |
||
2268 | 201 |
autoWrapFlag := aBoolean |
949 | 202 |
! |
203 |
||
2192 | 204 |
clearLines:arg |
1420 | 205 |
"Clear some part of the current line, as indicated by the first parameter: |
206 |
0 - clear to EOL |
|
207 |
1 - clear from beginning to cursorCol |
|
208 |
2 - clear entire line |
|
209 |
" |
|
927 | 210 |
|
1001
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
211 |
arg = 0 ifTrue: [^self doClearToEndOfLine]. |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
212 |
arg = 1 ifTrue: [^self doClearFromBeginningOfLine]. |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
213 |
arg = 2 ifTrue: [^self doClearEntireLine] |
927 | 214 |
|
215 |
"Created: / 10.6.1998 / 14:44:22 / cg" |
|
1001
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
216 |
"Modified: / 21.7.1998 / 20:07:42 / cg" |
927 | 217 |
! |
218 |
||
949 | 219 |
deleteCharacters |
1420 | 220 |
"Delete the appropriate number of characters (param 1) |
221 |
at the cursor position." |
|
949 | 222 |
|
223 |
|n| |
|
224 |
||
225 |
n := ((parameters at: 1) max: 1). |
|
226 |
self deleteFromLine:cursorLine col:cursorCol toLine:cursorLine col:cursorCol+n-1. |
|
227 |
||
228 |
"Created: / 12.6.1998 / 21:19:02 / cg" |
|
229 |
"Modified: / 12.6.1998 / 21:19:15 / cg" |
|
230 |
! |
|
231 |
||
2192 | 232 |
displayMode:p1 |
1420 | 233 |
"Set the current display mode (emphasis) as specified by param 1." |
927 | 234 |
|
2192 | 235 |
|clrName| |
1352 | 236 |
|
237 |
||
1020 | 238 |
"/ self endEntry. |
1352 | 239 |
p1 == 1 ifTrue:[ |
951 | 240 |
"/ ESC-[-1-m -> bold |
241 |
||
1287
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
242 |
"/ workaround: windows bold fonts are |
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
243 |
"/ wider, leading to ugly looking output |
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
244 |
"/ Therefore, use red color instead of bold |
1667 | 245 |
device platformName = 'WIN32' ifTrue:[ |
1287
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
246 |
self color:Color red. |
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
247 |
] ifFalse:[ |
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
248 |
self bold. |
48e6c847a554
use red color instead of bold
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
249 |
]. |
951 | 250 |
^ self. |
251 |
]. |
|
1352 | 252 |
p1 == 4 ifTrue:[ |
253 |
"/ ESC-[-4-m -> underline |
|
254 |
||
255 |
self underline. |
|
256 |
^ self. |
|
257 |
]. |
|
258 |
p1 == 5 ifTrue:[ |
|
259 |
"/ ESC-[-5-m -> blink |
|
260 |
||
261 |
self color:Color blue. |
|
262 |
^ self. |
|
263 |
]. |
|
264 |
p1 == 7 ifTrue:[ |
|
265 |
"/ ESC-[-7-m -> reverse |
|
951 | 266 |
|
978 | 267 |
self reverse. |
268 |
^ self. |
|
269 |
]. |
|
2116 | 270 |
p1 == 8 ifTrue:[ |
271 |
"/ ESC-[-8-m -> invisible |
|
272 |
^ self. |
|
273 |
]. |
|
274 |
(p1 between:30 and:37) ifTrue:[ |
|
275 |
"/ ESC-[-30-m -> black fg color |
|
276 |
"/ ESC-[-31-m -> red fg color |
|
277 |
"/ ... |
|
278 |
"/ ESC-[-37-m -> white fg color |
|
279 |
clrName := #(black red green yellow blue magenta cyan white) at:(p1-30+1). |
|
280 |
self color:(Color perform:clrName). |
|
281 |
^ self. |
|
282 |
]. |
|
283 |
(p1 between:40 and:47) ifTrue:[ |
|
284 |
"/ ESC-[-40-m -> black bg color |
|
285 |
"/ ... |
|
286 |
"/ ESC-[-47-m -> white bg color |
|
287 |
clrName := #(black red green yellow blue magenta cyan white) at:(p1-40+1). |
|
288 |
self bgColor:(Color perform:clrName). |
|
289 |
^ self. |
|
290 |
]. |
|
1020 | 291 |
|
978 | 292 |
"/ ESC-[-any-m -> normal |
293 |
self normal. |
|
927 | 294 |
|
295 |
"Created: / 10.6.1998 / 15:01:16 / cg" |
|
1352 | 296 |
"Modified: / 5.5.1999 / 00:53:15 / cg" |
927 | 297 |
! |
298 |
||
2192 | 299 |
doClearDisplay:arg |
1420 | 300 |
"Clear some part of the current screen, as indicated by the first parameter. |
301 |
0 - clear to endOfScreen |
|
302 |
1 - clear from beginning of screen to cursorCol |
|
303 |
2 - clear entire screen |
|
304 |
" |
|
1001
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
305 |
|
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
306 |
arg = 0 ifTrue: [^self doClearToEndOfScreen]. |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
307 |
arg = 1 ifTrue: [^self doClearFromBeginningOfScreen]. |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
308 |
arg = 2 ifTrue: [^self doClearEntireScreen] |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
309 |
|
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
310 |
"Created: / 21.7.1998 / 20:05:07 / cg" |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
311 |
"Modified: / 21.7.1998 / 20:07:36 / cg" |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
312 |
! |
7fe14ad43ae3
fixed clear-to-end-of-screen function.
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
313 |
|
1020 | 314 |
insertCharacters |
1420 | 315 |
"Insert the appropriate number of spaces (param 1) at the cursor position." |
949 | 316 |
|
317 |
|s| |
|
318 |
||
319 |
s := String new:((parameters at: 1) max: 1). |
|
1420 | 320 |
self insertStringWithoutCRs:s atLine:cursorLine col:cursorCol. |
949 | 321 |
|
322 |
"Modified: / 12.6.1998 / 21:14:25 / cg" |
|
1020 | 323 |
"Created: / 28.7.1998 / 00:53:51 / cg" |
949 | 324 |
! |
325 |
||
927 | 326 |
move |
327 |
"Move to the locations indicated by the first and second parameters." |
|
328 |
||
2217 | 329 |
| row column | |
330 |
||
331 |
row := (self getParameter:1 withDefault:1). |
|
332 |
column := (self getParameter:2 withDefault:1). |
|
2202 | 333 |
Debug ifTrue:[ |
2217 | 334 |
Transcript show:'move to column/row:'; show:column; show:'/'; showCR:row. |
335 |
]. |
|
336 |
self moveToX:column y:row. |
|
927 | 337 |
|
338 |
"Created: / 10.6.1998 / 14:40:01 / cg" |
|
978 | 339 |
"Modified: / 20.6.1998 / 18:49:12 / cg" |
927 | 340 |
! |
341 |
||
342 |
moveToX: xLocation y: yLocation |
|
343 |
"Position the cursor at the location given by xLocation and yLocation. |
|
344 |
Ignore the command if the parameters are outside the allowable range." |
|
345 |
||
2192 | 346 |
Debug ifTrue:[ |
347 |
Transcript show:'numberOfColumns '; showCR:numberOfColumns. |
|
348 |
Transcript show:'numberOfLines '; showCR:numberOfLines. |
|
349 |
]. |
|
978 | 350 |
"/ (xLocation < 1 or: [xLocation > numberOfColumns]) ifTrue: [^self]. |
351 |
"/ (yLocation < 1 or: [yLocation > numberOfLines]) ifTrue: [^self]. |
|
952 | 352 |
|
949 | 353 |
self cursorVisibleLine:yLocation col:xLocation. |
927 | 354 |
|
355 |
"Created: / 10.6.1998 / 14:40:49 / cg" |
|
978 | 356 |
"Modified: / 20.6.1998 / 20:27:11 / cg" |
927 | 357 |
! |
358 |
||
944 | 359 |
reportTerminalType |
1420 | 360 |
"currently, only cursor position is supported (param 6)" |
361 |
||
944 | 362 |
(parameters at: 1) == 6 ifTrue:[ |
363 |
"/ report position |
|
1020 | 364 |
self endEntry. |
365 |
||
944 | 366 |
inStream nextPut:(Character esc). |
367 |
inStream nextPutAll:'[' |
|
368 |
, cursorLine printString |
|
369 |
, ';' |
|
370 |
, cursorCol printString |
|
371 |
, 'R'. |
|
372 |
^ self |
|
373 |
]. |
|
374 |
(parameters at: 1) == 7 ifTrue:[ |
|
375 |
"/ display name |
|
376 |
]. |
|
377 |
||
378 |
"Created: / 11.6.1998 / 23:05:50 / cg" |
|
1020 | 379 |
"Modified: / 28.7.1998 / 00:54:30 / cg" |
944 | 380 |
! |
381 |
||
927 | 382 |
resetDefaults |
383 |
"Reset the default parameters" |
|
384 |
||
2192 | 385 |
|l1 l2| |
949 | 386 |
|
978 | 387 |
|
949 | 388 |
l1 := (parameters at: 1). |
389 |
l2 := (parameters at: 2). |
|
2192 | 390 |
Debug ifTrue:[ |
391 |
Transcript show:'resetDefaults:'; show:l1;show:' ';showCR:l2. |
|
392 |
]. |
|
949 | 393 |
(l1 ~~ 0 and:[l2 ~~ 0]) ifTrue:[ |
394 |
rangeStartLine := l1. |
|
395 |
rangeEndLine := l2. |
|
396 |
] ifFalse:[ |
|
978 | 397 |
"/ self halt. |
949 | 398 |
]. |
399 |
||
978 | 400 |
"/ (rangeStartLine == 1 and:[rangeEndLine == numberOfLines]) ifTrue:[ |
401 |
"/ rangeEndLine := rangeStartLine := nil. |
|
402 |
"/ ]. |
|
403 |
||
404 |
"/ autoLineFeed := false. |
|
405 |
"/ autoMargin := true. |
|
406 |
"/ displayMode := 0. "Normal display"!! !! |
|
927 | 407 |
|
408 |
"Created: / 10.6.1998 / 14:50:53 / cg" |
|
978 | 409 |
"Modified: / 20.6.1998 / 20:28:26 / cg" |
920 | 410 |
! ! |
411 |
||
412 |
!VT100TerminalView methodsFor:'initialization'! |
|
413 |
||
927 | 414 |
initialize |
415 |
super initialize. |
|
949 | 416 |
|
2268 | 417 |
autoWrapFlag := true. |
418 |
||
2192 | 419 |
parameters := Array new:8. |
927 | 420 |
self endOfSequence |
421 |
||
422 |
"Created: / 10.6.1998 / 14:46:07 / cg" |
|
953 | 423 |
"Modified: / 13.6.1998 / 13:58:01 / cg" |
927 | 424 |
! |
425 |
||
426 |
initializeKeyboardSequences |
|
1420 | 427 |
"setup my keyboard sequences for a vt100" |
428 |
||
927 | 429 |
kbdSequences := (self vt100KeyCodes) |
430 |
||
431 |
"Modified: / 9.6.1998 / 20:49:21 / cg" |
|
432 |
"Created: / 10.6.1998 / 15:12:32 / cg" |
|
433 |
! ! |
|
434 |
||
4269 | 435 |
!VT100TerminalView methodsFor:'misc'! |
436 |
||
437 |
traceCSI:char |
|
438 |
state infoPrint. '-' infoPrint. |
|
439 |
char asciiValue > 32 ifTrue:[ |
|
440 |
char infoPrint. |
|
441 |
] ifFalse:[ |
|
442 |
'0x' infoPrint. char codePoint hexPrintString infoPrint. |
|
443 |
]. |
|
444 |
currentParam > 1 ifTrue:[ |
|
445 |
' ' infoPrint. |
|
446 |
(parameters at:1) infoPrintCR. |
|
447 |
||
448 |
currentParam > 2 ifTrue:[ |
|
449 |
' ' infoPrint. |
|
450 |
(parameters at:2) infoPrintCR. |
|
451 |
||
452 |
currentParam > 3 ifTrue:[ |
|
453 |
' ' infoPrint. |
|
454 |
(parameters at:3) infoPrintCR. |
|
455 |
]. |
|
456 |
]. |
|
457 |
]. |
|
458 |
! ! |
|
459 |
||
4221 | 460 |
!VT100TerminalView methodsFor:'os functions (xterm)'! |
461 |
||
462 |
osCommand |
|
463 |
|cmdKey cmdValue| |
|
464 |
||
465 |
cmdKey := parameters at:1. |
|
466 |
cmdValue := parameters at:2. |
|
4269 | 467 |
|
4221 | 468 |
cmdKey == 0 ifTrue:[ |
469 |
"/ change icon name and window title |
|
470 |
masterWindow notNil ifTrue:[ |
|
471 |
masterWindow label:cmdValue. |
|
472 |
masterWindow iconLabel:cmdValue. |
|
473 |
]. |
|
474 |
self endOfSequence. |
|
475 |
^ self. |
|
476 |
]. |
|
477 |
cmdKey == 1 ifTrue:[ |
|
478 |
"/ change icon name |
|
479 |
masterWindow notNil ifTrue:[ |
|
480 |
masterWindow iconLabel:cmdValue. |
|
481 |
]. |
|
482 |
self endOfSequence. |
|
483 |
^ self. |
|
484 |
]. |
|
485 |
cmdKey == 2 ifTrue:[ |
|
486 |
"/ change window title |
|
487 |
masterWindow notNil ifTrue:[ |
|
488 |
masterWindow label:cmdValue. |
|
489 |
]. |
|
490 |
self endOfSequence. |
|
491 |
^ self. |
|
492 |
]. |
|
493 |
cmdKey == 3 ifTrue:[ |
|
494 |
"/ set x property |
|
495 |
self endOfSequence. |
|
496 |
^ self. |
|
497 |
]. |
|
498 |
cmdKey == 4 ifTrue:[ |
|
499 |
"/ change color |
|
500 |
self endOfSequence. |
|
501 |
^ self. |
|
502 |
]. |
|
503 |
self breakPoint:#cg. |
|
504 |
self endOfSequence |
|
505 |
! ! |
|
506 |
||
2498 | 507 |
!VT100TerminalView methodsFor:'processing-input'! |
927 | 508 |
|
2194 | 509 |
addToParameter:char |
927 | 510 |
"The parameter char is a digit. Add it to the current parameter." |
511 |
||
512 |
| param | |
|
513 |
||
2192 | 514 |
param := (parameters at:currentParam) ? 0. |
927 | 515 |
parameters at:currentParam put:(param * 10 + char digitValue) |
516 |
||
517 |
"Created: / 10.6.1998 / 14:39:00 / cg" |
|
518 |
! |
|
519 |
||
1420 | 520 |
endOfSequence |
521 |
"private - reset state-machine at end of escape-sequence" |
|
927 | 522 |
|
523 |
state := 0. |
|
524 |
currentParam := 1. |
|
2192 | 525 |
"/ parameters := Array new:8 withAll:0. |
526 |
parameters atAllPut:nil. |
|
927 | 527 |
|
528 |
"Created: / 10.6.1998 / 14:30:40 / cg" |
|
529 |
"Modified: / 10.6.1998 / 14:30:57 / cg" |
|
530 |
! |
|
531 |
||
4269 | 532 |
evaluateProcessCharacter:char return:aSymbol |
2207 | 533 |
" evaluate the return value of the process state methods except for state 0 |
534 |
" |
|
535 |
||
536 |
aSymbol == #waitForNextChar ifTrue:[ |
|
537 |
^ self. |
|
538 |
]. |
|
539 |
aSymbol == #unknown ifTrue:[ |
|
4269 | 540 |
('VT100TerminalView [info]: unknown character %1 ins state %2' |
541 |
bindWith:(char codePoint hexPrintString) |
|
542 |
with:state) infoPrintCR. |
|
2207 | 543 |
self doNothing. |
544 |
^ self |
|
545 |
]. |
|
546 |
aSymbol == #sequenceComplete ifTrue:[ |
|
547 |
self endOfSequence. |
|
548 |
^ self. |
|
549 |
]. |
|
4269 | 550 |
self halt:'unexpected return value from state processing' |
2207 | 551 |
! |
552 |
||
553 |
nextPut:char |
|
2194 | 554 |
" process a character (i.e. the shells output) |
555 |
" |
|
937 | 556 |
|
2202 | 557 |
|processCharacterReturn| |
932 | 558 |
|
2192 | 559 |
Debug ifTrue:[ |
2202 | 560 |
Transcript |
561 |
show:state; |
|
562 |
show:' '; |
|
563 |
showCR:char storeString |
|
2192 | 564 |
]. |
2207 | 565 |
state == #gotReturn ifTrue:[ |
566 |
processCharacterReturn := self processStateGotReturn:char. |
|
567 |
processCharacterReturn == #sequenceComplete ifTrue:[ |
|
2350
0f9ca9ecf77a
the state have to be reset if sequence is complete in #gotReturn
penk
parents:
2268
diff
changeset
|
568 |
self endOfSequence. |
2207 | 569 |
^ self. |
570 |
]. |
|
4269 | 571 |
^ self |
2207 | 572 |
]. |
927 | 573 |
state == 0 ifTrue:[ |
2207 | 574 |
processCharacterReturn := self processState0:char. |
4269 | 575 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
576 |
^ self |
|
2207 | 577 |
]. |
578 |
state == #gotESC ifTrue:[ |
|
579 |
processCharacterReturn := self processStateGotESC:char. |
|
4269 | 580 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
2207 | 581 |
^ self. |
927 | 582 |
]. |
2207 | 583 |
state == #gotCSI ifTrue:[ |
584 |
processCharacterReturn := self processStateGotCSI:char. |
|
4269 | 585 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
2207 | 586 |
^ self. |
2202 | 587 |
]. |
2207 | 588 |
state == #gotCSI2 ifTrue:[ |
589 |
processCharacterReturn := self processStateGotCSI2:char. |
|
4269 | 590 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
2207 | 591 |
^ self. |
2192 | 592 |
]. |
2207 | 593 |
state == #gotCSI3 ifTrue:[ |
594 |
processCharacterReturn := self processStateGotCSI3:char. |
|
4269 | 595 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
2207 | 596 |
^ self. |
2192 | 597 |
]. |
2207 | 598 |
state == #gotXTERMCSI ifTrue:[ |
599 |
processCharacterReturn := self processStateGotXTERMCSI:char. |
|
4269 | 600 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
2207 | 601 |
^ self. |
927 | 602 |
]. |
4221 | 603 |
state == #gotXTERMCSI2 ifTrue:[ |
604 |
processCharacterReturn := self processStateGotXTERMCSI2:char. |
|
4269 | 605 |
self evaluateProcessCharacter:char return:processCharacterReturn. |
4221 | 606 |
^ self. |
607 |
]. |
|
608 |
self halt:'unknown state'. |
|
2192 | 609 |
self doNothing. |
610 |
^ self |
|
2202 | 611 |
! |
612 |
||
2207 | 613 |
processState0:char |
2202 | 614 |
" change state or processing character; return |
615 |
#waitForNextChar - state was changed and wait for next characters |
|
616 |
#sequenceComplete - command processed |
|
617 |
#unknown - unknown character for this state |
|
618 |
" |
|
619 |
||
620 |
char asciiValue < 32 ifTrue:[ |
|
2207 | 621 |
(char == Character esc) ifTrue:[ |
622 |
state := #gotESC. |
|
623 |
^ #waitForNextChar |
|
624 |
]. |
|
4269 | 625 |
|
2202 | 626 |
( char == Character nl "nl or '\n'" |
627 |
or:[(char == (Character value:16rb))]) ifTrue:[ |
|
2207 | 628 |
translateNLToCRNL == true ifTrue:[ |
629 |
self endEntry. |
|
630 |
self cursorToBeginOfLine. |
|
631 |
]. |
|
2202 | 632 |
self endEntry. |
633 |
self doCursorDown:1. |
|
2207 | 634 |
^ #waitForNextChar. |
2202 | 635 |
]. |
4269 | 636 |
|
2202 | 637 |
(char == Character return) ifTrue:[ |
638 |
(rangeEndLine notNil and:[rangeEndLine ~~ numberOfLines]) ifTrue:[ |
|
639 |
self endEntry. |
|
640 |
self cursorToBeginOfLine. |
|
641 |
] ifFalse:[ |
|
642 |
state := #gotReturn. |
|
643 |
]. |
|
2207 | 644 |
^ #waitForNextChar. |
2202 | 645 |
]. |
4269 | 646 |
|
2202 | 647 |
(char == Character backspace) ifTrue:[ |
648 |
self endEntry. |
|
649 |
self cursorLeft. |
|
2207 | 650 |
^ #waitForNextChar "/ doBackspace |
2202 | 651 |
]. |
4269 | 652 |
|
2202 | 653 |
(char == Character bell) ifTrue:[ |
2782 | 654 |
self shown ifTrue:[ |
655 |
self beep. |
|
656 |
]. |
|
2207 | 657 |
^ #waitForNextChar |
2202 | 658 |
]. |
4269 | 659 |
|
2202 | 660 |
(char == (Character value:5)) ifTrue:[ |
661 |
"/ Transmission answerback message |
|
662 |
self reportTerminalType. |
|
2207 | 663 |
^ #waitForNextChar |
2202 | 664 |
]. |
4269 | 665 |
|
2202 | 666 |
( char == (Character value:16r18) "/Cancel |
667 |
or:[ char == (Character value:16r1A) "/Substitute |
|
668 |
]) ifTrue:[ |
|
669 |
self nextPut:(Character value:16r2). |
|
2207 | 670 |
^ #waitForNextChar |
2202 | 671 |
] |
4269 | 672 |
|
2207 | 673 |
" |
4269 | 674 |
all unsupported control characters (also vt102): |
2207 | 675 |
Character value:16r3 ->End of text |
676 |
Character value:16r4 ->End of transmission |
|
677 |
Character tab ->Horizontal tab |
|
678 |
Character value:16rc ->Form feed |
|
679 |
Character value:16re ->SO shift out |
|
680 |
Character value:16rf ->SI shift in |
|
681 |
Character value:16r11 ->Device control 1 |
|
682 |
Character value:16r13 ->Device control 3 |
|
683 |
". |
|
684 |
char ~~ Character tab ifTrue:[ |
|
685 |
char asciiValue ~~ 0 ifTrue:[ |
|
686 |
('VT100 [info]: unhandled control key: ' , char storeString) infoPrintCR. |
|
687 |
]. |
|
688 |
^ #waitForNextChar. |
|
689 |
] |
|
690 |
||
2202 | 691 |
]. |
4269 | 692 |
('VT100TerminalView [info]: unknown character %1 ins state %2' |
693 |
bindWith:(char codePoint hexPrintString) |
|
694 |
with:state) infoPrintCR. |
|
2202 | 695 |
^ #unknown |
2192 | 696 |
! |
697 |
||
698 |
processStateGotCSI2:char |
|
699 |
" change state or processing character; return |
|
700 |
#waitForNextChar - state was changed and wait for next characters |
|
701 |
#sequenceComplete - command processed |
|
702 |
#unknown - unknown character for this state |
|
703 |
" |
|
704 |
||
705 |
char == $; ifTrue: [ |
|
706 |
currentParam := (currentParam + 1) min: 8. |
|
707 |
^ #waitForNextChar |
|
708 |
]. |
|
709 |
char isDigit ifTrue: [ |
|
2194 | 710 |
self addToParameter:char. |
2192 | 711 |
^ #waitForNextChar |
712 |
]. |
|
4269 | 713 |
|
714 |
TraceCSI == true ifTrue:[ self traceCSI:char ]. |
|
715 |
(char == $l or:[char == $h]) ifTrue: [ |
|
2192 | 716 |
"/ (parameters at: 1) = 1 ifTrue: [app_cur_keys:(char == $h)]. |
717 |
"/ (parameters at: 1) = 2 ifTrue: [mode132:(char == $h)]. |
|
718 |
"/ (parameters at: 1) = 4 ifTrue: [smoothScroll:(char == $h)]. |
|
719 |
"/ (parameters at: 1) = 5 ifTrue: [reverseVideo:(char == $h)]. |
|
720 |
"/ (parameters at: 1) = 6 ifTrue: [decom:(char == $h)]. |
|
721 |
self endEntry. |
|
722 |
(parameters at: 1) = 7 ifTrue: [self autoMargin:(char == $h)]. |
|
723 |
^ #sequenceComplete |
|
724 |
]. |
|
725 |
^ #unknown |
|
726 |
! |
|
727 |
||
728 |
processStateGotCSI3:char |
|
729 |
" change state or processing character; return |
|
730 |
#waitForNextChar - state was changed and wait for next characters |
|
731 |
#sequenceComplete - command processed |
|
732 |
#unknown - unknown character for this state |
|
733 |
" |
|
734 |
||
4269 | 735 |
TraceCSI == true ifTrue:[ self traceCSI:char ]. |
2192 | 736 |
^ #unknown |
737 |
! |
|
738 |
||
739 |
processStateGotCSI:char |
|
740 |
" change state or processing character; return |
|
741 |
#waitForNextChar - state was changed and wait for next characters |
|
742 |
#sequenceComplete - command processed |
|
743 |
#unknown - unknown character for this state |
|
744 |
" |
|
745 |
||
746 |
char == $? ifTrue: [ |
|
747 |
state := #gotCSI2. |
|
748 |
^ #waitForNextChar |
|
749 |
]. |
|
750 |
char == $; ifTrue:[ |
|
751 |
currentParam := (currentParam + 1) min: 8. |
|
752 |
^ #waitForNextChar |
|
753 |
]. |
|
754 |
char isDigit ifTrue: [ |
|
755 |
self addToParameter:char. |
|
756 |
^ #waitForNextChar |
|
757 |
]. |
|
4269 | 758 |
|
759 |
TraceCSI == true ifTrue:[ self traceCSI:char ]. |
|
2192 | 760 |
char == $@ ifTrue: [ |
761 |
self endEntry. |
|
762 |
self insertCharacters. |
|
763 |
^ #sequenceComplete |
|
764 |
]. |
|
765 |
char == $A ifTrue: [ |
|
766 |
"/ ESC[#A - Moves cursor up # lines |
|
767 |
self endEntry. |
|
2202 | 768 |
self doCursorUp:(self getParameter:1 withDefault:1). |
2192 | 769 |
^ #sequenceComplete |
770 |
]. |
|
771 |
char == $B ifTrue: [ |
|
772 |
"/ ESC[#B - Moves cursor down # lines |
|
773 |
self endEntry. |
|
2202 | 774 |
self doCursorDown:(self getParameter:1 withDefault:1). |
2192 | 775 |
^ #sequenceComplete |
776 |
]. |
|
777 |
char == $C ifTrue: [ |
|
778 |
"/ ESC[#C - Moves cursor forward # spaces |
|
779 |
self endEntry. |
|
2202 | 780 |
self doCursorRight:(self getParameter:1 withDefault:1). |
2192 | 781 |
^ #sequenceComplete |
782 |
]. |
|
783 |
char == $D ifTrue: [ |
|
784 |
"/ ESC[#D - Moves cursor back # spaces |
|
785 |
self endEntry. |
|
2202 | 786 |
self doCursorLeft:(self getParameter:1 withDefault:1). |
2192 | 787 |
^ #sequenceComplete |
788 |
]. |
|
2202 | 789 |
(char == $H or:[char == $f]) ifTrue: [ |
2192 | 790 |
"/ ESC[#;#H or ESC[#;#f - Moves cusor to line #, column # |
791 |
self endEntry. |
|
2202 | 792 |
self move. |
2192 | 793 |
^ #sequenceComplete |
794 |
]. |
|
795 |
char == $J ifTrue: [ |
|
2217 | 796 |
"/ ESC[0J - Clear screen to end |
797 |
"/ ESC[1J - Clear screen from beginning |
|
2192 | 798 |
"/ ESC[2J - Clear entire screen and home cursor |
799 |
self endEntry. |
|
2207 | 800 |
self doClearDisplay:(self getParameter:1 withDefault:0). |
2192 | 801 |
^ #sequenceComplete |
802 |
]. |
|
803 |
char == $K ifTrue: [ |
|
804 |
"/ ESC[K - Clear to end of line |
|
805 |
self endEntry. |
|
2207 | 806 |
self clearLines:(self getParameter:1 withDefault:0). |
2192 | 807 |
Debug ifTrue:[ |
808 |
Transcript showCR:'clear to EOL'. |
|
809 |
]. |
|
810 |
^ #sequenceComplete |
|
811 |
]. |
|
812 |
char == $L ifTrue: [ |
|
813 |
self endEntry. |
|
814 |
self insertLines. |
|
815 |
^ #sequenceComplete |
|
816 |
]. |
|
817 |
char == $M ifTrue: [ |
|
818 |
self endEntry. |
|
819 |
self deleteLines. |
|
820 |
^ #sequenceComplete |
|
821 |
]. |
|
822 |
char == $P ifTrue: [ |
|
823 |
self endEntry. |
|
824 |
self deleteCharacters. |
|
825 |
^ #sequenceComplete |
|
826 |
]. |
|
2202 | 827 |
char == $R ifTrue: [ |
2192 | 828 |
"/ ESC[#;#R - Reports current cursor line & column |
2207 | 829 |
^ #unknown |
2192 | 830 |
]. |
831 |
(char == $c) ifTrue:[ |
|
832 |
"/ terminal-type query 3 |
|
833 |
self reportTerminalType. |
|
834 |
^ #sequenceComplete |
|
835 |
]. |
|
836 |
char == $n ifTrue: [ |
|
837 |
self report. |
|
838 |
^ #sequenceComplete |
|
839 |
]. |
|
840 |
char == $m ifTrue: [ |
|
2207 | 841 |
self displayMode:(self getParameter:1 withDefault:0). |
2192 | 842 |
^ #sequenceComplete |
843 |
]. |
|
844 |
char == $r ifTrue: [ |
|
845 |
self endEntry. |
|
846 |
self resetDefaults. |
|
847 |
^ #sequenceComplete |
|
848 |
]. |
|
849 |
char == $s ifTrue: [ |
|
850 |
"/ ESC[s - Saves cursor position for recall later |
|
851 |
self endEntry. |
|
852 |
^ #sequenceComplete |
|
853 |
]. |
|
854 |
char == $u ifTrue: [ |
|
855 |
"/ ESC[u - Return to saved cursor position |
|
856 |
self endEntry. |
|
857 |
^ #sequenceComplete |
|
858 |
]. |
|
859 |
^ #unknown |
|
860 |
! |
|
861 |
||
862 |
processStateGotESC:char |
|
863 |
" change state or processing character; return |
|
864 |
#waitForNextChar - state was changed and wait for next characters |
|
865 |
#sequenceComplete - command processed |
|
866 |
#unknown - unknown character for this state |
|
867 |
" |
|
868 |
||
869 |
char == $[ ifTrue: [ |
|
870 |
"/ ESC-[ |
|
871 |
state := #gotCSI. |
|
872 |
^ #waitForNextChar |
|
873 |
]. |
|
874 |
char == $] ifTrue: [ |
|
875 |
"/ ESC-] |
|
876 |
"/xterm sequence |
|
877 |
state := #gotXTERMCSI. |
|
878 |
^ #waitForNextChar |
|
879 |
]. |
|
880 |
char == $( ifTrue: [ |
|
881 |
"/ ESC-( |
|
882 |
"/ todo: set-charset 0 ... |
|
883 |
state := #gotCSI3. |
|
884 |
^ #waitForNextChar |
|
885 |
]. |
|
4269 | 886 |
|
887 |
TraceCSI == true ifTrue:[ self traceCSI:char ]. |
|
2192 | 888 |
char == $) ifTrue: [ |
889 |
"/ ESC-( |
|
890 |
"/ todo: set-charset 1 ... |
|
2207 | 891 |
^ #unknown |
2192 | 892 |
]. |
893 |
char == $7 ifTrue:[ |
|
894 |
"/ ESC-7 |
|
895 |
self endEntry. |
|
896 |
self saveCursor. |
|
897 |
^ #sequenceComplete |
|
898 |
]. |
|
899 |
char == $8 ifTrue:[ |
|
900 |
"/ ESC-7 |
|
901 |
self endEntry. |
|
902 |
self restoreCursor. |
|
903 |
^ #sequenceComplete |
|
904 |
]. |
|
905 |
char == $M ifTrue:[ |
|
2217 | 906 |
"/ ESC-M cursor up |
2192 | 907 |
self endEntry. |
908 |
self doCursorUp:1. |
|
909 |
^ #sequenceComplete |
|
910 |
]. |
|
911 |
char == $D ifTrue:[ |
|
2217 | 912 |
"/ ESC-D Index cursor down one line in same column |
2192 | 913 |
self endEntry. |
914 |
self doCursorDown:1. |
|
915 |
^ #sequenceComplete |
|
916 |
]. |
|
917 |
char == $E ifTrue:[ |
|
918 |
"/ ESC-E |
|
919 |
"/ TODO add_lines |
|
2217 | 920 |
self endEntry. |
921 |
self cursorReturn. |
|
2192 | 922 |
^ #sequenceComplete |
923 |
]. |
|
924 |
(char == $Z) ifTrue:[ |
|
925 |
"/ terminal-type query 2 |
|
926 |
self reportTerminalType. |
|
927 |
^ #sequenceComplete |
|
928 |
]. |
|
929 |
char == $= ifTrue: [ |
|
930 |
"/ enter apllication keypad mode |
|
931 |
"/ ESC-= |
|
2207 | 932 |
^ #unknown |
2192 | 933 |
]. |
934 |
char == $> ifTrue: [ |
|
935 |
"/ exit apllication keypad mode |
|
936 |
"/ ESC-< |
|
2207 | 937 |
^ #unknown |
2192 | 938 |
]. |
939 |
^ #unknown |
|
940 |
! |
|
941 |
||
2202 | 942 |
processStateGotReturn:char |
943 |
" change state or processing character; return |
|
944 |
#waitForNextChar - state was changed and wait for next characters |
|
945 |
#sequenceComplete - command processed |
|
946 |
#unknown - unknown character for this state |
|
947 |
" |
|
948 |
||
2207 | 949 |
state := 0. |
2202 | 950 |
char == Character nl ifTrue:[ |
951 |
"/ cr-nl |
|
952 |
"/ stay in buffering mode. |
|
2207 | 953 |
super nextPut:Character cr. |
954 |
^ #sequenceComplete. |
|
2202 | 955 |
]. |
956 |
self endEntry. |
|
957 |
self cursorToBeginOfLine. |
|
958 |
"/ continue in initial state |
|
2207 | 959 |
^ #waitForNextChar |
2202 | 960 |
! |
961 |
||
4221 | 962 |
processStateGotXTERMCSI2:char |
963 |
" change state or processing character; return |
|
964 |
#waitForNextChar - state was changed and wait for next characters |
|
965 |
#sequenceComplete - command processed |
|
966 |
#unknown - unknown character for this state |
|
967 |
" |
|
968 |
||
969 |
char == (Character value:7) ifTrue: [ |
|
4269 | 970 |
TraceCSI == true ifTrue:[ self traceCSI:char ]. |
4221 | 971 |
parameters at:currentParam put:(parameters at:currentParam) contents. |
972 |
self osCommand. |
|
973 |
^ #sequenceComplete |
|
974 |
]. |
|
975 |
"/ add to parameter |
|
976 |
(parameters at:currentParam) nextPut:char. |
|
977 |
^ #waitForNextChar |
|
978 |
! |
|
979 |
||
2192 | 980 |
processStateGotXTERMCSI:char |
981 |
" change state or processing character; return |
|
982 |
#waitForNextChar - state was changed and wait for next characters |
|
983 |
#sequenceComplete - command processed |
|
984 |
#unknown - unknown character for this state |
|
985 |
" |
|
986 |
||
4221 | 987 |
char == $; ifTrue:[ |
988 |
currentParam := (currentParam + 1) min: 8. |
|
989 |
parameters at:currentParam put:(WriteStream on:''). |
|
990 |
state := #gotXTERMCSI2. |
|
991 |
^ #waitForNextChar |
|
992 |
]. |
|
4269 | 993 |
|
4221 | 994 |
char isDigit ifTrue: [ |
995 |
self addToParameter:char. |
|
996 |
^ #waitForNextChar |
|
997 |
]. |
|
2192 | 998 |
^ #unknown |
920 | 999 |
! ! |
1000 |
||
930 | 1001 |
!VT100TerminalView methodsFor:'queries'! |
1002 |
||
2202 | 1003 |
getParameter:para withDefault:default |
1004 |
||
1005 |
|parameter| |
|
1006 |
||
1007 |
parameter := (parameters at:para). |
|
1008 |
^ ((parameter isNil or:[parameter = 0]) ifTrue:[default] ifFalse:[parameter]). |
|
1009 |
! |
|
1010 |
||
930 | 1011 |
terminalType |
1420 | 1012 |
"returns a string describing this terminal (usually, this is |
1013 |
passed down to the shell as TERM environment variable). |
|
1014 |
Here, 'vt100' is returned." |
|
1015 |
||
1355 | 1016 |
^ 'vt100' |
930 | 1017 |
|
1018 |
"Created: / 10.6.1998 / 16:22:39 / cg" |
|
1355 | 1019 |
"Modified: / 5.5.1999 / 11:22:40 / cg" |
930 | 1020 |
! ! |
1021 |
||
920 | 1022 |
!VT100TerminalView class methodsFor:'documentation'! |
1023 |
||
1024 |
version |
|
4269 | 1025 |
^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.46 2013-07-09 09:32:30 cg Exp $' |
920 | 1026 |
! ! |
4221 | 1027 |