7 ts: T.size; (* current dimensions *)
8 tc: T.css; (* current class *)
12 ts = T.no_size; tc = [];
17 {ts with T.ri = max_int; T.ci = 0}
19 {ts with T.ri = 0; T.ci = max_int}
21 let combine b ts1 ts2 =
24 T.rf = max ts1.T.rf ts2.T.rf; T.ri = min ts1.T.ri ts2.T.ri;
25 T.cf = ts1.T.cf + ts2.T.cf; T.ci = ts1.T.ci + ts2.T.ci;
29 T.cf = max ts1.T.cf ts2.T.cf; T.ci = min ts1.T.ci ts2.T.ci;
30 T.rf = ts1.T.rf + ts2.T.rf; T.ri = ts1.T.ri + ts2.T.ri;
33 let deinit ts = {ts with
34 T.ri = if ts.T.ri = max_int then 0 else ts.T.ri;
35 T.ci = if ts.T.ci = max_int then 0 else ts.T.ci;
38 (****************************************************************************)
41 t.T.tc <- t.T.tc @ st.tc;
44 let close_table st t =
48 let ts = match k, st.ts.T.p with
50 {st.ts with T.rf = 1; T.cf = 1; T.ri = 0; T.ci = 0}
52 {st.ts with T.rf = 0; T.cf = 0; T.ri = 1; T.ci = 1}
53 | T.Glue Some g, Some false ->
54 {st.ts with T.rf = g; T.cf = 0; T.ri = 0; T.ci = 1}
55 | T.Glue Some g, Some true ->
56 {st.ts with T.rf = 0; T.cf = g; T.ri = 1; T.ci = 0}
57 | T.Glue Some g, None ->
58 {st.ts with T.rf = g; T.cf = g; T.ri = 0; T.ci = 0}
63 let ts = init b st.ts in
64 let ts = {ts with T.rf = 0; T.cf = 0} in
68 let ts = {st.ts with T.p = Some b} in
71 let close_entry b st sst =
72 {st with ts = combine b st.ts sst.ts}
75 {st with ts = deinit st.ts}
78 F.open_table = open_table; F.close_table = close_table;
79 F.open_line = open_line; F.close_line = close_line;
80 F.open_entry = open_entry; F.close_entry = close_entry;
85 let st = F.fold_table cb empty t in