comparison gui.urs @ 27:5905b56e0cd9

Adapt to new HTML contexts
author Adam Chlipala <adam@chlipala.net>
date Tue, 20 Dec 2011 21:04:21 -0500
parents 554e342665fe
children
comparison
equal deleted inserted replaced
26:86857ae0f386 27:5905b56e0cd9
1 (* Gui framework elements common across individual components. *) 1 (* Gui framework elements common across individual components. *)
2 2
3 (* Types of this class describe gui components. *) 3 (* Types of this class describe gui components. *)
4 class gui :: Type (* The type of an object to render *) 4 class gui :: Type (* The type of an object to render *)
5 -> {Unit} (* The HTML context to render it for (minus [body]) *) 5 -> {Unit} (* The HTML context to render it for (minus [Dyn]) *)
6 -> Type 6 -> Type
7 7
8 (* How to add components to the gui class. *) 8 (* How to add components to the gui class. *)
9 val mkGui : t ::: Type -> ctx ::: {Unit} -> ([body ~ ctx] => t -> xml (body ++ ctx) [] []) -> gui t ctx 9 val mkGui : t ::: Type -> ctx ::: {Unit} -> ([[Dyn] ~ ctx] => t -> xml ([Dyn] ++ ctx) [] []) -> gui t ctx
10 10
11 (* XML itself can be a gui component. *) 11 (* XML itself can be a gui component. *)
12 val gui_xbody : gui xbody [] 12 val gui_xbody : gui xbody body'
13 val gui_xtable : gui xtable [Table] 13 val gui_xtable : gui xtable tabl'
14 14
15 (* Currently the only thing a gui component can do is be 15 (* Currently the only thing a gui component can do is be
16 * pretty printed to a piece of xml. *) 16 * pretty printed to a piece of xml. *)
17 val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] [] 17 val toXml : t ::: Type -> ctx ::: {Unit} -> [[Dyn] ~ ctx] => gui t ctx -> t -> xml ([Dyn] ++ ctx) [] []