-- 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/Base/SysMenuBar.chs" #-}
{-# LANGUAGE CPP, EmptyDataDecls, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.Base.SysMenuBar
    (
     sysMenuBarNew,
     sysMenuBarCustom
  , drawSysMenuBarBase
  , handleSysMenuBarBase
  , resizeSysMenuBarBase
  , hideSysMenuBarBase
  , showWidgetSysMenuBarBase
     -- * 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.Base.Widget
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 qualified Data.Text as T
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Base.MenuItem
import Graphics.UI.FLTK.LowLevel.Base.MenuPrim

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 36 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.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 37 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

sysMenuBarCustom ::
       Rectangle                         -- ^ The bounds of this SysMenuBar
    -> Maybe T.Text                      -- ^ The SysMenuBar label
    -> Maybe (Ref SysMenuBar -> IO ())           -- ^ Optional custom drawing function
    -> Maybe (CustomWidgetFuncs SysMenuBar)      -- ^ Optional custom widget functions
    -> IO (Ref SysMenuBar)
sysMenuBarCustom rectangle l' draw' funcs' =
  widgetMaker
    rectangle
    l'
    draw'
    funcs'
    overriddenWidgetNew'
    overriddenWidgetNewWithLabel'
sysMenuBarNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
sysMenuBarNew' :: Int -> Int -> Int -> Int -> IO (Ptr ())
sysMenuBarNew' a1 :: Int
a1 a2 :: Int
a2 a3 :: Int
a3 a4 :: Int
a4 =
  let {a1' :: CInt
a1' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a1} in 
  let {a2' :: CInt
a2' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2} in 
  let {a3' :: CInt
a3' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a3} in 
  let {a4' :: CInt
a4' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a4} in 
  CInt -> CInt -> CInt -> CInt -> IO (Ptr ())
sysMenuBarNew''_ CInt
a1' CInt
a2' CInt
a3' CInt
a4' IO (Ptr ()) -> (Ptr () -> IO (Ptr ())) -> IO (Ptr ())
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: Ptr ()
res ->
  let {res' :: Ptr ()
res' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
res} in
  Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr ()
res')

{-# LINE 52 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

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

{-# LINE 53 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

sysMenuBarNew :: Rectangle -> Maybe T.Text -> IO (Ref SysMenuBar)
sysMenuBarNew rectangle l'=
  widgetMaker
    rectangle
    l'
    Nothing
    Nothing
    overriddenWidgetNew'
    overriddenWidgetNewWithLabel'
sysMenuBarDestroy' :: (Ptr ()) -> IO ((()))
sysMenuBarDestroy' a1 =
  let {a1' = id a1} in 
  sysMenuBarDestroy''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 63 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ ( IO ())) => Op (Destroy ()) SysMenuBarBase orig impl where
  runOp _ _ win = swapRef win $ \winPtr -> do
    sysMenuBarDestroy' winPtr
    return nullPtr
remove' :: (Ptr ()) -> (Int) -> IO ()
remove' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  remove''_ a1' a2' >>
  return ()

{-# LINE 68 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (Int  ->  IO ())) => Op (Remove ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> remove' menu_Ptr index'
replace' :: (Ptr ()) -> (Int) -> (CString) -> IO ()
replace' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  (flip ($)) a3 $ \a3' -> 
  replace''_ a1' a2' a3' >>
  return ()

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

instance (impl ~ (AtIndex -> T.Text ->  IO ())) => Op (Replace ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ (AtIndex index') name = withRef menu_ $ \menu_Ptr -> copyTextToCString name >>= replace' menu_Ptr index'
clear' :: (Ptr ()) -> IO ()
clear' a1 =
  let {a1' = id a1} in 
  clear''_ a1' >>
  return ()

{-# LINE 74 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ ( IO ())) => Op (Clear ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> clear' menu_Ptr
clearSubmenu' :: (Ptr ()) -> (Int) -> IO ((Int))
clearSubmenu' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  clearSubmenu''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 77 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (AtIndex ->  IO (Either OutOfRangeOrNotSubmenu ()))) => Op (ClearSubmenu ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ (AtIndex index') = withRef menu_ $ \menu_Ptr -> clearSubmenu' menu_Ptr index' >>= return . successOrOutOfRangeOrNotSubmenu
shortcut' :: (Ptr ()) -> (Int) -> (CInt) -> IO ()
shortcut' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = id a3} in 
  shortcut''_ a1' a2' a3' >>
  return ()

{-# LINE 80 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (AtIndex -> ShortcutKeySequence ->  IO ())) => Op (SetShortcut ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ (AtIndex index') (ShortcutKeySequence modifiers char) =
    withRef menu_ $ \menu_Ptr ->
        shortcut' menu_Ptr index' (keySequenceToCInt modifiers char)
setMode' :: (Ptr ()) -> (Int) -> (Int) -> IO ()
setMode' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  setMode''_ a1' a2' a3' >>
  return ()

{-# LINE 85 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (AtIndex -> MenuItemFlags ->  IO ())) => Op (SetMode ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ (AtIndex i) fl = withRef menu_ $ \menu_Ptr -> setMode' menu_Ptr i (menuItemFlagsToInt fl)
mode' :: (Ptr ()) -> (Int) -> IO ((Int))
mode' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  mode''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 88 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (AtIndex ->  IO (Maybe MenuItemFlags))) => Op (GetMode ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ (AtIndex i) = withRef menu_ $ \menu_Ptr -> mode' menu_Ptr i >>= return . intToMenuItemFlags
global' :: (Ptr ()) -> IO ()
global' a1 =
  let {a1' = id a1} in 
  global''_ a1' >>
  return ()

{-# LINE 91 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ ( IO ())) => Op (Global ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> global' menu_Ptr
menuWithM' :: (Ptr ()) -> (Ptr ( Ptr () )) -> (Int) -> IO ()
menuWithM' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  let {a3' = fromIntegral a3} in 
  menuWithM''_ a1' a2' a3' >>
  return ()

{-# LINE 94 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ ([Ref MenuItem] -> IO ())) => Op (SetMenu ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ items =
    withRef menu_ $ \menu_Ptr ->
        withRefs items $ \menu_itemsPtr ->
            menuWithM' menu_Ptr menu_itemsPtr (length items)

add' :: (Ptr ()) -> (CString) -> IO ()
add' :: Ptr () -> CString -> IO ()
add' a1 :: Ptr ()
a1 a2 :: CString
a2 =
  let {a1' = id a1} in 
  (((CString -> IO ()) -> CString -> IO ())
-> CString -> (CString -> IO ()) -> IO ()
forall a b c. (a -> b -> c) -> b -> a -> c
flip (CString -> IO ()) -> CString -> IO ()
forall a b. (a -> b) -> a -> b
($)) CString
a2 ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \a2' :: CString
a2' -> 
  Ptr () -> CString -> IO CInt
add''_ Ptr ()
a1' CString
a2' IO CInt -> IO () -> IO ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

instance (impl ~ (T.Text -> IO ())) => Op (AddName ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ name' = withRef menu_ $ \menu_Ptr -> copyTextToCString name' >>= add' menu_Ptr

addWithFlags' :: (Ptr ()) -> (CString) -> (CInt) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
addWithFlags' :: Ptr ()
-> CString
-> CInt
-> FunPtr CallbackWithUserDataPrim
-> Int
-> IO Int
addWithFlags' a1 :: Ptr ()
a1 a2 :: CString
a2 a3 :: CInt
a3 a4 :: FunPtr CallbackWithUserDataPrim
a4 a5 :: Int
a5 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  (flip (CString -> IO Int) -> CString -> IO Int
forall a b. (a -> b) -> a -> b
($)) CString
a2 ((CString -> IO Int) -> IO Int) -> (CString -> IO Int) -> IO Int
forall a b. (a -> b) -> a -> b
$ \a2' -> 
  let {a3' = id a3} in 
  let {a4' :: FunPtr CallbackWithUserDataPrim
a4' = FunPtr CallbackWithUserDataPrim -> FunPtr CallbackWithUserDataPrim
forall a. a -> a
id FunPtr CallbackWithUserDataPrim
a4} in 
  let {a5' :: CInt
a5' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a5} in 
  Ptr ()
-> CString
-> CInt
-> FunPtr CallbackWithUserDataPrim
-> CInt
-> IO CInt
addWithFlags''_ Ptr ()
a1' CString
a2' CInt
a3' FunPtr CallbackWithUserDataPrim
a4' CInt
a5' IO CInt -> (CInt -> IO Int) -> IO Int
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CInt
res ->
  let {res' :: Int
res' = CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
res} in
  Int -> IO Int
forall (m :: * -> *) a. Monad m => a -> m a
return (Int
res')

{-# LINE 105 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

addWithShortcutnameFlags' :: (Ptr ()) -> (CString) -> (CString) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
addWithShortcutnameFlags' a1 a2 a3 a4 a5 =
  let {a1' = id a1} in 
  (flip ($)) a2 $ \a2' -> 
  (flip ($)) a3 $ \a3' -> 
  let {a4' = id a4} in 
  let {a5' = fromIntegral a5} in 
  addWithShortcutnameFlags''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

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

instance (Parent a MenuItemBase, impl ~ ( T.Text -> Maybe Shortcut -> Maybe (Ref a-> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Add ()) SysMenuBarBase orig (impl) where
  runOp _ _ menu_ name shortcut cb flags =
    addMenuItem (Left (safeCast menu_)) name shortcut cb flags addWithFlags' addWithShortcutnameFlags'

insertWithFlags' :: (Ptr ()) -> (Int) -> (CString) -> (CInt) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
insertWithFlags' a1 a2 a3 a4 a5 a6 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  (flip ($)) a3 $ \a3' -> 
  let {a4' = id a4} in 
  let {a5' = id a5} in 
  let {a6' = fromIntegral a6} in 
  insertWithFlags''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 111 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

insertWithShortcutnameFlags' :: (Ptr ()) -> (Int) -> (CString) -> (CString) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
insertWithShortcutnameFlags' a1 a2 a3 a4 a5 a6 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  (flip ($)) a3 $ \a3' -> 
  (flip ($)) a4 $ \a4' -> 
  let {a5' = id a5} in 
  let {a6' = fromIntegral a6} in 
  insertWithShortcutnameFlags''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 112 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (Parent a MenuPrimBase, impl ~ ( AtIndex -> T.Text -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Insert ()) SysMenuBarBase orig impl where
  runOp _ _ menu_ (AtIndex index') name shortcut cb flags = insertMenuItem (safeCast menu_) index' name shortcut cb flags insertWithFlags' insertWithShortcutnameFlags'

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

{-# LINE 116 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

drawSysMenuBarBase ::  Ref SysMenuBarBase -> IO ()
drawSysMenuBarBase sysMenuBar = withRef sysMenuBar $ \sysMenuBarPtr -> drawSuper' sysMenuBarPtr
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 119 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

handleSysMenuBarBase :: Ref SysMenuBarBase -> Event ->  IO (Either UnknownEvent ())
handleSysMenuBarBase sysMenuBar event = withRef sysMenuBar $ \sysMenuBarPtr -> handleSuper' sysMenuBarPtr (fromIntegral (fromEnum event)) >>= return . successOrUnknownEvent
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 122 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

resizeSysMenuBarBase :: Ref SysMenuBarBase -> Rectangle -> IO ()
resizeSysMenuBarBase sysMenuBar rectangle =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in withRef sysMenuBar $ \sysMenuBarPtr -> resizeSuper' sysMenuBarPtr x_pos y_pos width height
hideSuper' :: (Ptr ()) -> IO ((()))
hideSuper' a1 =
  let {a1' = id a1} in 
  hideSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 127 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

hideSysMenuBarBase ::  Ref SysMenuBarBase -> IO ()
hideSysMenuBarBase sysMenuBar = withRef sysMenuBar $ \sysMenuBarPtr -> hideSuper' sysMenuBarPtr
showSuper' :: (Ptr ()) -> IO ((()))
showSuper' a1 =
  let {a1' = id a1} in 
  showSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 130 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

showWidgetSysMenuBarBase ::  Ref SysMenuBarBase -> IO ()
showWidgetSysMenuBarBase sysMenuBar = withRef sysMenuBar $ \sysMenuBarPtr -> showSuper' sysMenuBarPtr


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

{-# LINE 135 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (  IO ())) => Op (Draw ()) SysMenuBarBase orig impl where
  runOp _ _ sysMenuBar = withRef sysMenuBar $ \sysMenuBarPtr -> draw'' sysMenuBarPtr
sysMenuBarHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
sysMenuBarHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  sysMenuBarHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 138 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

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

instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) SysMenuBarBase orig impl where
  runOp _ _ sysMenuBar rectangle = withRef sysMenuBar $ \sysMenuBarPtr -> do
                                 let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle
                                 resize' sysMenuBarPtr x_pos y_pos w_pos h_pos
hide' :: (Ptr ()) -> IO ()
hide' a1 =
  let {a1' = id a1} in 
  hide''_ a1' >>
  return ()

{-# LINE 146 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (  IO ())) => Op (Hide ()) SysMenuBarBase orig impl where
  runOp _ _ sysMenuBar = withRef sysMenuBar $ \sysMenuBarPtr -> hide' sysMenuBarPtr
show' :: (Ptr ()) -> IO ()
show' a1 =
  let {a1' = id a1} in 
  show''_ a1' >>
  return ()

{-# LINE 149 "src/Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs" #-}

instance (impl ~ (  IO ())) => Op (ShowWidget ()) SysMenuBarBase orig impl where
  runOp _ _ sysMenuBar = withRef sysMenuBar $ \sysMenuBarPtr -> show' sysMenuBarPtr

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Base.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Base.MenuPrim"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Base.MenuBar"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Base.SysMenuBar"
-- @

-- $functions
-- @
-- add:: ('Parent' a 'MenuItemBase') => 'Ref' 'SysMenuBarBase' -> 'T.Text' -> 'Maybe' 'Shortcut' -> 'Maybe' ('Ref' a-> 'IO' ()) -> 'MenuItemFlags' -> 'IO' ('AtIndex')
--
-- addName :: 'Ref' 'SysMenuBarBase' -> 'T.Text' -> 'IO' ()
--
-- clear :: 'Ref' 'SysMenuBarBase' -> 'IO' ()
--
-- clearSubmenu :: 'Ref' 'SysMenuBarBase' -> 'AtIndex' -> 'IO' ('Either' 'OutOfRangeOrNotSubmenu' ())
--
-- destroy :: 'Ref' 'SysMenuBarBase' -> 'IO' ()
--
-- draw :: 'Ref' 'SysMenuBarBase' -> 'IO' ()
--
-- getMode :: 'Ref' 'SysMenuBarBase' -> 'AtIndex' -> 'IO' ('Maybe' 'MenuItemFlags')
--
-- global :: 'Ref' 'SysMenuBarBase' -> 'IO' ()
--
-- handle :: 'Ref' 'SysMenuBarBase' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'SysMenuBarBase' -> 'IO' ()
--
-- insert:: ('Parent' a 'MenuPrimBase') => 'Ref' 'SysMenuBarBase' -> 'AtIndex' -> 'T.Text' -> 'Maybe' 'Shortcut' -> ('Ref' a -> 'IO' ()) -> 'MenuItemFlags' -> 'IO' ('AtIndex')
--
-- remove :: 'Ref' 'SysMenuBarBase' -> 'Int' -> 'IO' ()
--
-- replace :: 'Ref' 'SysMenuBarBase' -> 'AtIndex' -> 'T.Text' -> 'IO' ()
--
-- resize :: 'Ref' 'SysMenuBarBase' -> 'Rectangle' -> 'IO' ()
--
-- setMenu :: 'Ref' 'SysMenuBarBase' -> ['Ref' 'MenuItem'] -> 'IO' ()
--
-- setMode :: 'Ref' 'SysMenuBarBase' -> 'AtIndex' -> 'MenuItemFlags' -> 'IO' ()
--
-- setShortcut :: 'Ref' 'SysMenuBarBase' -> 'AtIndex' -> 'ShortcutKeySequence' -> 'IO' ()
--
-- showWidget :: 'Ref' 'SysMenuBarBase' -> 'IO' ()
-- @

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_New"
  sysMenuBarNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_New_WithLabel"
  sysMenuBarNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_Destroy"
  sysMenuBarDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_remove"
  remove''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_replace"
  replace''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO ()))))

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_clear_submenu"
  clearSubmenu''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_shortcut"
  shortcut''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_set_mode"
  setMode''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_mode"
  mode''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_global"
  global''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_menu_with_m"
  menuWithM''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (C2HSImp.CInt -> (IO ()))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_add_with_name"
  add''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_add_with_flags"
  addWithFlags''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> ((C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO ())))) -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_add_with_shortcutname_flags"
  addWithShortcutnameFlags''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO ())))) -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_insert_with_flags"
  insertWithFlags''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> ((C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO ())))) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_insert_with_shortcutname_flags"
  insertWithShortcutnameFlags''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO ())))) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))))))

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

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

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

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/SysMenuBar.chs.h Fl_Sys_Menu_Bar_handle"
  sysMenuBarHandle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

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

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

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