xref: /inferno-os/appl/acme/text.m (revision 546783184a373a2dd59afef3affe029a6aedd701)
1Textm : module {
2	PATH : con "/dis/acme/text.dis";
3
4	init : fn(mods : ref Dat->Mods);
5
6	# Text.what
7	Columntag, Rowtag, Tag, Body : con iota;
8
9	newtext : fn() : ref Text;
10
11	Text : adt {
12		file : cyclic ref Filem->File;
13		frame : ref Framem->Frame;
14		reffont : ref Dat->Reffont;
15		org : int;
16		q0 : int;
17		q1 : int;
18		what : int;
19		tabstop : int;
20		w : cyclic ref Windowm->Window;
21		scrollr : Draw->Rect;
22		lastsr : Draw->Rect;
23		all : Draw->Rect;
24		row : cyclic ref Rowm->Row;
25		col : cyclic ref Columnm->Column;
26		eq0 : int;		# start of typing for ESC
27		cq0 : int;		# cache position
28		ncache : int;	# storage for insert
29		ncachealloc : int;
30		cache : string;
31		nofill : int;
32
33		init : fn(t : self ref Text, f : ref Filem->File, r : Draw->Rect, rf : ref Dat->Reffont, cols : array of ref Draw->Image);
34		redraw : fn(t : self ref Text, r : Draw->Rect, f : ref Draw->Font, b : ref Draw->Image, n : int);
35		insert : fn(t : self ref Text, n : int, s : string, p : int, q : int, r : int);
36		bsinsert : fn(t : self ref Text, n : int, s : string, p : int, q : int) : (int, int);
37		delete : fn(t : self ref Text, n : int, p : int, q : int);
38		loadx : fn(t : self ref Text, n : int, b : string, q : int) : int;
39		typex : fn(t : self ref Text, r : int, echomode : int);
40		select : fn(t : self ref Text, d : int);
41		select2 : fn(t : self ref Text, p : int, q : int) : (int, ref Text, int, int);
42		select3 : fn(t : self ref Text, p: int, q : int) : (int, int, int);
43		setselect : fn(t : self ref Text, p : int, q : int);
44		setselect0 : fn(t : self ref Text, p : int, q : int);
45		show : fn(t : self ref Text, p : int, q : int, dosel : int);
46		fill : fn(t : self ref Text);
47		commit : fn(t : self ref Text, n : int);
48		setorigin : fn(t : self ref Text, p : int, q : int);
49		readc : fn(t : self ref Text, n : int) : int;
50		reset : fn(t : self ref Text);
51		reshape : fn(t : self ref Text, r : Draw->Rect) : int;
52		close : fn(t : self ref Text);
53		framescroll : fn(t : self ref Text, n : int);
54		select23 : fn(t : self ref Text, p : int, q : int, i, it : ref Draw->Image, n : int) : (int, int, int);
55		forwnl : fn(t : self ref Text, p : int, q : int) : int;
56		backnl : fn(t : self ref Text, p : int, q : int) : int;
57		bswidth : fn(t : self ref Text, r : int) : int;
58		doubleclick : fn(t : self ref Text, p : int, q : int) : (int, int);
59		clickmatch : fn(t : self ref Text, p : int, q : int, r : int, n : int) : (int, int);
60		columnate : fn(t : self ref Text, d : array of ref Dat->Dirlist, n : int);
61	};
62
63	framescroll : fn(f : ref Framem->Frame, dl : int);
64	setalphabet: fn(s: string);
65};