-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtelWindow.go
51 lines (43 loc) · 917 Bytes
/
telWindow.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gotel
import(
"io"
)
// TelWord Word property in TelWindow
type TelWord struct {
TextProperty AnsiProperty
TextWidth uint8
TextIndex uint8
TextCode rune
}
// NewTelWindow Create new TelWindow
func NewTelWindow(c int, r int) *TelWindow {
t := TelWindow {
c, // cols
r, // rows
0, // point col
0, // point row
nil,
AnsiProperty{},
make([]TelWord, c * r),
TelWord{},
}
return &t
}
// TelWindow Telnet virtual window manager
type TelWindow struct {
cols int
rows int
pc int
pr int
wordDecoder io.Reader
cWrodProperty AnsiProperty
words []TelWord
tempWord TelWord
}
// SetWordDecoder Set decoder like big5 decoder (to utf8)
func (t *TelWindow) SetWordDecoder(r io.Reader) {
t.wordDecoder = r
}
// AddByte Add new byte to TelWindow
func (t *TelWindow) AddByte(b byte) {
}