-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Haskell bindings to the terminfo library.
--
-- This library provides an interface to the terminfo database (via
-- bindings to the curses library). Terminfo allows programs to interact
-- with a variety of terminals using a standard set of capabilities.
@package terminfo
@version 0.1
-- | This module provides a low-level interface to the C functions of the
-- terminfo library.
--
-- NOTE: Since this library is built on top of the curses interface, it
-- is not thread-safe.
module System.Console.Terminfo.Base
data Terminal
-- | Initialize the terminfo library to the given terminal entry.
setupTerm :: String -> IO Terminal
-- | Initialize the terminfo library, using the TERM environmental
-- variable. If TERM is not set, we use the generic, minimal
-- entry dumb.
setupTermFromEnv :: IO Terminal
-- | A feature or operation which a Terminal may define.
data Capability a
getCapability :: Terminal -> Capability a -> Maybe a
-- | Look up a boolean capability in the terminfo database.
--
-- Unlike tiGuardFlag, this capability never fails; it returns
-- False if the capability is absent or set to false, and returns
-- True otherwise.
tiGetFlag :: String -> Capability Bool
-- | Look up a boolean capability in the terminfo database, and fail if
-- it's not defined.
tiGuardFlag :: String -> Capability ()
-- | Look up a numeric capability in the terminfo database.
tiGetNum :: String -> Capability Int
-- | Look up a string capability in the terminfo database.
--
-- Note: Do not use this function for terminal output; use
-- tiGetOutput instead.
tiGetStr :: String -> Capability String
-- | An action which sends output to the terminal. That output may mix
-- plain text with control characters and escape sequences, along with
-- delays (called "padding") required by some older terminals.
data TermOutput
runTermOutput :: Terminal -> TermOutput -> IO ()
-- | Output plain text containing no control characters or escape
-- sequences.
termText :: String -> TermOutput
-- | Look up an output capability in the terminfo database.
tiGetOutput :: String -> Capability ([Int] -> LinesAffected -> TermOutput)
-- | A parameter to specify the number of lines affected. Some capabilities
-- (e.g., clear and dch1) use this parameter on some
-- terminals to compute variable-length padding.
type LinesAffected = Int
-- | Look up an output capability which takes a fixed number of parameters
-- (for example, Int -> Int -> TermOutput).
--
-- For capabilities which may contain variable-length padding, use
-- tiGetOutput instead.
tiGetOutput1 :: (OutputCap f) => String -> Capability f
-- | A type class to encapsulate capabilities which take in zero or more
-- parameters.
class OutputCap f
instance (Enum a, OutputCap f) => OutputCap (a -> f)
instance OutputCap TermOutput
instance Monoid TermOutput
instance MonadPlus Capability
instance Monad Capability
instance Functor Capability
-- | The string capabilities in this module are the character sequences
-- corresponding to user input such as arrow keys and function keys.
module System.Console.Terminfo.Keys
keypadOn :: Capability TermOutput
keypadOff :: Capability TermOutput
keyUp :: Capability String
keyDown :: Capability String
keyLeft :: Capability String
keyRight :: Capability String
-- | Look up the control sequence for a given function sequence. For
-- example, functionKey 12 retrieves the kf12
-- capability.
functionKey :: Int -> Capability String
keyBackspace :: Capability String
keyDeleteChar :: Capability String
-- | | This module provides capabilities for moving the cursor on the
-- terminal. -}
module System.Console.Terminfo.Cursor
termLines :: Capability Int
termColumns :: Capability Int
-- | The cr capability, which moves the cursor to the first column
-- of the current line.
carriageReturn :: Capability TermOutput
-- | The nel capability, which moves the cursor to the first
-- column of the next line. It behaves like a carriage return followed by
-- a line feed.
--
-- If nel is not defined, this may be built out of other
-- capabilities.
newline :: Capability TermOutput
scrollForward :: Capability TermOutput
scrollReverse :: Capability TermOutput
moveDown :: Capability (Int -> TermOutput)
moveLeft :: Capability (Int -> TermOutput)
moveRight :: Capability (Int -> TermOutput)
moveUp :: Capability (Int -> TermOutput)
cursorDown1 :: Capability TermOutput
cursorLeft1 :: Capability TermOutput
cursorRight1 :: Capability TermOutput
cursorUp1 :: Capability TermOutput
cursorDown :: Capability (Int -> TermOutput)
cursorLeft :: Capability (Int -> TermOutput)
cursorRight :: Capability (Int -> TermOutput)
cursorUp :: Capability (Int -> TermOutput)
cursorAddress :: Capability (Point -> TermOutput)
data Point
Point :: Int -> Int -> Point
row :: Point -> Int
col :: Point -> Int
rowAddress :: Capability (Int -> TermOutput)
columnAddress :: Capability (Int -> TermOutput)
module System.Console.Terminfo.Effects
wrapWith :: Capability TermOutput -> Capability TermOutput -> Capability (TermOutput -> TermOutput)
withUnderline :: Capability (TermOutput -> TermOutput)
withStandout :: Capability (TermOutput -> TermOutput)
exitStandoutMode :: Capability TermOutput
enterStandoutMode :: Capability TermOutput
exitUnderlineMode :: Capability TermOutput
enterUnderlineMode :: Capability TermOutput
module System.Console.Terminfo.Edit
-- | Clear the screen, and move the cursor to the upper left.
clearScreen :: Capability (LinesAffected -> TermOutput)
-- | Clear from beginning of line to cursor.
clearBOL :: Capability TermOutput
-- | Clear from cursor to end of line.
clearEOL :: Capability TermOutput
-- | Clear display after cursor.
clearEOS :: Capability (LinesAffected -> TermOutput)
module System.Console.Terminfo