-- 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/ValueInput.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.ValueInput
    (
     -- * Constructor
     valueInputNew
     -- * 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

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

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

valueInputNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (T.Text) -> IO ((Ptr ()))
valueInputNewWithLabel' 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 
  valueInputNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')

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

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

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

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

instance (impl ~ (IO ())) => Op (Destroy ()) ValueInput orig impl where
  runOp _ _ win = swapRef win $ \winPtr -> do
    valueInputDestroy' winPtr
    return nullPtr
valueInputHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
valueInputHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  valueInputHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 44 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) ValueInput orig impl where
  runOp _ _ valueInput event = withRef valueInput (\p -> valueInputHandle' 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 47 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ ( IO (Bool))) => Op (GetSoft ()) ValueInput 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 50 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ (Rectangle ->  IO ())) => Op (Resize ()) ValueInput 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 53 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

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

{-# LINE 56 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ ( IO (Maybe ShortcutKeySequence))) => Op (GetShortcut ()) ValueInput orig impl where
  runOp _ _ value_input = withRef value_input $ \value_inputPtr -> shortcut' value_inputPtr >>= return . cIntToKeySequence
setShortcut' :: (Ptr ()) -> (CInt) -> IO ()
setShortcut' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  setShortcut''_ a1' a2' >>
  return ()

{-# LINE 59 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ (ShortcutKeySequence ->  IO ())) => Op (SetShortcut ()) ValueInput orig impl where
  runOp _ _ input (ShortcutKeySequence modifiers char) =
    withRef input $ \inputPtr -> setShortcut' inputPtr (keySequenceToCInt modifiers char)
textfont' :: (Ptr ()) -> IO ((Font))
textfont' a1 =
  let {a1' = id a1} in 
  textfont''_ a1' >>= \res ->
  let {res' = cToFont res} in
  return (res')

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

instance (impl ~ ( IO (Font))) => Op (GetTextfont ()) ValueInput 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 66 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ (Font ->  IO ())) => Op (SetTextfont ()) ValueInput 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 69 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ ( IO (FontSize))) => Op (GetTextsize ()) ValueInput 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 72 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ (FontSize ->  IO ())) => Op (SetTextsize ()) ValueInput 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 75 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

instance (impl ~ ( IO (Color))) => Op (GetTextcolor ()) ValueInput 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 78 "src/Graphics/UI/FLTK/LowLevel/ValueInput.chs" #-}

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

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

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueInput.chs.h Fl_Value_Input_Destroy"
  valueInputDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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

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

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

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

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

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

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

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

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

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

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

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