-- 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/Dial.chs" #-}
{-# LANGUAGE CPP, RankNTypes, UndecidableInstances, GADTs, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.Dial
    (
     -- * Hierarchy
     --
     -- $hierarchy

     -- * Widget 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.Fl_Enumerations
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Utils
import Graphics.UI.FLTK.LowLevel.Dispatch
import Graphics.UI.FLTK.LowLevel.Hierarchy

resize' :: (Ptr ()) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ((()))
resize' :: Ptr () -> Int -> Int -> Int -> Int -> IO ()
resize' a1 :: Ptr ()
a1 a2 :: Int
a2 a3 :: Int
a3 a4 :: Int
a4 a5 :: Int
a5 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  let {a2' :: CInt
a2' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2} in 
  let {a3' :: CInt
a3' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a3} in 
  let {a4' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a4} in 
  let {a5' = fromIntegral a5} in 
  Ptr () -> CInt -> CInt -> CInt -> CInt -> IO ()
resize''_ Ptr ()
a1' CInt
a2' CInt
a3' CInt
a4' CInt
a5' IO () -> (() -> IO ()) -> IO ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: ()
res ->
  let {res' :: ()
res' = () -> ()
forall a. a -> ()
supressWarningAboutRes ()
res} in
  () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return (()
res')

{-# LINE 24 "src/Graphics/UI/FLTK/LowLevel/Dial.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) Dial orig impl where
  runOp _ _ dial rectangle = withRef dial $ \dialPtr -> do
                                 let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle
                                 resize' dialPtr x_pos y_pos w_pos h_pos
hide' :: (Ptr ()) -> IO ()
hide' a1 =
  let {a1' = id a1} in 
  hide''_ a1' >>
  return ()

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

instance (impl ~ (  IO ())) => Op (Hide ()) Dial orig impl where
  runOp _ _ dial = withRef dial $ \dialPtr -> hide' dialPtr
show' :: (Ptr ()) -> IO ()
show' a1 =
  let {a1' = id a1} in 
  show''_ a1' >>
  return ()

{-# LINE 32 "src/Graphics/UI/FLTK/LowLevel/Dial.chs" #-}

instance (impl ~ (  IO ())) => Op (ShowWidget ()) Dial orig impl where
  runOp _ _ dial = withRef dial $ \dialPtr -> show' dialPtr
dialHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
dialHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  dialHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 35 "src/Graphics/UI/FLTK/LowLevel/Dial.chs" #-}

instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) Dial orig impl where
  runOp _ _ dial event = withRef dial (\p -> dialHandle' p (fromIntegral . fromEnum $ event)) >>= return  . successOrUnknownEvent
draw'' :: (Ptr ()) -> IO ()
draw'' a1 =
  let {a1' = id a1} in 
  draw'''_ a1' >>
  return ()

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

instance (impl ~ (  IO ())) => Op (Draw ()) Dial orig impl where
  runOp _ _ dial = withRef dial $ \dialPtr -> draw'' dialPtr

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

-- $functions
-- @
-- draw :: 'Ref' 'Dial' -> 'IO' ()
--
-- handle :: 'Ref' 'Dial' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'Dial' -> 'IO' ()
--
-- resize :: 'Ref' 'Dial' -> 'Rectangle' -> 'IO' ()
--
-- showWidget :: 'Ref' 'Dial' -> 'IO' ()
-- @

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

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

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

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

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