{-# LANGUAGE QuasiQuotes #-} module Termonad.XML where import Termonad.Prelude import Data.Default (def) import Text.XML (renderText) import Text.XML.QQ (Document, xmlRaw) -- TODO: A number of widgets have different places where a child can be added -- (e.g. tabs vs. page content in notebooks). This can be reflected in a UI -- definition by specifying the “type” attribute on a The possible -- values for the “type” attribute are described in the sections describing the -- widget-specific portions of UI definitions. interfaceDoc :: Document interfaceDoc = [xmlRaw| Example Application 600 400 True vertical True |] interfaceText :: Text interfaceText = toStrict $ renderText def interfaceDoc menuDoc :: Document menuDoc = [xmlRaw| File
New _Tab app.newtab
_Close Tab app.closetab _Quit app.quit
Edit _Copy app.copy _Paste app.paste View _Enlarge Font Size app.enlargefont _Reduce Font Size app.reducefont Help _About app.about
|] menuText :: Text menuText = toStrict $ renderText def menuDoc aboutDoc :: Document aboutDoc = [xmlRaw| About False True True 6 12 6 True _Font: True font 1 0 0 True 1 0 True _Transition: True transition 1 0 1 True None Fade Slide 1 1 |] aboutText :: Text aboutText = toStrict $ renderText def aboutDoc closeTabDoc :: Document closeTabDoc = [xmlRaw| Close Tab False True True 10 True True Close tab? 10 True True True 10 True True Yes, close tab True True GTK_RELIEF_NORMAL No, do NOT close tab True True GTK_RELIEF_NORMAL |] closeTabText :: Text closeTabText = toStrict $ renderText def closeTabDoc