7 ck: T.text list; (* contents *)
8 cc: T.css; (* css classes *)
10 cx: T.ext; (* extension *)
11 cn: T.anchor; (* named anchor *)
12 cb: T.border; (* border *)
18 m: cell array array; (* matrix *)
21 let strand a b = if a = "" then b else a
24 ck = []; cc = []; cu = ""; cx = ""; cn = ""; cb = T.border false;
28 r = ts.T.rf; c = ts.T.cf;
29 m = A.make_matrix ts.T.rf ts.T.cf empty;
32 let set_key m y x kl =
33 m.m.(y).(x) <- {m.m.(y).(x) with ck = kl}
35 let set_attrs m y x c u e n =
36 m.m.(y).(x) <- {m.m.(y).(x) with
37 cc = c @ m.m.(y).(x).cc;
38 cu = u ^ m.m.(y).(x).cu;
39 cx = m.m.(y).(x).cx ^ e;
40 cn = strand m.m.(y).(x).cn n;
43 let set_west m y x b =
44 let c = m.m.(y).(x) in
45 let cb = {c.cb with T.w = c.cb.T.w || b.T.w} in
46 m.m.(y).(x) <- {c with cb = cb}
48 let set_north m y x b =
49 let c = m.m.(y).(x) in
50 let cb = {c.cb with T.n = c.cb.T.n || b.T.n} in
51 m.m.(y).(x) <- {c with cb = cb}
53 let set_east m y x b =
54 if x < pred m.c then set_west m y (succ x) {b with T.w = b.T.e} else
55 let c = m.m.(y).(x) in
56 let cb = {c.cb with T.e = c.cb.T.e || b.T.e} in
57 m.m.(y).(x) <- {c with cb = cb}
59 let set_south m y x b =
60 if y < pred m.r then set_north m (succ y) x {b with T.n = b.T.s} else
61 let c = m.m.(y).(x) in
62 let cb = {c.cb with T.s = c.cb.T.s || b.T.s} in
63 m.m.(y).(x) <- {c with cb = cb}