-- 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/Wizard.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables, UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.Wizard
    (
     wizardNew,
     wizardCustom
     -- * 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.Fl_Enumerations
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
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 27 "src/Graphics/UI/FLTK/LowLevel/Wizard.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 28 "src/Graphics/UI/FLTK/LowLevel/Wizard.chs" #-}

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


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

{-# LINE 45 "src/Graphics/UI/FLTK/LowLevel/Wizard.chs" #-}

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

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

wizardNew :: Rectangle -> Maybe T.Text -> IO (Ref Wizard)
wizardNew rectangle label' =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case label' of
        (Just l') -> wizardNewWithLabel' x_pos y_pos width height l' >>= toRef
        Nothing -> wizardNew' x_pos y_pos width height >>= toRef

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

{-# LINE 54 "src/Graphics/UI/FLTK/LowLevel/Wizard.chs" #-}

instance (impl ~ (IO ())) => Op (Destroy ()) Wizard orig impl where
  runOp _ _ wizard = swapRef wizard $ \wizardPtr -> do
    wizardDestroy' wizardPtr
    return nullPtr
wizardNext' :: (Ptr ()) -> IO ()
wizardNext' a1 =
  let {a1' = id a1} in 
  wizardNext''_ a1' >>
  return ()

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

instance (impl ~ (IO ())) => Op (Next ()) Wizard orig impl where
  runOp _ _ wizard = withRef wizard $ \wizardPtr -> wizardNext' wizardPtr
wizardPrev' :: (Ptr ()) -> IO ()
wizardPrev' a1 =
  let {a1' = id a1} in 
  wizardPrev''_ a1' >>
  return ()

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

instance (impl ~ (IO ())) => Op (Prev ()) Wizard orig impl where
  runOp _ _ wizard = withRef wizard $ \wizardPtr -> wizardPrev' wizardPtr
wizardSetValue' :: (Ptr ()) -> (Ptr ()) -> IO ()
wizardSetValue' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  wizardSetValue''_ a1' a2' >>
  return ()

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

instance (Parent a Widget, impl ~ ( Maybe ( Ref a ) -> IO ())) => Op (SetValue ()) Wizard orig impl where
  runOp _ _ wizard widget =
    withRef wizard $ \wizardPtr ->
      withMaybeRef widget $ \widgetPtr ->
        wizardSetValue' wizardPtr widgetPtr
wizardValue' :: (Ptr ()) -> IO ((Ptr ()))
wizardValue' a1 =
  let {a1' = id a1} in 
  wizardValue''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

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

instance (impl ~ (IO (Maybe (Ref Widget)))) => Op (GetValue ()) Wizard orig impl where
  runOp _ _ wizard =
    withRef wizard $ \wizardPtr -> wizardValue' wizardPtr >>= toMaybeRef
draw'' :: (Ptr ()) -> IO ()
draw'' a1 =
  let {a1' = id a1} in 
  draw'''_ a1' >>
  return ()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

instance (impl ~ ( IO ())) => Op (ShowWidgetSuper ()) Wizard orig impl where
  runOp _ _ wizard = withRef wizard $ \wizardPtr -> showSuper' wizardPtr

-- $functions
-- @
--
-- destroy :: 'Ref' 'Wizard' -> 'IO' ()
--
-- draw :: 'Ref' 'Wizard' -> 'IO' ()
--
-- drawSuper :: 'Ref' 'Wizard' -> 'IO' ()
--
-- getValue :: 'Ref' 'Wizard' -> 'IO' ('Maybe' ('Ref' 'Widget'))
--
-- handle :: 'Ref' 'Wizard' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- handleSuper :: 'Ref' 'Wizard' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'Wizard' -> 'IO' ()
--
-- hideSuper :: 'Ref' 'Wizard' -> 'IO' ()
--
-- next :: 'Ref' 'Wizard' -> 'IO' ()
--
-- prev :: 'Ref' 'Wizard' -> 'IO' ()
--
-- resize :: 'Ref' 'Wizard' -> 'Rectangle' -> 'IO' ()
--
-- resizeSuper :: 'Ref' 'Wizard' -> 'Rectangle' -> 'IO' ()
--
-- setValue:: ('Parent' a 'Widget') => 'Ref' 'Wizard' -> 'Maybe' ( 'Ref' a ) -> 'IO' ()
--
-- showWidget :: 'Ref' 'Wizard' -> 'IO' ()
--
-- showWidgetSuper :: 'Ref' 'Wizard' -> 'IO' ()
-- @

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

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Wizard.chs.h Fl_Wizard_Destroy"
  wizardDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Wizard.chs.h Fl_Wizard_next"
  wizardNext''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Wizard.chs.h Fl_Wizard_prev"
  wizardPrev''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Wizard.chs.h Fl_Wizard_set_value"
  wizardSetValue''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Wizard.chs.h Fl_Wizard_value"
  wizardValue''_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))

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

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

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

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

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

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

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

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

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

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