-- GENERATED by C->Haskell Compiler, version 0.28.1 Switcheroo, 1 April 2016 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.ValueOutput
    (
     -- * Constructor
     valueOutputNew
     -- * Hierarchy
     --
     -- $hierarchy

     -- * Functions
     --
     -- $functions
    )
where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp





import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)
import Foreign.C.Types
import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Utils
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch
import qualified Data.Text as T

valueOutputNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
valueOutputNew' a1 a2 a3 a4 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  valueOutputNew''_ a1' a2' a3' a4' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 28 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

valueOutputNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (T.Text) -> IO ((Ptr ()))
valueOutputNewWithLabel' a1 a2 a3 a4 a5 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = unsafeToCString a5} in 
  valueOutputNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 29 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

valueOutputNew :: Rectangle -> Maybe T.Text -> IO (Ref ValueOutput)
valueOutputNew rectangle l'=
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case l' of
        Nothing -> valueOutputNew' x_pos y_pos width height >>=
                             toRef
        Just l -> valueOutputNewWithLabel' x_pos y_pos width height l >>=
                               toRef

valueOutputDestroy' :: (Ptr ()) -> IO ((()))
valueOutputDestroy' a1 =
  let {a1' = id a1} in 
  valueOutputDestroy''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 39 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ IO ()) => Op (Destroy ()) ValueOutput orig impl where
  runOp _ _ win = swapRef win $ \winPtr -> do
    valueOutputDestroy' winPtr
    return nullPtr

valueOutputHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
valueOutputHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  valueOutputHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 45 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) ValueOutput orig impl where
  runOp _ _ valueOutput event = withRef valueOutput (\p -> valueOutputHandle' p (fromIntegral . fromEnum $ event)) >>= return  . successOrUnknownEvent
soft' :: (Ptr ()) -> IO ((Bool))
soft' a1 =
  let {a1' = id a1} in 
  soft''_ a1' >>= \res ->
  let {res' = cToBool res} in
  return (res')

{-# LINE 48 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ ( IO (Bool))) => Op (GetSoft ()) ValueOutput orig impl where
  runOp _ _ value_input = withRef value_input $ \value_inputPtr -> soft' value_inputPtr
resize' :: (Ptr ()) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ()
resize' a1 a2 a3 a4 a5 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  resize''_ a1' a2' a3' a4' a5' >>
  return ()

{-# LINE 51 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ (Rectangle ->  IO ())) => Op (Resize ()) ValueOutput orig impl where
  runOp _ _ value_input rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withRef value_input $ \value_inputPtr -> resize' value_inputPtr x_pos' y_pos' width' height'
setSoft' :: (Ptr ()) -> (Bool) -> IO ()
setSoft' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromBool a2} in 
  setSoft''_ a1' a2' >>
  return ()

{-# LINE 54 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ (Bool->  IO ())) => Op (SetSoft ()) ValueOutput orig impl where
  runOp _ _ value_input s = withRef value_input $ \value_inputPtr -> setSoft' value_inputPtr s
textfont' :: (Ptr ()) -> IO ((Font))
textfont' a1 =
  let {a1' = id a1} in 
  textfont''_ a1' >>= \res ->
  let {res' = cToFont res} in
  return (res')

{-# LINE 57 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ ( IO (Font))) => Op (GetTextfont ()) ValueOutput orig impl where
  runOp _ _ value_input = withRef value_input $ \value_inputPtr -> textfont' value_inputPtr
setTextfont' :: (Ptr ()) -> (Int) -> IO ()
setTextfont' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  setTextfont''_ a1' a2' >>
  return ()

{-# LINE 60 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ (Font ->  IO ())) => Op (SetTextfont ()) ValueOutput orig impl where
  runOp _ _ value_input (Font v) = withRef value_input $ \value_inputPtr -> setTextfont' value_inputPtr v
textsize' :: (Ptr ()) -> IO ((CInt))
textsize' a1 =
  let {a1' = id a1} in 
  textsize''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 63 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ ( IO (FontSize))) => Op (GetTextsize ()) ValueOutput orig impl where
  runOp _ _ value_input = withRef value_input $ \value_inputPtr -> textsize' value_inputPtr >>= return . FontSize
setTextsize' :: (Ptr ()) -> (CInt) -> IO ()
setTextsize' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  setTextsize''_ a1' a2' >>
  return ()

{-# LINE 66 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ (FontSize ->  IO ())) => Op (SetTextsize ()) ValueOutput orig impl where
  runOp _ _ value_input (FontSize v) = withRef value_input $ \value_inputPtr -> setTextsize' value_inputPtr v
textcolor' :: (Ptr ()) -> IO ((Color))
textcolor' a1 =
  let {a1' = id a1} in 
  textcolor''_ a1' >>= \res ->
  let {res' = cToColor res} in
  return (res')

{-# LINE 69 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ ( IO (Color))) => Op (GetTextcolor ()) ValueOutput orig impl where
  runOp _ _ value_input = withRef value_input $ \value_inputPtr -> textcolor' value_inputPtr
setTextcolor' :: (Ptr ()) -> (CInt) -> IO ()
setTextcolor' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  setTextcolor''_ a1' a2' >>
  return ()

{-# LINE 72 "src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs" #-}

instance (impl ~ (Color ->  IO ())) => Op (SetTextcolor ()) ValueOutput orig impl where
  runOp _ _ value_input (Color v) = withRef value_input $ \value_inputPtr -> setTextcolor' value_inputPtr (fromIntegral v)

-- $functions
-- @
-- destroy :: 'Ref' 'ValueOutput' -> 'IO' ()
--
-- getSoft :: 'Ref' 'ValueOutput' -> 'IO' ('Bool')
--
-- getTextcolor :: 'Ref' 'ValueOutput' -> 'IO' ('Color')
--
-- getTextfont :: 'Ref' 'ValueOutput' -> 'IO' ('Font')
--
-- getTextsize :: 'Ref' 'ValueOutput' -> 'IO' ('FontSize')
--
-- handle :: 'Ref' 'ValueOutput' -> ('Event' -> 'IO' ('Either' 'UnknownEvent' ()))
--
-- resize :: 'Ref' 'ValueOutput' -> 'Rectangle' -> 'IO' ()
--
-- setSoft :: 'Ref' 'ValueOutput' -> 'Bool'>- 'IO' ()
--
-- setTextcolor :: 'Ref' 'ValueOutput' -> 'Color' -> 'IO' ()
--
-- setTextfont :: 'Ref' 'ValueOutput' -> 'Font' -> 'IO' ()
--
-- setTextsize :: 'Ref' 'ValueOutput' -> 'FontSize' -> 'IO' ()
-- @

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Valuator"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.ValueOutput"
-- @

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_New"
  valueOutputNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_New_WithLabel"
  valueOutputNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_Destroy"
  valueOutputDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_handle"
  valueOutputHandle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_soft"
  soft''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CChar))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_resize"
  resize''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_set_soft"
  setSoft''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CChar -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_textfont"
  textfont''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_set_textfont"
  setTextfont''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_textsize"
  textsize''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_set_textsize"
  setTextsize''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_textcolor"
  textcolor''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueOutput.chs.h Fl_Value_Output_set_textcolor"
  setTextcolor''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))