-- GENERATED by C->Haskell Compiler, version 0.27.1 Eternal Sunshine, 29 November 2015 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/Adjuster.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.Adjuster
    (
     -- * Constructor
     adjusterNew,
     -- * 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_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')

{-# LINE 26 "src/Graphics/UI/FLTK/LowLevel/Adjuster.chs" #-}

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')

{-# LINE 27 "src/Graphics/UI/FLTK/LowLevel/Adjuster.chs" #-}

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')

{-# LINE 37 "src/Graphics/UI/FLTK/LowLevel/Adjuster.chs" #-}

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')

{-# LINE 43 "src/Graphics/UI/FLTK/LowLevel/Adjuster.chs" #-}

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 ()

{-# LINE 47 "src/Graphics/UI/FLTK/LowLevel/Adjuster.chs" #-}

instance (impl ~ (Int ->  IO ())) => Op (SetSoft ()) Adjuster orig impl where
  runOp _ _ adjuster soft = withRef adjuster $ \adjusterPtr -> setSoft' adjusterPtr soft

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


-- $functions
-- @
-- destroy :: 'Ref' 'Adjuster' -> 'IO' ()
--
-- getSoft :: 'Ref' 'Adjuster' -> 'IO' 'Int'
--
-- setSoft :: 'Ref' 'Adjuster' -> 'Int' -> 'IO' ()
-- @

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 ())))