7 ts: T.size; (* current dimensions *)
8 tc: T.css; (* current class *)
9 tu: T.uri; (* current uri *)
10 tx: T.ext; (* current extension *)
14 ts = T.no_size; tc = []; tu = ""; tx = ""
19 {ts with T.ri = max_int; T.ci = 0}
21 {ts with T.ri = 0; T.ci = max_int}
23 let combine b ts1 ts2 =
26 T.rf = max ts1.T.rf ts2.T.rf; T.ri = min ts1.T.ri ts2.T.ri;
27 T.cf = ts1.T.cf + ts2.T.cf; T.ci = ts1.T.ci + ts2.T.ci;
31 T.cf = max ts1.T.cf ts2.T.cf; T.ci = min ts1.T.ci ts2.T.ci;
32 T.rf = ts1.T.rf + ts2.T.rf; T.ri = ts1.T.ri + ts2.T.ri;
35 let deinit ts = {ts with
36 T.ri = if ts.T.ri = max_int then 0 else ts.T.ri;
37 T.ci = if ts.T.ci = max_int then 0 else ts.T.ci;
40 (****************************************************************************)
43 t.T.tc <- t.T.tc @ st.tc; t.T.tu <- st.tu ^ t.T.tu; t.T.tx <- st.tx ^ t.T.tx;
44 {st with tc = t.T.tc; tu = t.T.tu; tx = t.T.tx}
46 let close_table st t =
50 let ts = match k, st.ts.T.p with
52 {st.ts with T.rf = 1; T.cf = 1; T.ri = 0; T.ci = 0}
54 {st.ts with T.rf = 0; T.cf = 0; T.ri = 1; T.ci = 1}
55 | T.Glue Some g, Some false ->
56 {st.ts with T.rf = g; T.cf = 0; T.ri = 0; T.ci = 1}
57 | T.Glue Some g, Some true ->
58 {st.ts with T.rf = 0; T.cf = g; T.ri = 1; T.ci = 0}
59 | T.Glue Some g, None ->
60 {st.ts with T.rf = g; T.cf = g; T.ri = 0; T.ci = 0}
65 let ts = init b st.ts in
66 let ts = {ts with T.rf = 0; T.cf = 0} in
70 let ts = {st.ts with T.p = Some b} in
73 let close_entry b st sst =
74 {st with ts = combine b st.ts sst.ts}
77 {st with ts = deinit st.ts}
80 F.open_table = open_table; F.close_table = close_table;
81 F.open_line = open_line; F.close_line = close_line;
82 F.open_entry = open_entry; F.close_entry = close_entry;
87 let st = F.fold_table cb empty t in