-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A simple terminal access library -- -- vty is a *very* simplistic library in the niche of ncurses. It is -- intended to be easy to use, have no confusing corner cases, and good -- support for common terminal types. -- -- If you want to use it, currently the best reference is the test module -- (Test.hs). -- -- Notable infelicities: requires an ANSI-type terminal, poor efficiency, -- requires Linux/xterm style UTF8 support. -- -- You can 'darcs get' it from http://code.haskell.org/vty/ ' © -- 2006-2007 Stefan O'Rear; BSD3 license. @package vty @version 3.1.8 module Graphics.Vty -- | The main object. At most one should be created. data Vty Vty :: (Picture -> IO ()) -> IO Event -> IO (Int, Int) -> IO () -> IO () -> Vty -- | Update the screen to reflect the contents of a Picture. This is -- not currently threadsafe. update :: Vty -> Picture -> IO () -- | Get one Event object, blocking if necessary. getEvent :: Vty -> IO Event -- | Get the size of the display. getSize :: Vty -> IO (Int, Int) -- | Refresh the display. Normally the library takes care of refreshing. -- Nonetheless, some other program might output to the terminal and mess -- the display. In that case the user might want to force a refresh. refresh :: Vty -> IO () -- | Clean up after vty. shutdown :: Vty -> IO () -- | Make the terminal beep. beep :: IO () -- | Set up the state object for using vty. At most one state object should -- be created at a time. mkVty :: IO Vty mkVtyEscDelay :: Int -> IO Vty -- | This type represents the visible cursor state. data Cursor -- | Hide the cursor. NoCursor :: Cursor -- | Display the cursor at the given XY position. Cursor :: Int -> Int -> Cursor -- | An object representing the current state of the terminal. data TermState TS :: !Int -> !Int -> !Attr -> TermState _tsRow :: TermState -> !Int _tsColumn :: TermState -> !Int _tsAttr :: TermState -> !Attr -- | Opaque data type representing character attributes. newtype Attr Attr :: Int -> Attr -- | Set the foreground color of an Attr. setFG :: Color -> Attr -> Attr -- | Set the background color of an Attr. setBG :: Color -> Attr -> Attr -- | Set the foreground color of an Attr. setFGVivid :: Color -> Attr -> Attr -- | Set the background color of an Attr. setBGVivid :: Color -> Attr -> Attr -- | Set bold attribute of an Attr. setBold :: Attr -> Attr -- | Set blink attribute of an Attr. setBlink :: Attr -> Attr -- | Set reverse-video attribute of an Attr. setRV :: Attr -> Attr -- | Set half-bright attribute of an Attr. setHalfBright :: Attr -> Attr -- | Set underline attribute of an Attr. setUnderline :: Attr -> Attr -- | Attr with all default values. attr :: Attr -- | Abstract data type representing a color. newtype Color Color :: Int -> Color -- | Basic color definitions. red :: Color green :: Color yellow :: Color blue :: Color magenta :: Color cyan :: Color white :: Color def :: Color black :: Color -- | A two-dimensional array of (Char,Attr) pairs. data Image Image :: (Int -> Ptr Int -> IO ()) -> !Int -> !Int -> Image -- | Access the width of an Image. imgWidth :: Image -> Int -- | Access the height of an Image. imgHeight :: Image -> Int -- | The empty image. empty :: Image -- | Compose two images side by side. The images must of the same height, -- or one must be empty. (<|>) :: Image -> Image -> Image -- | Compose two images vertically. The images must of the same width, or -- one must be empty. (<->) :: Image -> Image -> Image -- | Helper - fill a buffer segment with a char/attr. fillSeg :: Attr -> Char -> Ptr Int -> Ptr Int -> IO () -- | Compose any number of images horizontally. horzcat :: [Image] -> Image -- | Compose any number of images vertically. vertcat :: [Image] -> Image -- | Create an Image from a ByteString with a single uniform -- Attr. renderBS :: Attr -> ByteString -> Image -- | Create a 1x1 image. Warning, this is likely to be inefficient. renderChar :: Attr -> Char -> Image -- | Create an image by repeating a single character and attribute -- horizontally. renderHFill :: Attr -> Char -> Int -> Image -- | Create an image by repeating a single character and attribute. renderFill :: Attr -> Char -> Int -> Int -> Image -- | The type of images to be displayed using update. You probably -- shouldn't create this directly if you care about compatibility with -- future versions of vty; instead use pic and record update -- syntax. data Picture Pic :: Cursor -> Image -> Picture -- | The position and visibility status of the virtual cursor. pCursor :: Picture -> Cursor -- | A 2d array of (character,attribute) pairs, representing the screen -- image. pImage :: Picture -> Image -- | Create a Picture object with all default values. By using this -- and record update, rather than directly using the Pic constructor, -- your code will be compatible with additions to the Picture object. You -- must specify at least pImage. pic :: Picture -- | Representations of non-modifier keys. data Key KEsc :: Key KFun :: Int -> Key KBackTab :: Key KPrtScr :: Key KPause :: Key KASCII :: Char -> Key KBS :: Key KIns :: Key KHome :: Key KPageUp :: Key KDel :: Key KEnd :: Key KPageDown :: Key KNP5 :: Key KUp :: Key KMenu :: Key KLeft :: Key KDown :: Key KRight :: Key KEnter :: Key -- | Modifier keys. Key codes are interpreted such that users are more -- likely to have Meta than Alt; for instance on the PC Linux console, -- MMeta will generally correspond to the physical Alt key. data Modifier MShift :: Modifier MCtrl :: Modifier MMeta :: Modifier MAlt :: Modifier -- | Mouse buttons. Not yet used. data Button BLeft :: Button BMiddle :: Button BRight :: Button -- | Generic events. data Event EvKey :: Key -> [Modifier] -> Event EvMouse :: Int -> Int -> Button -> [Modifier] -> Event EvResize :: Int -> Int -> Event