-
Notifications
You must be signed in to change notification settings - Fork 2
/
text.go
203 lines (145 loc) · 2.86 KB
/
text.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
package main
import (
"image"
"math"
"9fans.net/go/draw"
)
const (
Ldot = "."
TABDIR = 3
)
var (
left1 = []rune{'{', '[', '(', '<', 0xab}
right1 = []rune{'}', ']', ')', '>', 0xbb}
left2 = []rune{'\n'}
left3 = []rune{'\'', '"', '`'}
left = [][]rune{
left1,
left2,
left3,
}
right = [][]rune{
right1,
left2,
left3,
}
)
type Text struct {
file *File
//fr Frame
reffont *Reffont
org uint
q0 uint
q1 uint
what int
tabstop int
w *Window
scrollr image.Rectangle
lastsr image.Rectangle
all image.Rectangle
row *Row
col *Column
iq1 uint
eq0 uint
cq0 uint
ncache int
ncachealloc int
cache []rune
nofill int
needundo int
}
func NewText(f *File, r image.Rectangle, rf *Reffont, cols []*draw.Image) *Text {
t := new(Text)
t.file = f
t.all = r
t.scrollr = r
t.scrollr.Max.X = r.Min.X + display.ScaleSize(12)
t.lastsr = nullrect
r.Min.X += display.ScaleSize(12) + display.ScaleSize(4)
t.eq0 = math.MaxUint64
t.ncache = 0
t.reffont = rf
t.tabstop = int(maxtab)
//copy(t.fr, cols)
t.Redraw(r, rf.f, screen, -1)
return t
}
func (t *Text) Redraw(r image.Rectangle, f *draw.Font, b *draw.Image, odx int) {
}
func (t *Text) Resize(r image.Rectangle, keepextra int) int {
return 0
}
func (t *Text) Close() {
}
func (t *Text) Columnate(dlp **Dirlist, ndl int) {
}
func (t *Text) Load(q0 uint, file string, setquid bool) int {
return 0
}
func (t *Text) Backnl(p, n uint) uint {
return 0
}
func (t *Text) BsInsert(q0 uint, r []rune, n uint, tofile bool, nrp *int) uint {
return 0
}
func (t *Text) Insert(q0 uint, r []rune, n uint, tofile bool) {
}
func (t *Text) TypeCommit() {
}
func (t *Text) Fill() {
}
func (t *Text) Delete(q0, q1 uint, tofile bool) {
}
func (t *Text) Constrain(q0, q1 uint, p0, p1 *uint) {
}
func (t *Text) ReadRune(q uint) rune {
return ' '
}
func (t *Text) BsWidth(c rune) int {
return 0
}
func (t *Text) FileWidth(q0 uint, oneelement int) int {
return 0
}
func (t *Text) Complete() []rune {
return nil
}
func (t *Text) Type(r rune) {
}
func (t *Text) Commit(tofile bool) {
}
func (t *Text) FrameScroll(dl int) {
}
func (t *Text) Select() {
}
func (t *Text) Show(q0, q1 uint, doselect bool) {
}
func (t *Text) SetSelect(q0, q1 uint) {
}
func (t *Text) Select23(q0, q1 *uint, high *draw.Image, mask int) int {
return 0
}
func (t *Text) Select3(q0, q1 *uint) int {
return 0
}
func (t *Text) DoubleClick(q0, q1 *uint) {
}
func (t *Text) ClickMatch(cl, cr, dir int, q *uint) int {
return 0
}
func (t *Text) ishtmlstart(q uint, q1 *uint) bool {
return false
}
func (t *Text) ishtmlend(q uint, q0 *uint) bool {
return false
}
func (t *Text) ClickHTMLMatch(q0, q1 *uint) int {
return 0
}
func (t *Text) BackNL(p, n uint) uint {
return 0
}
func (t *Text) SetOrigin(org uint, exact int) {
}
func (t *Text) Reset() {
}