kkallio@8: (* Gui framework elements common across individual components. *) kkallio@8: kkallio@8: (* Types of this class describe gui components. *) adam@20: class gui :: Type (* The type of an object to render *) adam@20: -> {Unit} (* The HTML context to render it for (minus [body]) *) adam@20: -> Type rmbruijn@18: rmbruijn@18: (* How to add components to the gui class. *) adam@20: val mkGui : t ::: Type -> ctx ::: {Unit} -> ([body ~ ctx] => t -> xml (body ++ ctx) [] []) -> gui t ctx rmbruijn@18: adam@20: (* XML itself can be a gui component. *) adam@20: val gui_xbody : gui xbody [] adam@20: val gui_xtable : gui xtable [Table] rmbruijn@18: kkallio@8: (* Currently the only thing a gui component can do is be kkallio@8: * pretty printed to a piece of xml. *) adam@20: val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] []