X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fwww%2Flambdadelta%2Fbin%2Fxhtbl%2Ftable.ml;fp=helm%2Fwww%2Flambdadelta%2Fbin%2Fxhtbl%2Ftable.ml;h=e363cd4347b18864ae9b1e0405cd20c4353782e1;hb=2a5e0b799cd6aae5d920c67a5ddc9d9888cf7e80;hp=0000000000000000000000000000000000000000;hpb=eae50cc815292d335df1c488a00b39ef98fa5870;p=helm.git diff --git a/helm/www/lambdadelta/bin/xhtbl/table.ml b/helm/www/lambdadelta/bin/xhtbl/table.ml new file mode 100644 index 000000000..e363cd434 --- /dev/null +++ b/helm/www/lambdadelta/bin/xhtbl/table.ml @@ -0,0 +1,54 @@ +type css = string list + +type size = { + y : int; (* first row *) + x : int; (* first column *) + rf: int; (* finite rows *) + cf: int; (* finite columns *) + ri: int; (* infinite rows *) + ci: int; (* infinite columns *) + p : bool option; (* parent kind *) +} + +type border = { + n: bool; (* north *) + s: bool; (* south *) + e: bool; (* east *) + w: bool; (* west *) +} + +type key = Text of string list + | Glue of int option + +type table = { + mutable tc: css; (* css classes *) + mutable ts: size; (* dimension *) + tb: border; (* border *) + te: entry; (* contents *) + ti: int; (* table identifier *) +} + +and entry = Key of key + | Line of bool * table list (* true for a row *) + +let id = + let current = ref 0 in + fun () -> incr current; !current + +let no_size = { + y = 0; x = 0; rf = 0; cf = 0; ri = 0; ci = 0; p = None; +} + +let border b = { + n = b; s = b; e = b; w = b; +} + +let mk_key k tc = { + ts = no_size; tb = border false; te = Key k; tc = tc; + ti = id (); +} + +let mk_line b tl tc = { + ts = no_size; tb = border b; te = Line (b, tl); tc = tc; + ti = id (); +}