module Graphics.UI.FLTK.LowLevel.Adjuster
    (
     
     adjusterNew,
     
     
     
     
     
     
    )
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_Types
import Graphics.UI.FLTK.LowLevel.Utils
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch
adjusterNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
adjusterNew' a1 a2 a3 a4 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  adjusterNew''_ a1' a2' a3' a4' >>= \res ->
  let {res' = id res} in
  return (res')
adjusterNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (String) -> IO ((Ptr ()))
adjusterNewWithLabel' 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 
  adjusterNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')
adjusterNew :: Rectangle -> Maybe String -> IO (Ref Adjuster)
adjusterNew rectangle l'=
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case l' of
        Nothing -> adjusterNew' x_pos y_pos width height >>=
                             toRef
        Just l -> adjusterNewWithLabel' x_pos y_pos width height l >>=
                               toRef
adjusterDestroy' :: (Ptr ()) -> IO ((()))
adjusterDestroy' a1 =
  let {a1' = id a1} in 
  adjusterDestroy''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')
instance (impl ~ (IO ())) => Op (Destroy ()) Adjuster orig impl where
  runOp _ _ adjuster = swapRef adjuster $ \adjusterPtr -> do
    adjusterDestroy' adjusterPtr
    return nullPtr
soft' :: (Ptr ()) -> IO ((Int))
soft' a1 =
  let {a1' = id a1} in 
  soft''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')
instance (impl ~ ( IO (Int))) => Op (GetSoft ()) Adjuster orig impl where
  runOp _ _ adjuster = withRef adjuster $ \adjusterPtr -> soft' adjusterPtr
setSoft' :: (Ptr ()) -> (Int) -> IO ()
setSoft' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  setSoft''_ a1' a2' >>
  return ()
instance (impl ~ (Int ->  IO ())) => Op (SetSoft ()) Adjuster orig impl where
  runOp _ _ adjuster soft = withRef adjuster $ \adjusterPtr -> setSoft' adjusterPtr soft
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Adjuster.chs.h Fl_Adjuster_New"
  adjusterNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Adjuster.chs.h Fl_Adjuster_New_WithLabel"
  adjusterNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Adjuster.chs.h Fl_Adjuster_Destroy"
  adjusterDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Adjuster.chs.h Fl_Adjuster_soft"
  soft''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Adjuster.chs.h Fl_Adjuster_set_soft"
  setSoft''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))