-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Purely FunctionaL User Interface -- -- This package contains a set of composable purely functional widgets -- and a mainloop adapter to adapt the widgets to run in IO. It is -- HaskGame based. -- -- HaskGame does not yet wrap SDL properly, so it uses SDL directly as -- well. -- -- Project wiki page: http://haskell.org/haskellwiki/LUI -- -- © 2009 by Eyal Lotem; BSD3 license. @package lui @version 0.0.2 module Graphics.UI.LUI.Draw type Position = Vector2 Int type Size = Vector2 Int data Draw a data Compute a render :: Surface -> Position -> Draw a -> IO a computeResult :: Compute a -> IO a textSize :: Font -> String -> Compute Size computeToDraw :: Compute a -> Draw a text :: Color -> Font -> String -> Draw Size rect :: Color -> Size -> Draw Size move :: Position -> Draw a -> Draw a instance Monad Draw instance Monad Compute module Graphics.UI.LUI.Accessor data Accessor whole part accessor :: (whole -> part) -> (part -> whole -> whole) -> Accessor whole part convertor :: (whole -> part) -> (part -> whole) -> Accessor whole part (^.) :: whole -> Accessor whole part -> part (^:) :: Accessor whole part -> (part -> part) -> whole -> whole (<^) :: Accessor b c -> Accessor a b -> Accessor a c (^>) :: Accessor a b -> Accessor b c -> Accessor a c self :: Accessor a a reader :: r -> Accessor a r write :: Accessor whole part -> part -> whole -> whole afirst :: Accessor (a, b) a asecond :: Accessor (a, b) b anth :: Int -> Accessor [a] a aMapValue :: (Ord k) => k -> Accessor (Map k a) a aMapValueDefault :: (Ord k) => a -> k -> Accessor (Map k a) a module Graphics.UI.LUI.Widget data DrawInfo DrawInfo :: Bool -> DrawInfo diHasFocus :: DrawInfo -> Bool data WidgetFuncs model WidgetFuncs :: DrawInfo -> Draw Size -> DrawInfo -> Compute Size -> Maybe (ActionHandlers model) -> WidgetFuncs model widgetDraw :: WidgetFuncs model -> DrawInfo -> Draw Size widgetSize :: WidgetFuncs model -> DrawInfo -> Compute Size widgetGetKeymap :: WidgetFuncs model -> Maybe (ActionHandlers model) data KeyStatus KeyDown :: KeyStatus KeyUp :: KeyStatus type Widget model = model -> WidgetFuncs model type New model mutable = Accessor model mutable -> Widget model type KeyAction = (KeyStatus, KeyGroup) type Handler model = (String, ModKey -> model) type ActionHandlers model = Map KeyAction (Handler model) instance Eq DrawInfo instance Ord DrawInfo instance Show DrawInfo instance Read DrawInfo instance Eq KeyStatus instance Ord KeyStatus instance Show KeyStatus instance Read KeyStatus module Graphics.UI.LUI.Run mainLoop :: Widget model -> model -> IO model module Graphics.UI.LUI.Widgets.Space new :: Size -> Widget model newWH :: Int -> Int -> Widget model newH :: Int -> Widget model module Graphics.UI.LUI.Widgets.TextView new :: Color -> Font -> String -> Widget model module Graphics.UI.LUI.Widgets.Unfocusable new :: Widget model -> Widget model module Graphics.UI.LUI.Widgets.Adapter adapt :: Accessor whole part -> Widget part -> Widget whole module Graphics.UI.LUI.Widgets.FocusDelegator data Mutable Mutable :: Bool -> Mutable mutableDelegateFocus :: Mutable -> Bool type DelegatedMutable mutable = (Mutable, mutable) aDelegatedMutable :: Accessor (DelegatedMutable mutable) mutable aFocusDelegatorMutable :: Accessor (DelegatedMutable mutable) Mutable defaultFocusColor :: Color newWith :: Color -> String -> String -> Widget model -> New model Mutable new :: String -> String -> Widget model -> New model Mutable module Graphics.UI.LUI.Widgets.Grid data Item model Item :: Widget model -> (Double, Double) -> Item model itemWidget :: Item model -> Widget model itemAlignments :: Item model -> (Double, Double) data Mutable Mutable :: Cursor -> Mutable mutableCursor :: Mutable -> Cursor type Items model = Map Cursor (Item model) type Cursor = (Int, Int) new :: Cursor -> Items model -> New model Mutable aMutableCursor :: Accessor Mutable Cursor type DelegatedMutable = DelegatedMutable Mutable delegatedMutable :: Bool -> Cursor -> DelegatedMutable aDelegatedMutableCursor :: Accessor DelegatedMutable Cursor newDelegated :: Cursor -> Items model -> New model DelegatedMutable newDelegatedWith :: Color -> Cursor -> Items model -> New model DelegatedMutable module Graphics.UI.LUI.Widgets.Box data Orientation Horizontal :: Orientation Vertical :: Orientation data Item model Item :: Widget model -> Double -> Item model itemChildWidget :: Item model -> Widget model itemAlignment :: Item model -> Double data Mutable Mutable :: Cursor -> Mutable mutableCursor :: Mutable -> Cursor type Cursor = Int new :: Orientation -> [Item model] -> New model Mutable aMutableCursor :: Accessor Mutable Cursor type DelegatedMutable = DelegatedMutable Mutable delegatedMutable :: Bool -> Cursor -> DelegatedMutable aDelegatedMutableCursor :: Accessor DelegatedMutable Cursor newDelegated :: Orientation -> [Item model] -> New model DelegatedMutable newDelegatedWith :: Color -> Orientation -> [Item model] -> New model DelegatedMutable module Graphics.UI.LUI.Widgets.KeysTable defaultDescColor :: Color defaultSpaceWidth :: Int new :: Color -> Color -> Int -> Font -> Font -> ActionHandlers model -> Widget model newForWidget :: Font -> Font -> Widget model -> Widget model module Graphics.UI.LUI.Widgets.TextEdit data Mutable Mutable :: String -> Cursor -> Mutable mutableText :: Mutable -> String mutableCursor :: Mutable -> Cursor aMutableCursor :: Accessor Mutable Cursor aMutableText :: Accessor Mutable String type Cursor = Int defaultCursorWidth :: Int new :: Int -> Color -> Color -> Font -> Color -> New model Mutable type DelegatedMutable = DelegatedMutable Mutable aDelegatedMutableCursor :: Accessor DelegatedMutable Cursor aDelegatedMutableText :: Accessor DelegatedMutable String delegatedMutable :: Bool -> String -> Cursor -> DelegatedMutable newDelegatedWith :: Color -> Int -> Color -> Color -> Font -> Color -> New model DelegatedMutable newDelegated :: Color -> Color -> Font -> Color -> New model DelegatedMutable