module Graphics.UI.FLTK.LowLevel.ValueSlider
       (
         
         valueSliderNew
         
         
         
         
         
         
       )
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
valueSliderNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
valueSliderNew' a1 a2 a3 a4 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  valueSliderNew''_ a1' a2' a3' a4' >>= \res ->
  let {res' = id res} in
  return (res')
valueSliderNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (String) -> IO ((Ptr ()))
valueSliderNewWithLabel' 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 
  valueSliderNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')
valueSliderNew :: Rectangle -> Maybe String -> IO (Ref ValueSlider)
valueSliderNew rectangle l'=
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case l' of
        Nothing -> valueSliderNew' x_pos y_pos width height >>= toRef
        Just l -> valueSliderNewWithLabel' x_pos y_pos width height l >>= toRef
valueSliderDestroy' :: (Ptr ()) -> IO ((()))
valueSliderDestroy' a1 =
  let {a1' = id a1} in 
  valueSliderDestroy''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')
instance (impl ~ (IO ())) => Op (Destroy ()) ValueSlider orig impl where
  runOp _ _ win = swapRef win $ \winPtr -> do
    valueSliderDestroy' winPtr
    return nullPtr
valueSliderHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
valueSliderHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  valueSliderHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')
instance (impl ~ (Event -> IO Int)) => Op (Handle ()) ValueSlider orig impl where
  runOp _ _ valueSlider event = withRef valueSlider (\p -> valueSliderHandle' p (fromIntegral . fromEnum $ event))
textfont' :: (Ptr ()) -> IO ((Font))
textfont' a1 =
  let {a1' = id a1} in 
  textfont''_ a1' >>= \res ->
  let {res' = cToFont res} in
  return (res')
instance (impl ~ ( IO (Font))) => Op (GetTextfont ()) ValueSlider orig impl where
  runOp _ _ value_slider = withRef value_slider $ \value_sliderPtr -> textfont' value_sliderPtr
setTextfont' :: (Ptr ()) -> (Font) -> IO ()
setTextfont' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromFont a2} in 
  setTextfont''_ a1' a2' >>
  return ()
instance (impl ~ (Font ->  IO ())) => Op (SetTextfont ()) ValueSlider orig impl where
  runOp _ _ value_slider s = withRef value_slider $ \value_sliderPtr -> setTextfont' value_sliderPtr s
textsize' :: (Ptr ()) -> IO ((CInt))
textsize' a1 =
  let {a1' = id a1} in 
  textsize''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')
instance (impl ~ ( IO (FontSize))) => Op (GetTextsize ()) ValueSlider orig impl where
  runOp _ _ value_slider = withRef value_slider $ \value_sliderPtr -> textsize' value_sliderPtr >>= return . FontSize
setTextsize' :: (Ptr ()) -> (CInt) -> IO ()
setTextsize' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  setTextsize''_ a1' a2' >>
  return ()
instance (impl ~ (FontSize ->  IO ())) => Op (SetTextsize ()) ValueSlider orig impl where
  runOp _ _ value_slider (FontSize s) = withRef value_slider $ \value_sliderPtr -> setTextsize' value_sliderPtr s
textcolor' :: (Ptr ()) -> IO ((Color))
textcolor' a1 =
  let {a1' = id a1} in 
  textcolor''_ a1' >>= \res ->
  let {res' = cToColor res} in
  return (res')
instance (impl ~ ( IO (Color))) => Op (GetTextcolor ()) ValueSlider orig impl where
  runOp _ _ value_slider = withRef value_slider $ \value_sliderPtr -> textcolor' value_sliderPtr
setTextcolor' :: (Ptr ()) -> (Color) -> IO ()
setTextcolor' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromColor a2} in 
  setTextcolor''_ a1' a2' >>
  return ()
instance (impl ~ (Color ->  IO ())) => Op (SetTextcolor ()) ValueSlider orig impl where
  runOp _ _ value_slider s = withRef value_slider $ \value_sliderPtr -> setTextcolor' value_sliderPtr s
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_New"
  valueSliderNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_New_WithLabel"
  valueSliderNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_Destroy"
  valueSliderDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_handle"
  valueSliderHandle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_textfont"
  textfont''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_set_textfont"
  setTextfont''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_textsize"
  textsize''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_set_textsize"
  setTextsize''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_textcolor"
  textcolor''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_set_textcolor"
  setTextcolor''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO ())))