-- 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/SimpleCounter.chs" #-}
module Graphics.UI.FLTK.LowLevel.SimpleCounter
    (
     -- * Constructor
     simpleCounterNew
     -- * Hierarchy
     --
     -- $hierarchy
    )
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.Utils
import Graphics.UI.FLTK.LowLevel.Hierarchy
import qualified Data.Text as T
simpleCounterNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
simpleCounterNew' a1 a2 a3 a4 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  simpleCounterNew''_ a1' a2' a3' a4' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 19 "src/Graphics/UI/FLTK/LowLevel/SimpleCounter.chs" #-}

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

{-# LINE 20 "src/Graphics/UI/FLTK/LowLevel/SimpleCounter.chs" #-}

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


-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Valuator"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Counter"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.SimpleCounter"
-- @

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

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