-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A binding to the X on-screen display -- -- A binding to the X on-screen display -- -- xosd is a library for displaying an on-screen display (like the one on -- many TVs) on your X display. @package xosd @version 0.2 -- | Tested with: GHC 6.10 -- -- Bindings to xosd, the X on-screen display library xosd is a library -- for displaying an on-screen display (like the one on many TVs) on your -- X display. -- -- An example using the lowest level C layer: -- --
--   do x <- create 1
--      setFont x "-adobe-helvetica-bold-r-*-*-34-*-*-*-*-*-*-*"
--      setColor x "LimeGreen"
--      display x 0 (String "Screen 1")
--   
-- -- runXOSD [Timeout 10, VAlign VAlignMiddle, HAlign HAlignCenter, Font -- -adobe-helvetica-bold-r-*-*-34-*-*-*-*-*-*-*, Color -- LimeGreen, Display (String TEST)] (x -> sequence_ [ -- display x 0 (String (show i)) >> Control.Concurrent.threadDelay -- (10^4) | i <- [1..] ]) module Graphics.XOSD.Base -- | An abstract X on-screen display object -- -- An xosd window can be used to display textual or numerical data on a -- X11 display in a unmanaged, shaped window that appears to be -- transparent. It provides a similar effect to the on-screen display of -- many televisions and video recorders type XOSD = Ptr XOSD_ -- | Valid screen positions (vertical alignment) data VAlign VAlignTop :: VAlign VAlignMiddle :: VAlign VAlignBottom :: VAlign -- | Valid screen positions (vertical alignment) data HAlign HAlignLeft :: HAlign HAlignCenter :: HAlign HAlignRight :: HAlign -- | The type of possible display formats data Format Percent :: {-# UNPACK #-} !Int -> Format Slider :: {-# UNPACK #-} !Int -> Format String :: String -> Format -- | Create a new xosd window. The argument is the maximum number of lines -- of text that the window can display. Throw an exception on failure. create :: Int -> IO XOSD -- | xosd_uninit destroys an existing xosd window, freeing the memory. This -- is an unsafe function: as destroying an xosd object twice will likely -- cause bad things to happen, so don't do that. destroy :: XOSD -> IO () -- | Throw an error (encapsulated in Either) with the current String in -- xosd_error xosdEitherIf :: (a -> Bool) -> IO a -> IO (Either String a) -- | Throw an error with the current String in xosd_error if -- predicate is True when applied to result of action. xosdErrorIf :: (a -> Bool) -> IO a -> IO a -- | Throw an error with the current String in xosd_error -- unconditionally xosdError :: IO a -- | Set length of percentage and slider bar setBarLength :: XOSD -> Int -> IO () setVAlign :: XOSD -> VAlign -> IO () setHAlign :: XOSD -> HAlign -> IO () -- | Change the offset of the text shadow setShadowOffset :: XOSD -> Int -> IO () -- | Change the colour of the shadow setShadowColor :: XOSD -> String -> IO () -- | Change the offset of the text outline- The outline is drawn over the -- shadow. setOutlineOffset :: XOSD -> Int -> IO () -- | Change the colour of the outline setOutlineColor :: XOSD -> String -> IO () -- | Change the number of pixels the display is offset from the position setHorizontalOffset :: XOSD -> Int -> IO () -- | Change the number of pixels the display is offset from the position setVerticalOffset :: XOSD -> Int -> IO () -- | Change the time before display is hidden. setTimeout :: XOSD -> Int -> IO () -- | Change the colour of the display setColor :: XOSD -> String -> IO () -- | Change the text-display font setFont :: XOSD -> String -> IO () -- | Display some content. display :: XOSD -> Int -> Format -> IO () -- | Hide the display setHidden :: XOSD -> IO () -- | Show the display after being hidden setVisible :: XOSD -> IO () -- | Scroll the display scroll :: XOSD -> Int -> IO () isOnScreen :: XOSD -> IO Bool -- | Get the maximum number of lines allowed getNumberOfLines :: XOSD -> IO Int -- | Wait until nothing is displayed. Blocks the process until no longer -- visible. wait :: XOSD -> IO () -- | Translate abstract to concrete formatting types toXOSDVAlign :: VAlign -> XOSD_VAlign -- | Translate abstract to concrete formatting types toXOSDHAlign :: HAlign -> XOSD_HAlign -- | Translate abstract to concrete formatting types toXOSDFormat :: Format -> XOSD_Format xosd_create :: CInt -> IO XOSD xosd_error :: IO CString xosd_destroy :: XOSD -> IO CInt xosd_set_bar_length :: XOSD -> CInt -> IO CInt xosd_is_onscreen :: XOSD -> IO CInt xosd_wait_until_no_display :: XOSD -> IO CInt xosd_hide :: XOSD -> IO CInt xosd_show :: XOSD -> IO CInt xosd_set_pos :: XOSD -> CInt -> IO CInt xosd_set_align :: XOSD -> CInt -> IO CInt xosd_set_shadow_offset :: XOSD -> CInt -> IO CInt xosd_set_outline_offset :: XOSD -> CInt -> IO CInt xosd_set_outline_colour :: XOSD -> CString -> IO CInt xosd_set_shadow_colour :: XOSD -> CString -> IO CInt xosd_set_horizontal_offset :: XOSD -> CInt -> IO CInt xosd_set_vertical_offset :: XOSD -> CInt -> IO CInt xosd_set_timeout :: XOSD -> CInt -> IO CInt xosd_set_colour :: XOSD -> CString -> IO CInt xosd_set_font :: XOSD -> CString -> IO CInt xosd_get_colour :: XOSD -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt xosd_get_number_lines :: XOSD -> IO CInt xosd_scroll :: XOSD -> CInt -> IO CInt xosd_display_string :: XOSD -> CInt -> XOSD_Format -> CString -> IO CInt xosd_display_percent :: XOSD -> CInt -> XOSD_Format -> CInt -> IO CInt xosd_display_slider :: XOSD -> CInt -> XOSD_Format -> CInt -> IO CInt instance Read HAlign instance Show HAlign instance Eq HAlign instance Ord HAlign instance Read VAlign instance Show VAlign instance Eq VAlign instance Ord VAlign instance Eq Format instance Show Format instance Read Format module Graphics.XOSD -- | An abstract X on-screen display object -- -- An xosd window can be used to display textual or numerical data on a -- X11 display in a unmanaged, shaped window that appears to be -- transparent. It provides a similar effect to the on-screen display of -- many televisions and video recorders type XOSD = Ptr XOSD_ -- | Attributes that can be set on an XOSD object data Attribute Lines :: !Int -> Attribute BarLength :: !Int -> Attribute VAlign :: !VAlign -> Attribute HAlign :: !HAlign -> Attribute VOffset :: !Int -> Attribute HOffset :: !Int -> Attribute ShadowOffset :: !Int -> Attribute OutlineOffset :: !Int -> Attribute OutlineColor :: String -> Attribute ShadowColor :: String -> Attribute Color :: String -> Attribute Font :: String -> Attribute Timeout :: !Int -> Attribute Hidden :: Attribute Visible :: Attribute Scroll :: !Int -> Attribute Display :: !Format -> Attribute -- | The type of possible display formats data Format Percent :: {-# UNPACK #-} !Int -> Format Slider :: {-# UNPACK #-} !Int -> Format String :: String -> Format -- | Valid screen positions (vertical alignment) data VAlign VAlignTop :: VAlign VAlignMiddle :: VAlign VAlignBottom :: VAlign -- | Valid screen positions (vertical alignment) data HAlign HAlignLeft :: HAlign HAlignCenter :: HAlign HAlignRight :: HAlign -- | Run some code with an X on-screen display attached. runXOSD :: [Attribute] -> (XOSD -> IO ()) -> IO () -- | Create a new XOSD object with given attributes. initialize :: [Attribute] -> IO XOSD -- | xosd_uninit destroys an existing xosd window, freeing the memory. This -- is an unsafe function: as destroying an xosd object twice will likely -- cause bad things to happen, so don't do that. destroy :: XOSD -> IO () -- | Set a list of attributes set :: XOSD -> [Attribute] -> IO () -- | Display some content. display :: XOSD -> Int -> Format -> IO () -- | Wait until nothing is displayed. Blocks the process until no longer -- visible. wait :: XOSD -> IO () -- | Scroll the display scroll :: XOSD -> Int -> IO () instance Show Attribute instance Eq Attribute