view gui.urs @ 26:86857ae0f386

Change more dashes to slashes, for JavaScript compatibility
author Adam Chlipala <adam@chlipala.net>
date Fri, 09 Dec 2011 17:38:20 -0500
parents 554e342665fe
children 5905b56e0cd9
line wrap: on
line source
(* Gui framework elements common across individual components. *)

(* Types of this class describe gui components. *)
class gui :: Type (* The type of an object to render *)
      -> {Unit} (* The HTML context to render it for (minus [body]) *)
      -> Type

(* How to add components to the gui class. *)
val mkGui : t ::: Type -> ctx ::: {Unit} -> ([body ~ ctx] => t -> xml (body ++ ctx) [] []) -> gui t ctx

(* XML itself can be a gui component. *)
val gui_xbody : gui xbody []
val gui_xtable : gui xtable [Table]

(* Currently the only thing a gui component can do is be
 * pretty printed to a piece of xml. *)
val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] []