module Graphics.UI.FLTK.LowLevel.Box
    (
     
     boxNew,
     boxNewWithBoxtype,
     boxCustom,
     boxCustomWithBoxtype
     
     
     
     
     
     
    )
where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)
import Foreign.C.Types
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.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch
import Graphics.UI.FLTK.LowLevel.Widget
boxNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
boxNew' a1 a2 a3 a4 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  boxNew''_ a1' a2' a3' a4' >>= \res ->
  let {res' = id res} in
  return (res')
boxNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (String) -> IO ((Ptr ()))
boxNewWithLabel' 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 
  boxNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')
overriddenBoxNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (String) -> (Ptr ()) -> IO ((Ptr ()))
overriddenBoxNewWithLabel' 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 
  overriddenBoxNewWithLabel''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = id res} in
  return (res')
overriddenBoxNew' :: (Int) -> (Int) -> (Int) -> (Int) -> (Ptr ()) -> IO ((Ptr ()))
overriddenBoxNew' 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 
  overriddenBoxNew''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')
boxNewWithBoxtype' :: (Boxtype) -> (Int) -> (Int) -> (Int) -> (Int) -> (String) -> IO ((Ptr ()))
boxNewWithBoxtype' a1 a2 a3 a4 a5 a6 =
  let {a1' = cFromEnum a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = unsafeToCString a6} in 
  boxNewWithBoxtype''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = id res} in
  return (res')
overriddenBoxNewWithBoxtype' :: (Boxtype) -> (Int) -> (Int) -> (Int) -> (Int) -> (String) -> (Ptr ()) -> IO ((Ptr ()))
overriddenBoxNewWithBoxtype' a1 a2 a3 a4 a5 a6 a7 =
  let {a1' = cFromEnum a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = unsafeToCString a6} in 
  let {a7' = id a7} in 
  overriddenBoxNewWithBoxtype''_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = id res} in
  return (res')
boxCustom :: Rectangle                     
          -> Maybe String                  
          -> Maybe (Ref Box -> IO ())      
          -> Maybe (CustomWidgetFuncs Box) 
          -> IO (Ref Box)
boxCustom rectangle l' draw' funcs' =
  widgetMaker
    rectangle
    l'
    draw'
    funcs'
    boxNew'
    boxNewWithLabel'
    overriddenBoxNew'
    overriddenBoxNewWithLabel'
boxCustomWithBoxtype :: Boxtype -> Rectangle -> String -> Maybe (Ref Box -> IO ()) -> Maybe (CustomWidgetFuncs Box) -> IO (Ref Box)
boxCustomWithBoxtype boxtype' rectangle' l' draw' funcs' =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle'
    in case funcs' of
        Just fs -> do
          ptr <- customWidgetFunctionStruct draw' fs
          overriddenBoxNewWithBoxtype' boxtype' x_pos y_pos width height l' (castPtr ptr) >>= toRef
        Nothing ->
          boxNewWithBoxtype' boxtype' x_pos y_pos width height l' >>= toRef
boxNew :: Rectangle -> Maybe String -> IO (Ref Box)
boxNew rectangle l' =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case l' of
        Nothing -> boxNew' x_pos y_pos width height >>=
                             toRef
        Just l -> boxNewWithLabel' x_pos y_pos width height l >>=
                             toRef
boxNewWithBoxtype :: Boxtype -> Rectangle -> String -> IO (Ref Box)
boxNewWithBoxtype boxtype' rectangle' l' =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle'
    in
    boxNewWithBoxtype' boxtype' x_pos y_pos width height l' >>=
                             toRef
boxHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
boxHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  boxHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')
instance (impl ~ (Event -> IO Int)) => Op (Handle ()) Box orig impl where
  runOp _ _ box event = withRef box (\p -> boxHandle' p (fromIntegral . fromEnum $ event))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Box.chs.h Fl_Box_New"
  boxNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Box.chs.h Fl_Box_New_WithLabel"
  boxNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Box.chs.h Fl_OverriddenBox_New_WithLabel"
  overriddenBoxNewWithLabel''_ :: (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/Box.chs.h Fl_OverriddenBox_New"
  overriddenBoxNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Box.chs.h Fl_Box_New_WithBoxtype"
  boxNewWithBoxtype''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ()))))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Box.chs.h Fl_OverriddenBox_New_WithBoxtype"
  overriddenBoxNewWithBoxtype''_ :: (C2HSImp.CInt -> (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/Box.chs.h Fl_Box_handle"
  boxHandle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))