Safe Haskell | None |
---|---|
Language | Haskell2010 |
UI.HSCurses.Widgets
Synopsis
- type Pos = (Int, Int)
- type Offset = (Int, Int)
- type Size = (Int, Int)
- getHeight :: Size -> Int
- getWidth :: Size -> Int
- getYOffset :: Offset -> Int
- getXOffset :: Offset -> Int
- getYPos :: Pos -> Int
- getXPos :: Pos -> Int
- data Direction
- data HAlignment
- data Cont a
- class Widget a where
- class Widget a => ActiveWidget a where
- type KeyHandler a = Pos -> Size -> a -> IO (Cont a)
- mkKeyHandler :: (Pos -> Size -> a -> a) -> KeyHandler a
- data DrawingHint
- data DrawingStyle = DStyle {}
- mkDrawingStyle :: CursesStyle -> DrawingStyle
- defaultDrawingStyle :: DrawingStyle
- _draw :: DrawingHint -> DrawingStyle -> IO a -> IO a
- scrollFactor :: Double
- scrollBy :: Int -> Int
- scrollForward :: Int -> Int -> Int -> Int
- scrollBackward :: t -> Int -> Int -> Int
- data EmptyWidget = EmptyWidget Size
- data OpaqueWidget = OpaqueWidget Size
- data EditWidget = EditWidget {}
- ew_contentPos :: EditWidget -> Int
- data EditWidgetOptions = EWOptions {}
- defaultEWOptions :: EditWidgetOptions
- newEditWidget :: EditWidgetOptions -> String -> EditWidget
- editWidgetGoLeft :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetGoRight :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetDeleteLeft :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetDeleteUnderCursor :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetDeleteToEnd :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetGoHome :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetGoEnd :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetHistoryUp :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetHistoryDown :: Pos -> Size -> EditWidget -> IO (Cont EditWidget)
- editWidgetKeyHandlers :: [(Key, Pos -> Size -> EditWidget -> IO (Cont EditWidget))]
- editWidgetGetContent :: EditWidget -> String
- editWidgetSetContent :: EditWidget -> String -> EditWidget
- editWidgetGetOptions :: EditWidget -> EditWidgetOptions
- editWidgetSetOptions :: EditWidget -> EditWidgetOptions -> EditWidget
- drawEditWidget :: Pos -> Size -> DrawingHint -> EditWidget -> IO ()
- activateEditWidget :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> EditWidget -> m (EditWidget, String)
- editWidgetGoLeft' :: t -> t1 -> EditWidget -> EditWidget
- editWidgetGoRight' :: t -> (t1, Int) -> EditWidget -> EditWidget
- editWidgetDeleteLeft' :: Pos -> Size -> EditWidget -> EditWidget
- editWidgetDeleteUnderCursor' :: t -> t1 -> EditWidget -> EditWidget
- editWidgetDeleteToEnd' :: t -> t1 -> EditWidget -> EditWidget
- editWidgetGoHome' :: t -> t1 -> EditWidget -> EditWidget
- editWidgetGoEnd' :: Pos -> Size -> EditWidget -> EditWidget
- editWidgetFinish :: Monad m => t -> t1 -> EditWidget -> m (Cont EditWidget)
- maxHistoryLength :: Int
- addToHistory :: EditWidget -> [Char] -> EditWidget
- editWidgetHistoryUp' :: t -> t1 -> EditWidget -> EditWidget
- editWidgetHistoryDown' :: t -> t1 -> EditWidget -> EditWidget
- editWidgetHistory :: Num t => (Int -> t -> Int) -> EditWidget -> EditWidget
- data TextWidget = TextWidget {}
- data TextWidgetSize
- data TextWidgetOptions = TWOptions {}
- defaultTWOptions :: TextWidgetOptions
- newTextWidget :: TextWidgetOptions -> String -> TextWidget
- drawTextWidget :: Pos -> Size -> DrawingHint -> TextWidget -> IO ()
- textWidgetGetText :: TextWidget -> String
- textWidgetSetText :: TextWidget -> String -> TextWidget
- textWidgetScrollDown :: Size -> TextWidget -> TextWidget
- textWidgetScrollUp :: Size -> TextWidget -> TextWidget
- textWidgetScrollLeft :: Size -> TextWidget -> TextWidget
- textWidgetScrollRight :: Size -> TextWidget -> TextWidget
- data TableCell
- = Widget w => TableCell w
- | ActiveWidget w => ActiveTableCell w
- isActive :: TableCell -> Bool
- _activateTableCell :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> TableCell -> m (TableCell, String)
- type Row = [TableCell]
- singletonRow :: TableCell -> Row
- getCellWidget :: TableWidget -> (Int, Int) -> TableCell
- setCellWidget :: TableWidget -> (Int, Int) -> TableCell -> TableWidget
- data TableWidget = TableWidget {
- tbw_rows :: [Row]
- tbw_colOffset :: Int
- tbw_pos :: Maybe Pos
- tbw_options :: TableWidgetOptions
- data FillRow
- data TableWidgetOptions = TBWOptions {}
- defaultTBWOptions :: TableWidgetOptions
- newTableWidget :: TableWidgetOptions -> [Row] -> TableWidget
- data TableWidgetDisplayInfo = TBWDisplayInfo {
- tbwdisp_height :: Int
- tbwdisp_width :: Int
- tbwdisp_firstVis :: Int
- tbwdisp_lastVis :: Int
- tbwdisp_rows :: [Row]
- tbwdisp_nrows :: Int
- tbwdisp_heights :: [Int]
- tbwdisp_widths :: [Int]
- tbwdisp_rightMargin :: Maybe (Int, Size)
- tableWidgetDisplayInfo :: Size -> TableWidget -> TableWidgetDisplayInfo
- getCellInfo :: Pos -> Size -> TableWidget -> (Int, Int) -> (Pos, Size)
- drawTableWidget :: Pos -> Size -> DrawingHint -> TableWidget -> IO ()
- tableWidgetScrollDown :: Size -> TableWidget -> TableWidget
- tableWidgetScrollUp :: Size -> TableWidget -> TableWidget
- tableWidgetActivateCurrent :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> DrawingHint -> TableWidget -> m (TableWidget, Maybe String)
- tableWidgetGoLeft :: Size -> TableWidget -> TableWidget
- tableWidgetGoRight :: Size -> TableWidget -> TableWidget
- tableWidgetGoUp :: Size -> TableWidget -> TableWidget
- tableWidgetGoDown :: Size -> TableWidget -> TableWidget
- tableWidgetMove :: Direction -> (Int, Int) -> TableWidget -> TableWidget
- tableWidgetMakeVisible :: TableWidget -> (Int, Int) -> Int -> TableWidget
- findFirstActiveCell :: [Row] -> TableWidgetOptions -> Maybe Pos
- findNextActiveCell :: TableWidgetOptions -> Int -> Pos -> Direction -> Maybe Pos
- tableWidgetDeleteRow :: Int -> TableWidget -> TableWidget
- joinLists :: [[a]] -> [a] -> [a]
- splitList :: Eq a => [a] -> [a] -> [[a]]
- listReplace :: [a] -> a -> Int -> [a]
- alignRows :: [[[a]]] -> a -> [a] -> [[a]]
- align :: HAlignment -> Int -> a -> [a] -> [a]
- deleteAt :: Int -> [a] -> [a]
Documentation
getYOffset :: Offset -> Int Source #
getXOffset :: Offset -> Int Source #
Instances
Show Direction Source # | |
Eq Direction Source # | |
Ord Direction Source # | |
data HAlignment Source #
Constructors
AlignLeft | |
AlignCenter | |
AlignRight |
Instances
Show HAlignment Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> HAlignment -> ShowS # show :: HAlignment -> String # showList :: [HAlignment] -> ShowS # | |
Eq HAlignment Source # | |
Defined in UI.HSCurses.Widgets |
Instances
Widget EditWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> EditWidget -> IO () Source # minSize :: EditWidget -> Size Source # | |
Widget EmptyWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> EmptyWidget -> IO () Source # minSize :: EmptyWidget -> Size Source # | |
Widget OpaqueWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> OpaqueWidget -> IO () Source # minSize :: OpaqueWidget -> Size Source # | |
Widget TableCell Source # | |
Widget TableWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> TableWidget -> IO () Source # minSize :: TableWidget -> Size Source # | |
Widget TextWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> TextWidget -> IO () Source # minSize :: TextWidget -> Size Source # |
class Widget a => ActiveWidget a where Source #
Instances
ActiveWidget EditWidget Source # | |
Defined in UI.HSCurses.Widgets Methods activate :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> EditWidget -> m (EditWidget, String) Source # |
mkKeyHandler :: (Pos -> Size -> a -> a) -> KeyHandler a Source #
data DrawingHint Source #
Instances
Show DrawingHint Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> DrawingHint -> ShowS # show :: DrawingHint -> String # showList :: [DrawingHint] -> ShowS # | |
Eq DrawingHint Source # | |
Defined in UI.HSCurses.Widgets | |
Ord DrawingHint Source # | |
Defined in UI.HSCurses.Widgets Methods compare :: DrawingHint -> DrawingHint -> Ordering # (<) :: DrawingHint -> DrawingHint -> Bool # (<=) :: DrawingHint -> DrawingHint -> Bool # (>) :: DrawingHint -> DrawingHint -> Bool # (>=) :: DrawingHint -> DrawingHint -> Bool # max :: DrawingHint -> DrawingHint -> DrawingHint # min :: DrawingHint -> DrawingHint -> DrawingHint # |
data DrawingStyle Source #
Constructors
DStyle | |
Fields |
Instances
Show DrawingStyle Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> DrawingStyle -> ShowS # show :: DrawingStyle -> String # showList :: [DrawingStyle] -> ShowS # | |
Eq DrawingStyle Source # | |
Defined in UI.HSCurses.Widgets |
_draw :: DrawingHint -> DrawingStyle -> IO a -> IO a Source #
data EmptyWidget Source #
Constructors
EmptyWidget Size |
Instances
Widget EmptyWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> EmptyWidget -> IO () Source # minSize :: EmptyWidget -> Size Source # |
data OpaqueWidget Source #
Constructors
OpaqueWidget Size |
Instances
Widget OpaqueWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> OpaqueWidget -> IO () Source # minSize :: OpaqueWidget -> Size Source # |
data EditWidget Source #
Constructors
EditWidget | |
Fields
|
Instances
ActiveWidget EditWidget Source # | |
Defined in UI.HSCurses.Widgets Methods activate :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> EditWidget -> m (EditWidget, String) Source # | |
Widget EditWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> EditWidget -> IO () Source # minSize :: EditWidget -> Size Source # |
ew_contentPos :: EditWidget -> Int Source #
data EditWidgetOptions Source #
Constructors
EWOptions | |
Fields
|
newEditWidget :: EditWidgetOptions -> String -> EditWidget Source #
editWidgetGoLeft :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetGoRight :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetDeleteLeft :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetDeleteUnderCursor :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetDeleteToEnd :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetGoHome :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetGoEnd :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetHistoryUp :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetHistoryDown :: Pos -> Size -> EditWidget -> IO (Cont EditWidget) Source #
editWidgetKeyHandlers :: [(Key, Pos -> Size -> EditWidget -> IO (Cont EditWidget))] Source #
editWidgetSetContent :: EditWidget -> String -> EditWidget Source #
drawEditWidget :: Pos -> Size -> DrawingHint -> EditWidget -> IO () Source #
activateEditWidget :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> EditWidget -> m (EditWidget, String) Source #
editWidgetGoLeft' :: t -> t1 -> EditWidget -> EditWidget Source #
editWidgetGoRight' :: t -> (t1, Int) -> EditWidget -> EditWidget Source #
editWidgetDeleteLeft' :: Pos -> Size -> EditWidget -> EditWidget Source #
editWidgetDeleteUnderCursor' :: t -> t1 -> EditWidget -> EditWidget Source #
editWidgetDeleteToEnd' :: t -> t1 -> EditWidget -> EditWidget Source #
editWidgetGoHome' :: t -> t1 -> EditWidget -> EditWidget Source #
editWidgetGoEnd' :: Pos -> Size -> EditWidget -> EditWidget Source #
editWidgetFinish :: Monad m => t -> t1 -> EditWidget -> m (Cont EditWidget) Source #
addToHistory :: EditWidget -> [Char] -> EditWidget Source #
editWidgetHistoryUp' :: t -> t1 -> EditWidget -> EditWidget Source #
editWidgetHistoryDown' :: t -> t1 -> EditWidget -> EditWidget Source #
editWidgetHistory :: Num t => (Int -> t -> Int) -> EditWidget -> EditWidget Source #
data TextWidget Source #
Constructors
TextWidget | |
Fields
|
Instances
Show TextWidget Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> TextWidget -> ShowS # show :: TextWidget -> String # showList :: [TextWidget] -> ShowS # | |
Eq TextWidget Source # | |
Defined in UI.HSCurses.Widgets | |
Widget TextWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> TextWidget -> IO () Source # minSize :: TextWidget -> Size Source # |
data TextWidgetSize Source #
Constructors
TWSizeDefault | |
TWSizeFixed Size |
Instances
Show TextWidgetSize Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> TextWidgetSize -> ShowS # show :: TextWidgetSize -> String # showList :: [TextWidgetSize] -> ShowS # | |
Eq TextWidgetSize Source # | |
Defined in UI.HSCurses.Widgets Methods (==) :: TextWidgetSize -> TextWidgetSize -> Bool # (/=) :: TextWidgetSize -> TextWidgetSize -> Bool # |
data TextWidgetOptions Source #
Constructors
TWOptions | |
Fields |
Instances
Show TextWidgetOptions Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> TextWidgetOptions -> ShowS # show :: TextWidgetOptions -> String # showList :: [TextWidgetOptions] -> ShowS # | |
Eq TextWidgetOptions Source # | |
Defined in UI.HSCurses.Widgets Methods (==) :: TextWidgetOptions -> TextWidgetOptions -> Bool # (/=) :: TextWidgetOptions -> TextWidgetOptions -> Bool # |
newTextWidget :: TextWidgetOptions -> String -> TextWidget Source #
drawTextWidget :: Pos -> Size -> DrawingHint -> TextWidget -> IO () Source #
textWidgetGetText :: TextWidget -> String Source #
textWidgetSetText :: TextWidget -> String -> TextWidget Source #
textWidgetScrollDown :: Size -> TextWidget -> TextWidget Source #
textWidgetScrollUp :: Size -> TextWidget -> TextWidget Source #
textWidgetScrollLeft :: Size -> TextWidget -> TextWidget Source #
textWidgetScrollRight :: Size -> TextWidget -> TextWidget Source #
Constructors
Widget w => TableCell w | |
ActiveWidget w => ActiveTableCell w |
_activateTableCell :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> TableCell -> m (TableCell, String) Source #
singletonRow :: TableCell -> Row Source #
getCellWidget :: TableWidget -> (Int, Int) -> TableCell Source #
setCellWidget :: TableWidget -> (Int, Int) -> TableCell -> TableWidget Source #
data TableWidget Source #
Constructors
TableWidget | |
Fields
|
Instances
Widget TableWidget Source # | |
Defined in UI.HSCurses.Widgets Methods draw :: Pos -> Size -> DrawingHint -> TableWidget -> IO () Source # minSize :: TableWidget -> Size Source # |
data TableWidgetOptions Source #
Constructors
TBWOptions | |
Fields
|
Instances
Show TableWidgetOptions Source # | |
Defined in UI.HSCurses.Widgets Methods showsPrec :: Int -> TableWidgetOptions -> ShowS # show :: TableWidgetOptions -> String # showList :: [TableWidgetOptions] -> ShowS # | |
Eq TableWidgetOptions Source # | |
Defined in UI.HSCurses.Widgets Methods (==) :: TableWidgetOptions -> TableWidgetOptions -> Bool # (/=) :: TableWidgetOptions -> TableWidgetOptions -> Bool # |
newTableWidget :: TableWidgetOptions -> [Row] -> TableWidget Source #
data TableWidgetDisplayInfo Source #
Constructors
TBWDisplayInfo | |
Fields
|
getCellInfo :: Pos -> Size -> TableWidget -> (Int, Int) -> (Pos, Size) Source #
drawTableWidget :: Pos -> Size -> DrawingHint -> TableWidget -> IO () Source #
tableWidgetScrollDown :: Size -> TableWidget -> TableWidget Source #
tableWidgetScrollUp :: Size -> TableWidget -> TableWidget Source #
tableWidgetActivateCurrent :: (MonadIO m, MonadMask m) => m () -> Pos -> Size -> DrawingHint -> TableWidget -> m (TableWidget, Maybe String) Source #
tableWidgetGoLeft :: Size -> TableWidget -> TableWidget Source #
tableWidgetGoRight :: Size -> TableWidget -> TableWidget Source #
tableWidgetGoUp :: Size -> TableWidget -> TableWidget Source #
tableWidgetGoDown :: Size -> TableWidget -> TableWidget Source #
tableWidgetMove :: Direction -> (Int, Int) -> TableWidget -> TableWidget Source #
tableWidgetMakeVisible :: TableWidget -> (Int, Int) -> Int -> TableWidget Source #
findFirstActiveCell :: [Row] -> TableWidgetOptions -> Maybe Pos Source #
findNextActiveCell :: TableWidgetOptions -> Int -> Pos -> Direction -> Maybe Pos Source #
tableWidgetDeleteRow :: Int -> TableWidget -> TableWidget Source #
listReplace :: [a] -> a -> Int -> [a] Source #
align :: HAlignment -> Int -> a -> [a] -> [a] Source #