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

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

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

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

{-# LINE 30 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

valueSliderCustom ::
       Rectangle                         -- ^ The bounds of this ValueSlider
    -> Maybe T.Text                      -- ^ The ValueSlider label
    -> Maybe (Ref ValueSlider -> IO ())           -- ^ Optional custom drawing function
    -> Maybe (CustomWidgetFuncs ValueSlider)      -- ^ Optional custom widget functions
    -> IO (Ref ValueSlider)
valueSliderCustom rectangle l' draw' funcs' =
  widgetMaker
    rectangle
    l'
    draw'
    funcs'
    overriddenWidgetNew'
    overriddenWidgetNewWithLabel'


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

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

valueSliderNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (T.Text) -> 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')

{-# LINE 48 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

valueSliderNew :: Rectangle -> Maybe T.Text -> 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

-- {# fun Fl_Hor_Value_Slider_New as horValueSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}
-- {# fun Fl_Hor_Value_Slider_New_WithLabel as horValueSliderNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}
-- horValueSliderNew :: Rectangle -> Maybe String -> IO (HorValueSlider ())
-- horValueSliderNew rectangle l'=
--     let (x_pos, y_pos, width, height) = fromRectangle rectangle
--     in case l' of
--         Nothing -> horValueSliderNew' x_pos y_pos width height >>= toRef
--         Just l -> horValueSliderNewWithLabel' 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')

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

instance (impl ~ (IO ())) => Op (Destroy ()) ValueSlider orig impl where
  runOp _ _ win = swapRef win $ \winPtr -> do
    valueSliderDestroy' winPtr
    return nullPtr
textfont' :: (Ptr ()) -> IO ((Font))
textfont' a1 =
  let {a1' = id a1} in 
  textfont''_ a1' >>= \res ->
  let {res' = cToFont res} in
  return (res')

{-# LINE 70 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

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

{-# LINE 73 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

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

{-# LINE 76 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

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

{-# LINE 79 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

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

{-# LINE 82 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

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

{-# LINE 85 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (Color ->  IO ())) => Op (SetTextcolor ()) ValueSlider orig impl where
  runOp _ _ value_slider s = withRef value_slider $ \value_sliderPtr -> setTextcolor' value_sliderPtr s
draw'' :: (Ptr ()) -> IO ()
draw'' a1 =
  let {a1' = id a1} in 
  draw'''_ a1' >>
  return ()

{-# LINE 88 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (  IO ())) => Op (Draw ()) ValueSlider orig impl where
  runOp _ _ valueSlider = withRef valueSlider $ \valueSliderPtr -> draw'' valueSliderPtr
drawSuper' :: (Ptr ()) -> IO ((()))
drawSuper' a1 =
  let {a1' = id a1} in 
  drawSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 91 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ ( IO ())) => Op (DrawSuper ()) ValueSlider orig impl where
  runOp _ _ valueSlider = withRef valueSlider $ \valueSliderPtr -> drawSuper' valueSliderPtr
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')

{-# LINE 94 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) ValueSlider orig impl where
  runOp _ _ valueSlider event = withRef valueSlider (\p -> valueSliderHandle' p (fromIntegral . fromEnum $ event)) >>= return  . successOrUnknownEvent
handleSuper' :: (Ptr ()) -> (Int) -> IO ((Int))
handleSuper' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  handleSuper''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 97 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (Event ->  IO (Either UnknownEvent ()))) => Op (HandleSuper ()) ValueSlider orig impl where
  runOp _ _ valueSlider event = withRef valueSlider $ \valueSliderPtr -> handleSuper' valueSliderPtr (fromIntegral (fromEnum event)) >>= return . successOrUnknownEvent
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' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 100 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) ValueSlider orig impl where
  runOp _ _ valueSlider rectangle = withRef valueSlider $ \valueSliderPtr -> do
                                 let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle
                                 resize' valueSliderPtr x_pos y_pos w_pos h_pos
resizeSuper' :: (Ptr ()) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ((()))
resizeSuper' 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 
  resizeSuper''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 105 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (ResizeSuper ()) ValueSlider orig impl where
  runOp _ _ valueSlider rectangle =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in withRef valueSlider $ \valueSliderPtr -> resizeSuper' valueSliderPtr x_pos y_pos width height
hide' :: (Ptr ()) -> IO ()
hide' a1 =
  let {a1' = id a1} in 
  hide''_ a1' >>
  return ()

{-# LINE 110 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (  IO ())) => Op (Hide ()) ValueSlider orig impl where
  runOp _ _ valueSlider = withRef valueSlider $ \valueSliderPtr -> hide' valueSliderPtr
hideSuper' :: (Ptr ()) -> IO ((()))
hideSuper' a1 =
  let {a1' = id a1} in 
  hideSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 113 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ ( IO ())) => Op (HideSuper ()) ValueSlider orig impl where
  runOp _ _ valueSlider = withRef valueSlider $ \valueSliderPtr -> hideSuper' valueSliderPtr
show' :: (Ptr ()) -> IO ()
show' a1 =
  let {a1' = id a1} in 
  show''_ a1' >>
  return ()

{-# LINE 116 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ (  IO ())) => Op (ShowWidget ()) ValueSlider orig impl where
  runOp _ _ valueSlider = withRef valueSlider $ \valueSliderPtr -> show' valueSliderPtr
showSuper' :: (Ptr ()) -> IO ((()))
showSuper' a1 =
  let {a1' = id a1} in 
  showSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 119 "src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs" #-}

instance (impl ~ ( IO ())) => Op (ShowWidgetSuper ()) ValueSlider orig impl where
  runOp _ _ valueSlider = withRef valueSlider $ \valueSliderPtr -> showSuper' valueSliderPtr

-- $functions
-- @
-- destroy :: 'Ref' 'ValueSlider' -> 'IO' ()
--
-- draw :: 'Ref' 'ValueSlider' -> 'IO' ()
--
-- drawSuper :: 'Ref' 'ValueSlider' -> 'IO' ()
--
-- getTextcolor :: 'Ref' 'ValueSlider' -> 'IO' ('Color')
--
-- getTextfont :: 'Ref' 'ValueSlider' -> 'IO' ('Font')
--
-- getTextsize :: 'Ref' 'ValueSlider' -> 'IO' ('FontSize')
--
-- handle :: 'Ref' 'ValueSlider' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- handleSuper :: 'Ref' 'ValueSlider' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'ValueSlider' -> 'IO' ()
--
-- hideSuper :: 'Ref' 'ValueSlider' -> 'IO' ()
--
-- resize :: 'Ref' 'ValueSlider' -> 'Rectangle' -> 'IO' ()
--
-- resizeSuper :: 'Ref' 'ValueSlider' -> 'Rectangle' -> 'IO' ()
--
-- setTextcolor :: 'Ref' 'ValueSlider' -> 'Color' -> 'IO' ()
--
-- setTextfont :: 'Ref' 'ValueSlider' -> 'Font' -> 'IO' ()
--
-- setTextsize :: 'Ref' 'ValueSlider' -> 'FontSize' -> 'IO' ()
--
-- showWidget :: 'Ref' 'ValueSlider' -> 'IO' ()
--
-- showWidgetSuper :: 'Ref' 'ValueSlider' -> 'IO' ()
-- @

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

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_draw"
  draw'''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_draw_super"
  drawSuper''_ :: ((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_handle_super"
  handleSuper''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_hide"
  hide''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_hide_super"
  hideSuper''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_show"
  show''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/ValueSlider.chs.h Fl_Value_Slider_show_super"
  showSuper''_ :: ((C2HSImp.Ptr ()) -> (IO ()))