6 ck: string list; (* contents *)
7 cc: T.css; (* css classes *)
8 cb: T.border; (* border *)
14 m: cell array array; (* matrix *)
18 ck = []; cc = []; cb = T.border false;
22 r = ts.T.rf; c = ts.T.cf;
23 m = A.make_matrix ts.T.rf ts.T.cf empty;
26 let set_key m y x kl =
27 m.m.(y).(x) <- {m.m.(y).(x) with ck = kl}
30 m.m.(y).(x) <- {m.m.(y).(x) with cc = c @ m.m.(y).(x).cc}
32 let set_west m y x b =
33 let c = m.m.(y).(x) in
34 let cb = {c.cb with T.w = c.cb.T.w || b.T.w} in
35 m.m.(y).(x) <- {c with cb = cb}
37 let set_north m y x b =
38 let c = m.m.(y).(x) in
39 let cb = {c.cb with T.n = c.cb.T.n || b.T.n} in
40 m.m.(y).(x) <- {c with cb = cb}
42 let set_east m y x b =
43 if x < pred m.c then set_west m y (succ x) {b with T.w = b.T.e} else
44 let c = m.m.(y).(x) in
45 let cb = {c.cb with T.e = c.cb.T.e || b.T.e} in
46 m.m.(y).(x) <- {c with cb = cb}
48 let set_south m y x b =
49 if y < pred m.r then set_north m (succ y) x {b with T.n = b.T.s} else
50 let c = m.m.(y).(x) in
51 let cb = {c.cb with T.s = c.cb.T.s || b.T.s} in
52 m.m.(y).(x) <- {c with cb = cb}