-- 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/RepeatButton.chs" #-}
{-# LANGUAGE CPP, EmptyDataDecls, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.RepeatButton
    (
    repeatButtonNew,
    repeatButtonCustom
    -- * 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_Types
import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
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.Widget

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 30 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.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 31 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

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


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

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

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

{-# LINE 49 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

repeatButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref RepeatButton)
repeatButtonNew rectangle l' =
  widgetMaker
    rectangle
    l'
    Nothing
    Nothing
    overriddenWidgetNew'
    overriddenWidgetNewWithLabel'

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

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

instance (impl ~ ( IO ())) => Op (Destroy ()) RepeatButton orig impl where
  runOp _ _ button = swapRef button $
                    \buttonPtr ->
                     widgetDestroy' buttonPtr >>
                     return nullPtr

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

{-# LINE 67 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

instance (impl ~ ( IO ())) => Op (Deactivate ()) RepeatButton orig impl where
  runOp _ _ button = withRef button (\p -> deactivate' p )
draw'' :: (Ptr ()) -> IO ()
draw'' a1 =
  let {a1' = id a1} in
  draw'''_ a1' >>
  return ()

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

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

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

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

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

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

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

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

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

{-# LINE 92 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

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

{-# LINE 95 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

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

{-# LINE 98 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

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

{-# LINE 101 "src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs" #-}

instance (impl ~ ( IO ())) => Op (ShowWidgetSuper ()) RepeatButton orig impl where
  runOp _ _ repeatButton = withRef repeatButton $ \repeatButtonPtr -> showSuper' repeatButtonPtr

-- $functions
-- @
-- deactivate :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- destroy :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- draw :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- drawSuper :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- handle :: 'Ref' 'RepeatButton' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- handleSuper :: 'Ref' 'RepeatButton' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- hideSuper :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- resize :: 'Ref' 'RepeatButton' -> 'Rectangle' -> 'IO' ()
--
-- resizeSuper :: 'Ref' 'RepeatButton' -> 'Rectangle' -> 'IO' ()
--
-- showWidget :: 'Ref' 'RepeatButton' -> 'IO' ()
--
-- showWidgetSuper :: 'Ref' 'RepeatButton' -> 'IO' ()
-- @

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Button"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.RepeatButton"
-- @

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/RepeatButton.chs.h Fl_Repeat_Button_Destroy"
  widgetDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/RepeatButton.chs.h Fl_Repeat_Button_deactivate"
  deactivate''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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

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

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

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

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

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

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

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

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

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