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


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

draw' :: (Ptr ()) -> IO ()
draw' a1 =
  let {a1' = id a1} in
  draw''_ a1' >>
  return ()

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

instance (impl ~ (  IO ())) => Op (Draw ()) Table orig impl where
  runOp _ _ table = withRef table $ \tablePtr -> draw' tablePtr
handle' :: (Ptr ()) -> (Event) -> IO ((Int))
handle' a1 a2 =
  let {a1' = id a1} in
  let {a2' = cFromEnum a2} in
  handle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 27 "src/Graphics/UI/FLTK/LowLevel/Table.chs" #-}

instance (impl ~ ( Event ->  IO( Either UnknownEvent ()))) => Op (Handle ()) Table orig impl where
  runOp _ _ table event = withRef table $ \tablePtr -> handle' tablePtr 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' >>
  return ()

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

instance (impl ~ ( Rectangle ->  IO ())) => Op (Resize ()) Table orig impl where
  runOp _ _ table rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withRef table $ \tablePtr -> resize' tablePtr x_pos' y_pos' width' height'
clear' :: (Ptr ()) -> IO ()
clear' a1 =
  let {a1' = id a1} in
  clear''_ a1' >>
  return ()

{-# LINE 33 "src/Graphics/UI/FLTK/LowLevel/Table.chs" #-}

instance (impl ~ (  IO ())) => Op (Clear ()) Table orig impl where
  runOp _ _ table = withRef table $ \tablePtr -> clear' tablePtr
show' :: (Ptr ()) -> IO ((()))
show' a1 =
  let {a1' = id a1} in
  show''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 36 "src/Graphics/UI/FLTK/LowLevel/Table.chs" #-}

instance (impl ~ ( IO ())) => Op (ShowWidget ()) Table orig impl where
  runOp _ _ widget = withRef widget $ \widgetPtr -> show' widgetPtr
hide' :: (Ptr ()) -> IO ((()))
hide' a1 =
  let {a1' = id a1} in
  hide''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 39 "src/Graphics/UI/FLTK/LowLevel/Table.chs" #-}

instance (impl ~ ( IO ())) => Op (Hide ()) Table orig impl where
  runOp _ _ widget = withRef widget $ \widgetPtr -> hide' widgetPtr
setRows' :: (Ptr ()) -> (Int) -> IO ()
setRows' a1 a2 =
  let {a1' = id a1} in
  let {a2' = fromIntegral a2} in
  setRows''_ a1' a2' >>
  return ()

{-# LINE 42 "src/Graphics/UI/FLTK/LowLevel/Table.chs" #-}

instance (impl ~ ( Rows ->  IO ())) => Op (SetRows ()) Table orig impl where
  runOp _ _ table (Rows val) = withRef table $ \tablePtr -> setRows' tablePtr val
setCols' :: (Ptr ()) -> (Int) -> IO ()
setCols' a1 a2 =
  let {a1' = id a1} in
  let {a2' = fromIntegral a2} in
  setCols''_ a1' a2' >>
  return ()

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

instance (impl ~ ( Columns ->  IO ())) => Op (SetCols ()) Table orig impl where
  runOp _ _ table (Columns val) = withRef table $ \tablePtr -> setCols' tablePtr val

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

-- $functions
-- @
-- clear :: 'Ref' 'Table' -> 'IO' ()
--
-- draw :: 'Ref' 'Table' -> 'IO' ()
--
-- handle :: 'Ref' 'Table' -> 'Event' -> 'IO'( 'Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'Table' -> 'IO' ()
--
-- resize :: 'Ref' 'Table' -> 'Rectangle' -> 'IO' ()
--
-- setCols :: 'Ref' 'Table' -> 'Columns' -> 'IO' ()
--
-- setRows :: 'Ref' 'Table' -> 'Rows' -> 'IO' ()
--
-- showWidget :: 'Ref' 'Table' -> 'IO' ()
-- @

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

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

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

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

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

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

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

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