-- GENERATED by C->Haskell Compiler, version 0.28.6 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.Scrolled
    (
     -- * Constructor
     scrolledNew,
     scrolledCustom
     -- * 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_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
import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
overriddenWidgetNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (CString) -> (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
  (flip ($)) a5 $ \a5' ->
  let {a6' = id a6} in
  overriddenWidgetNewWithLabel''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 28 "src/Graphics/UI/FLTK/LowLevel/Scrolled.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 29 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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


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

{-# LINE 46 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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

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

scrolledNew :: Rectangle -> Maybe T.Text -> IO (Ref Scrolled)
scrolledNew rectangle l'=
  widgetMaker
    rectangle
    l'
    Nothing
    Nothing
    overriddenWidgetNew'
    overriddenWidgetNewWithLabel'
setScrollbarSize' :: (Ptr ()) -> (Int) -> IO ()
setScrollbarSize' a1 a2 =
  let {a1' = id a1} in
  let {a2' = fromIntegral a2} in
  setScrollbarSize''_ a1' a2' >>
  return ()

{-# LINE 57 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ (Int ->  IO ())) => Op (SetScrollbarSize ()) Scrolled orig impl where
   runOp _ _ widget size = withRef widget $ \widgetPtr -> setScrollbarSize' widgetPtr size
getScrollbarSize' :: (Ptr ()) -> IO ((Int))
getScrollbarSize' a1 =
  let {a1' = id a1} in
  getScrollbarSize''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 60 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO (Int))) => Op (GetScrollbarSize ()) Scrolled orig impl where
   runOp _ _ widget = withRef widget $ \widgetPtr -> getScrollbarSize' widgetPtr
clear' :: (Ptr ()) -> IO ()
clear' a1 =
  let {a1' = id a1} in
  clear''_ a1' >>
  return ()

{-# LINE 63 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO ())) => Op (Clear ()) Scrolled orig impl where
   runOp _ _ widget = withRef widget $ \widgetPtr -> clear' widgetPtr
scrollTo' :: (Ptr ()) -> (Int) -> (Int) -> IO ()
scrollTo' a1 a2 a3 =
  let {a1' = id a1} in
  let {a2' = fromIntegral a2} in
  let {a3' = fromIntegral a3} in
  scrollTo''_ a1' a2' a3' >>
  return ()

{-# LINE 66 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ (Position ->  IO ())) => Op (ScrollTo ()) Scrolled orig impl where
   runOp _ _ widget (Position (X x_pos') (Y y_pos')) = withRef widget $ \widgetPtr -> scrollTo' widgetPtr x_pos' y_pos'
yposition' :: (Ptr ()) -> IO ((Int))
yposition' a1 =
  let {a1' = id a1} in
  yposition''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 69 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO (Int))) => Op (Yposition ()) Scrolled orig impl where
   runOp _ _ widget = withRef widget $ \widgetPtr -> yposition' widgetPtr
xposition' :: (Ptr ()) -> IO ((Int))
xposition' a1 =
  let {a1' = id a1} in
  xposition''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 72 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO (Int))) => Op (Xposition ()) Scrolled orig impl where
   runOp _ _ widget = withRef widget $ \widgetPtr -> xposition' widgetPtr
type' :: (Ptr ()) -> IO ((Word8))
type' a1 =
  let {a1' = id a1} in
  type''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 75 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO (ScrollbarMode))) => Op (GetType_ ()) Scrolled orig impl where
   runOp _ _ widget = withRef widget $ \widgetPtr -> type' widgetPtr >>= return . cToEnum
setType' :: (Ptr ()) -> (Word8) -> IO ()
setType' a1 a2 =
  let {a1' = id a1} in
  let {a2' = fromIntegral a2} in
  setType''_ a1' a2' >>
  return ()

{-# LINE 78 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ (ScrollbarMode ->  IO ())) => Op (SetType ()) Scrolled orig impl where
   runOp _ _ widget t = withRef widget $ \widgetPtr -> setType' widgetPtr (cFromEnum t)
draw'' :: (Ptr ()) -> IO ()
draw'' a1 =
  let {a1' = id a1} in
  draw'''_ a1' >>
  return ()

{-# LINE 81 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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

{-# LINE 84 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO ())) => Op (DrawSuper ()) Scrolled orig impl where
  runOp _ _ scrolled = withRef scrolled $ \scrolledPtr -> drawSuper' scrolledPtr
scrolledHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
scrolledHandle' a1 a2 =
  let {a1' = id a1} in
  let {a2' = id a2} in
  scrolledHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 87 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) Scrolled orig impl where
  runOp _ _ scrolled event = withRef scrolled (\p -> scrolledHandle' 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 90 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ (Event ->  IO (Either UnknownEvent ()))) => Op (HandleSuper ()) Scrolled orig impl where
  runOp _ _ scrolled event = withRef scrolled $ \scrolledPtr -> handleSuper' scrolledPtr (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 93 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) Scrolled orig impl where
  runOp _ _ scrolled rectangle = withRef scrolled $ \scrolledPtr -> do
                                 let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle
                                 resize' scrolledPtr 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 98 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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

{-# LINE 103 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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

{-# LINE 106 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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

{-# LINE 109 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

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

{-# LINE 112 "src/Graphics/UI/FLTK/LowLevel/Scrolled.chs" #-}

instance (impl ~ ( IO ())) => Op (ShowWidgetSuper ()) Scrolled orig impl where
  runOp _ _ scrolled = withRef scrolled $ \scrolledPtr -> showSuper' scrolledPtr

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Group"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Scrolled"
-- @


-- $functions
-- @
-- clear :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- draw :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- drawSuper :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- getScrollbarSize :: 'Ref' 'Scrolled' -> 'IO' ('Int')
--
-- getType_ :: 'Ref' 'Scrolled' -> 'IO' ('ScrollbarMode')
--
-- handle :: 'Ref' 'Scrolled' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- handleSuper :: 'Ref' 'Scrolled' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- hideSuper :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- resize :: 'Ref' 'Scrolled' -> 'Rectangle' -> 'IO' ()
--
-- resizeSuper :: 'Ref' 'Scrolled' -> 'Rectangle' -> 'IO' ()
--
-- scrollTo :: 'Ref' 'Scrolled' -> 'Position' -> 'IO' ()
--
-- setScrollbarSize :: 'Ref' 'Scrolled' -> 'Int' -> 'IO' ()
--
-- setType :: 'Ref' 'Scrolled' -> 'ScrollbarMode' -> 'IO' ()
--
-- showWidget :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- showWidgetSuper :: 'Ref' 'Scrolled' -> 'IO' ()
--
-- xposition :: 'Ref' 'Scrolled' -> 'IO' ('Int')
--
-- yposition :: 'Ref' 'Scrolled' -> 'IO' ('Int')
-- @

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Scrolled.chs.h Fl_OverriddenScroll_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/Scrolled.chs.h Fl_OverriddenScroll_New"
  overriddenWidgetNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))))))

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

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Scrolled.chs.h Fl_Scroll_clear"
  clear''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Scrolled.chs.h Fl_Scroll_type"
  type''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUChar))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Scrolled.chs.h Fl_Scroll_set_type"
  setType''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUChar -> (IO ())))

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Scrolled.chs.h Fl_Scroll_draw_super"
  drawSuper''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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

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

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

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

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

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

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

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