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

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

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

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

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

positionerNew :: Rectangle -> Maybe String -> IO (Ref Positioner)
positionerNew rectangle l'=
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case l' of
        Nothing -> positionerNew' x_pos y_pos width height >>=
                             toRef
        Just l -> positionerNewWithLabel' x_pos y_pos width height l >>=
                               toRef

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

{-# LINE 38 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

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

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

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

instance (impl ~ (Event -> IO Int)) => Op (Handle ()) Positioner orig impl where
  runOp _ _ positioner event = withRef positioner (\p -> positionerHandle' p (fromIntegral . fromEnum $ event))
setXvalue' :: (Ptr ()) -> (Double) -> IO ()
setXvalue' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  setXvalue''_ a1' a2' >>
  return ()

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

instance (impl ~ (Double ->  IO ())) => Op (SetXvalue ()) Positioner orig impl where
  runOp _ _ positioner xvalue = withRef positioner $ \positionerPtr -> setXvalue' positionerPtr xvalue
xvalue' :: (Ptr ()) -> IO ((Double))
xvalue' a1 =
  let {a1' = id a1} in 
  xvalue''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 50 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ ( IO (Double))) => Op (GetXvalue ()) Positioner orig impl where
  runOp _ _ positioner = withRef positioner $ \positionerPtr -> xvalue' positionerPtr
setYvalue' :: (Ptr ()) -> (Double) -> IO ()
setYvalue' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  setYvalue''_ a1' a2' >>
  return ()

{-# LINE 53 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double ->  IO ())) => Op (SetYvalue ()) Positioner orig impl where
  runOp _ _ positioner yvalue = withRef positioner $ \positionerPtr -> setYvalue' positionerPtr yvalue
yvalue' :: (Ptr ()) -> IO ((Double))
yvalue' a1 =
  let {a1' = id a1} in 
  yvalue''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

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

instance (impl ~ ( IO (Double))) => Op (GetYvalue ()) Positioner orig impl where
  runOp _ _ positioner = withRef positioner $ \positionerPtr -> yvalue' positionerPtr
setXminimum' :: (Ptr ()) -> (Double) -> IO ()
setXminimum' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  setXminimum''_ a1' a2' >>
  return ()

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

instance (impl ~ (Double ->  IO ())) => Op (SetXminimum ()) Positioner orig impl where
  runOp _ _ positioner xminimum = withRef positioner $ \positionerPtr -> setXminimum' positionerPtr xminimum
xminimum' :: (Ptr ()) -> IO ((Double))
xminimum' a1 =
  let {a1' = id a1} in 
  xminimum''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 62 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ ( IO (Double))) => Op (GetXminimum ()) Positioner orig impl where
  runOp _ _ positioner = withRef positioner $ \positionerPtr -> xminimum' positionerPtr
setYminimum' :: (Ptr ()) -> (Double) -> IO ()
setYminimum' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  setYminimum''_ a1' a2' >>
  return ()

{-# LINE 65 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double ->  IO ())) => Op (SetYminimum ()) Positioner orig impl where
  runOp _ _ positioner yminimum = withRef positioner $ \positionerPtr -> setYminimum' positionerPtr yminimum
yminimum' :: (Ptr ()) -> IO ((Double))
yminimum' a1 =
  let {a1' = id a1} in 
  yminimum''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 68 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ ( IO (Double))) => Op (GetYminimum ()) Positioner orig impl where
  runOp _ _ positioner = withRef positioner $ \positionerPtr -> yminimum' positionerPtr
setXmaximum' :: (Ptr ()) -> (Double) -> IO ()
setXmaximum' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  setXmaximum''_ a1' a2' >>
  return ()

{-# LINE 71 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double ->  IO ())) => Op (SetXmaximum ()) Positioner orig impl where
  runOp _ _ positioner xmaximum = withRef positioner $ \positionerPtr -> setXmaximum' positionerPtr xmaximum
xmaximum' :: (Ptr ()) -> IO ((Double))
xmaximum' a1 =
  let {a1' = id a1} in 
  xmaximum''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 74 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ ( IO (Double))) => Op (GetXmaximum ()) Positioner orig impl where
  runOp _ _ positioner = withRef positioner $ \positionerPtr -> xmaximum' positionerPtr
setYmaximum' :: (Ptr ()) -> (Double) -> IO ()
setYmaximum' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  setYmaximum''_ a1' a2' >>
  return ()

{-# LINE 77 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double ->  IO ())) => Op (SetYmaximum ()) Positioner orig impl where
  runOp _ _ positioner ymaximum = withRef positioner $ \positionerPtr -> setYmaximum' positionerPtr ymaximum
ymaximum' :: (Ptr ()) -> IO ((Double))
ymaximum' a1 =
  let {a1' = id a1} in 
  ymaximum''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 80 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ ( IO (Double))) => Op (GetYmaximum ()) Positioner orig impl where
  runOp _ _ positioner = withRef positioner $ \positionerPtr -> ymaximum' positionerPtr
xbounds' :: (Ptr ()) -> (Double) -> (Double) -> IO ()
xbounds' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  xbounds''_ a1' a2' a3' >>
  return ()

{-# LINE 83 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double -> Double ->  IO ())) => Op (SetXbounds ()) Positioner orig impl where
  runOp _ _ positioner xstart xend = withRef positioner $ \positionerPtr -> xbounds' positionerPtr xstart xend
ybounds' :: (Ptr ()) -> (Double) -> (Double) -> IO ()
ybounds' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  ybounds''_ a1' a2' a3' >>
  return ()

{-# LINE 86 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double -> Double ->  IO ())) => Op (SetYbounds ()) Positioner orig impl where
  runOp _ _ positioner ystart yend = withRef positioner $ \positionerPtr -> ybounds' positionerPtr ystart yend
xstep' :: (Ptr ()) -> (Double) -> IO ()
xstep' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  xstep''_ a1' a2' >>
  return ()

{-# LINE 89 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double ->  IO ())) => Op (SetXstep ()) Positioner orig impl where
  runOp _ _ positioner xstep = withRef positioner $ \positionerPtr -> xstep' positionerPtr xstep
ystep' :: (Ptr ()) -> (Double) -> IO ()
ystep' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  ystep''_ a1' a2' >>
  return ()

{-# LINE 92 "src/Graphics/UI/FLTK/LowLevel/Positioner.chs" #-}

instance (impl ~ (Double ->  IO ())) => Op (SetYstep ()) Positioner orig impl where
  runOp _ _ positioner ystep = withRef positioner $ \positionerPtr -> ystep' positionerPtr ystep

-- $functions
-- @
--
-- destroy :: 'Ref' 'Positioner' -> 'IO' ()
--
-- getXmaximum :: 'Ref' 'Positioner' -> 'IO' 'Double'
--
-- getXminimum :: 'Ref' 'Positioner' -> 'IO' 'Double'
--
-- getXvalue :: 'Ref' 'Positioner' -> 'IO' 'Double'
--
-- getYmaximum :: 'Ref' 'Positioner' -> 'IO' 'Double'
--
-- getYminimum :: 'Ref' 'Positioner' -> 'IO' 'Double'
--
-- getYvalue :: 'Ref' 'Positioner' -> 'IO' 'Double'
--
-- handle :: 'Ref' 'Positioner' -> 'Event' -> 'IO' 'Int'
--
-- setXbounds :: 'Ref' 'Positioner' -> 'Double' -> 'Double' -> 'IO' ()
--
-- setXmaximum :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setXminimum :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setXstep :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setXvalue :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setYbounds :: 'Ref' 'Positioner' -> 'Double' -> 'Double' -> 'IO' ()
--
-- setYmaximum :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setYminimum :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setYstep :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
--
-- setYvalue :: 'Ref' 'Positioner' -> 'Double' -> 'IO' ()
-- @

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Positioner"
-- @
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_New"
  positionerNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_Destroy"
  positionerDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_set_xvalue"
  setXvalue''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_xvalue"
  xvalue''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_set_yvalue"
  setYvalue''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_yvalue"
  yvalue''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_set_xminimum"
  setXminimum''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_xminimum"
  xminimum''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_set_yminimum"
  setYminimum''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_yminimum"
  yminimum''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_set_xmaximum"
  setXmaximum''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_xmaximum"
  xmaximum''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_set_ymaximum"
  setYmaximum''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_ymaximum"
  ymaximum''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_xbounds"
  xbounds''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO ()))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_ybounds"
  ybounds''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO ()))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_xstep"
  xstep''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Positioner.chs.h Fl_Positioner_ystep"
  ystep''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (IO ())))