-- GENERATED by C->Haskell Compiler, version 0.18.2 The shapeless maps, 31 Oct 2014 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables, UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.MenuPrim
    (
     menu_New
     -- * Hierarchy
     --
     -- $hierarchy

     -- * Functions
     --
     -- $functions
    )
where




import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)
import Foreign.C.Types
import Graphics.UI.FLTK.LowLevel.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 Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.MenuItem
import qualified Data.ByteString.Char8 as C

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

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

{-# LINE 31 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

overriddenWidgetNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (String) -> (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 
  withCString a5 $ \a5' -> 
  let {a6' = id a6} in 
  overriddenWidgetNewWithLabel''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 32 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.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 33 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

menu_New :: Rectangle -> Maybe String -> Maybe (CustomWidgetFuncs MenuPrim) -> IO (Ref MenuPrim)
menu_New rectangle l' funcs' =
  widgetMaker
    rectangle
    l'
    funcs'
    widgetNew'
    widgetNewWithLabel'
    overriddenWidgetNew'
    overriddenWidgetNewWithLabel'

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

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

instance (impl ~ (IO ())) => Op (Destroy ()) MenuPrim orig impl where
  runOp _ _ menu_ = swapRef menu_ $
                          \menu_Ptr ->
                             widgetDestroy' menu_Ptr >>
                             return nullPtr
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 51 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int ->  IO (Int))) => Op (HandleSuper ()) MenuPrim orig impl where
  runOp _ _ menu_ event = withRef menu_ $ \menu_Ptr -> handleSuper' menu_Ptr event
menu_Handle' :: (Ptr ()) -> (CInt) -> IO ((Int))
menu_Handle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  menu_Handle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 54 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Event -> IO Int)) => Op (Handle ()) MenuPrim orig impl where
  runOp _ _ menu_ event = withRef menu_ (\p -> menu_Handle' p (fromIntegral . fromEnum $ event))
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 57 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (ResizeSuper ()) MenuPrim orig impl where
  runOp _ _ menu_ rectangle =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in withRef menu_ $ \menu_Ptr -> resizeSuper' menu_Ptr x_pos y_pos width height
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 62 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) MenuPrim orig impl where
  runOp _ _ menu_ rectangle = withRef menu_ $ \menu_Ptr -> do
                                 let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle
                                 resize' menu_Ptr x_pos y_pos w_pos h_pos
hideSuper' :: (Ptr ()) -> IO ((()))
hideSuper' a1 =
  let {a1' = id a1} in 
  hideSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

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

instance (impl ~ ( IO ())) => Op (HideSuper ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> hideSuper' menu_Ptr
hide' :: (Ptr ()) -> IO ((()))
hide' a1 =
  let {a1' = id a1} in 
  hide''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

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

instance (impl ~ ( IO ())) => Op (Hide ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> hide' menu_Ptr
showSuper' :: (Ptr ()) -> IO ((()))
showSuper' a1 =
  let {a1' = id a1} in 
  showSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

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

instance (impl ~ ( IO ())) => Op (ShowWidgetSuper ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> showSuper' menu_Ptr
menu_Show' :: (Ptr ()) -> IO ((()))
menu_Show' a1 =
  let {a1' = id a1} in 
  menu_Show''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

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

instance (impl ~ (IO ())) => Op (ShowWidget ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ (\p -> menu_Show' p)

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

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

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

{-# LINE 81 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (Parent a MenuItem, impl ~ (Ref a -> IO (Maybe String))) => Op (ItemPathname ()) MenuPrim orig impl where
  runOp _ _ menu_ menu_item' =
    withRef menu_ $
    \ menu_Ref ->
     allocaBytes oneKb $ \ptr -> do
       retVal' <- withRef menu_item' $ \ menu_item'Ref -> itemPathnameWithFinditem' menu_Ref (castPtr ptr) oneKb menu_item'Ref
       if (retVal' == -1)
         then return Nothing
         else do
           b' <- C.packCString (castPtr ptr)
           return $ Just (C.unpack b')
instance (impl ~ (IO (Maybe String))) => Op (ItemPathnameRecent ()) MenuPrim orig impl where
  runOp _ _ menu_ =
    withRef menu_ $ \menu_Ptr ->
    allocaBytes oneKb $ \pathPtr -> do
      retVal' <- itemPathname' menu_Ptr (castPtr pathPtr) oneKb
      if (retVal' == -1)
        then return Nothing
        else do
          b' <- C.packCString (castPtr pathPtr)
          return $ Just (C.unpack b')

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

{-# LINE 104 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (Parent a MenuItem, Parent b MenuItem, impl ~ (Ref a -> IO (Ref b))) => Op (Picked ()) MenuPrim orig impl where
  runOp _ _ menu_ item = withRef menu_ $ \menu_Ptr -> withRef item $ \itemPtr -> picked' menu_Ptr itemPtr >>= toRef
findIndexWithName' :: (Ptr ()) -> (String) -> IO ((Int))
findIndexWithName' a1 a2 =
  let {a1' = id a1} in 
  withCString a2 $ \a2' -> 
  findIndexWithName''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 107 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

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

{-# LINE 108 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (MenuItemLocator -> IO (Maybe Int))) => Op (FindIndex ()) MenuPrim orig impl where
  runOp _ _ menu_ menu_item_referene =
    withRef menu_ $ \menu_Ptr ->
        case menu_item_referene of
          MenuItemNameLocator (MenuItemName name) -> findIndexWithName' menu_Ptr name >>= \r -> if (r == -1) then (return Nothing) else (return $ Just r)
          MenuItemPointerLocator (MenuItemPointer menu_item) ->
              withRef menu_item $ \menu_itemPtr -> findIndexWithItem' menu_Ptr menu_itemPtr >>= \r -> if (r == -1) then (return Nothing) else (return $ Just r)
testShortcut' :: (Ptr ()) -> IO ((Ptr ()))
testShortcut' a1 =
  let {a1' = id a1} in 
  testShortcut''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

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

instance (Parent a MenuItem, impl ~ ( IO (Ref a))) => Op (TestShortcut ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> testShortcut' menu_Ptr >>= toRef
global' :: (Ptr ()) -> IO ()
global' a1 =
  let {a1' = id a1} in 
  global''_ a1' >>
  return ()

{-# LINE 119 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO ())) => Op (Global ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> global' menu_Ptr
menu' :: (Ptr ()) -> IO ((Ptr ()))
menu' a1 =
  let {a1' = id a1} in 
  menu''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 122 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (Ref MenuItem))) => Op (GetMenu ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> menu' menu_Ptr >>= toRef
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 125 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (Parent a MenuItem, impl ~ ([Ref a] -> IO ())) => Op (SetMenu ()) MenuPrim orig impl where
  runOp _ _ menu_ items =
    withRef menu_ $ \menu_Ptr ->
        withRefs items $ \menu_itemsPtr ->
            menuWithM' menu_Ptr menu_itemsPtr (length items)
copy' :: (Ptr ()) -> (Ptr ()) -> IO ()
copy' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  copy''_ a1' a2' >>
  return ()

{-# LINE 131 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (Parent a MenuItem, impl ~ (Ref a->  IO ())) => Op (Copy ()) MenuPrim orig impl where
  runOp _ _ menu_ m = withRef menu_ $ \menu_Ptr -> withRef m $ \mPtr -> copy' menu_Ptr mPtr

insertWithFlags' :: (Ptr ()) -> (Int) -> (String) -> (CInt) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
insertWithFlags' a1 a2 a3 a4 a5 a6 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  withCString 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 135 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

insertWithShortcutnameFlags' :: (Ptr ()) -> (Int) -> (String) -> (String) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
insertWithShortcutnameFlags' a1 a2 a3 a4 a5 a6 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  withCString a3 $ \a3' -> 
  withCString 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 136 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (Parent a MenuPrim, impl ~ ( Int -> String -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> IO (MenuItemIndex))) => Op (Insert ()) MenuPrim orig impl where
  runOp _ _ menu_ index' name shortcut cb flags =
    withRef menu_ $ \menu_Ptr -> do
      let combinedFlags = menuItemFlagsToInt flags
      ptr <- toCallbackPrim cb
      idx' <- case shortcut of
               Just s' -> case s' of
                 KeySequence (ShortcutKeySequence modifiers char) ->
                   insertWithFlags'
                    menu_Ptr
                    index'
                    name
                    (keySequenceToCInt modifiers char)
                    (castFunPtr ptr)
                    combinedFlags
                 KeyFormat format' ->
                   if (not $ null format') then
                     insertWithShortcutnameFlags'
                       menu_Ptr
                       index'
                       name
                       format'
                       (castFunPtr ptr)
                       combinedFlags
                   else error "Fl_Menu_.menu_insert: shortcut format string cannot be empty"
               Nothing ->
                 insertWithFlags'
                   menu_Ptr
                   index'
                   name
                   0
                   (castFunPtr ptr)
                   combinedFlags
      return (MenuItemIndex idx')
add' :: (Ptr ()) -> (String) -> IO ()
add' a1 a2 =
  let {a1' = id a1} in 
  withCString a2 $ \a2' -> 
  add''_ a1' a2' >>
  return ()

{-# LINE 171 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (String -> IO ())) => Op (AddName ()) MenuPrim orig impl where
  runOp _ _ menu_ name' = withRef menu_ $ \menu_Ptr -> add' menu_Ptr name'
addWithFlags' :: (Ptr ()) -> (String) -> (CInt) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
addWithFlags' a1 a2 a3 a4 a5 =
  let {a1' = id a1} in 
  withCString a2 $ \a2' -> 
  let {a3' = id a3} in 
  let {a4' = id a4} in 
  let {a5' = fromIntegral a5} in 
  addWithFlags''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 174 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

addWithShortcutnameFlags' :: (Ptr ()) -> (String) -> (String) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
addWithShortcutnameFlags' a1 a2 a3 a4 a5 =
  let {a1' = id a1} in 
  withCString a2 $ \a2' -> 
  withCString 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 175 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (Parent a MenuPrim, impl ~ ( String -> Maybe Shortcut -> (Ref a-> IO ()) -> MenuItemFlags -> IO (MenuItemIndex))) => Op (Add ()) MenuPrim orig (impl) where
  runOp _ _ menu_ name shortcut cb flags =
    withRef menu_ $ \menu_Ptr -> do
      let combinedFlags = menuItemFlagsToInt flags
      ptr <- toCallbackPrim cb
      idx' <- case shortcut of
               Just s' -> case s' of
                 KeySequence (ShortcutKeySequence modifiers char) ->
                   addWithFlags'
                    menu_Ptr
                    name
                    (keySequenceToCInt modifiers char)
                    (castFunPtr ptr)
                    combinedFlags
                 KeyFormat format' ->
                   if (not $ null format') then
                     addWithShortcutnameFlags'
                     menu_Ptr
                     name
                     format'
                     (castFunPtr ptr)
                     combinedFlags
                   else error "Fl_Menu_.menu_add: Shortcut format string cannot be empty"
               Nothing ->
                   addWithFlags'
                    menu_Ptr
                    name
                    0
                    (castFunPtr ptr)
                    combinedFlags
      return (MenuItemIndex idx')
size' :: (Ptr ()) -> IO ((Int))
size' a1 =
  let {a1' = id a1} in 
  size''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 207 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

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

{-# LINE 210 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int -> Int ->  IO ())) => Op (SetSize ()) MenuPrim orig impl where
  runOp _ _ menu_ w h = withRef menu_ $ \menu_Ptr -> setSize' menu_Ptr w h
clear' :: (Ptr ()) -> IO ()
clear' a1 =
  let {a1' = id a1} in 
  clear''_ a1' >>
  return ()

{-# LINE 213 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO ())) => Op (Clear ()) MenuPrim 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 216 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int ->  IO (Either OutOfRange ()))) => Op (ClearSubmenu ()) MenuPrim orig impl where
  runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> clearSubmenu' menu_Ptr index' >>= \ret' -> if ret' == -1 then return (Left OutOfRange) else return (Right ())
replace' :: (Ptr ()) -> (Int) -> (String) -> IO ()
replace' a1 a2 a3 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  withCString a3 $ \a3' -> 
  replace''_ a1' a2' a3' >>
  return ()

{-# LINE 219 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int -> String ->  IO ())) => Op (Replace ()) MenuPrim orig impl where
  runOp _ _ menu_ index' name = withRef menu_ $ \menu_Ptr -> replace' menu_Ptr index' name
remove' :: (Ptr ()) -> (Int) -> IO ()
remove' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  remove''_ a1' a2' >>
  return ()

{-# LINE 222 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int  ->  IO ())) => Op (Remove ()) MenuPrim orig impl where
  runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> remove' menu_Ptr index'
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 225 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int -> ShortcutKeySequence ->  IO ())) => Op (SetShortcut ()) MenuPrim orig impl where
  runOp _ _ menu_ 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 230 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int -> Int ->  IO ())) => Op (SetMode ()) MenuPrim orig impl where
  runOp _ _ menu_ i fl = withRef menu_ $ \menu_Ptr -> setMode' menu_Ptr i 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 233 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int ->  IO (Int))) => Op (GetMode ()) MenuPrim orig impl where
  runOp _ _ menu_ i = withRef menu_ $ \menu_Ptr -> mode' menu_Ptr i
mvalue' :: (Ptr ()) -> IO ((Ptr ()))
mvalue' a1 =
  let {a1' = id a1} in 
  mvalue''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 236 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (IO (Ref MenuItem))) => Op (Mvalue ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> mvalue' menu_Ptr >>= toRef
value' :: (Ptr ()) -> IO ((Int))
value' a1 =
  let {a1' = id a1} in 
  value''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 239 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

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

{-# LINE 242 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

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

{-# LINE 243 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (MenuItemReference -> IO (Int))) => Op (SetValue ()) MenuPrim orig impl where
  runOp _ _ menu_ menu_item_reference =
    withRef menu_ $ \menu_Ptr ->
        case menu_item_reference of
          (MenuItemByIndex (MenuItemIndex index')) -> valueWithIndex' menu_Ptr index'
          (MenuItemByPointer (MenuItemPointer menu_item)) ->
              withRef menu_item $ \menu_itemPtr ->
                  valueWithItem' menu_Ptr menu_itemPtr
text' :: (Ptr ()) -> IO ((String))
text' a1 =
  let {a1' = id a1} in 
  text''_ a1' >>= \res ->
  peekCString res >>= \res' ->
  return (res')

{-# LINE 252 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (String))) => Op (GetText ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> text' menu_Ptr
textWithIndex' :: (Ptr ()) -> (Int) -> IO ((String))
textWithIndex' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  textWithIndex''_ a1' a2' >>= \res ->
  peekCString res >>= \res' ->
  return (res')

{-# LINE 255 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int ->  IO (String))) => Op (GetTextWithIndex ()) MenuPrim orig impl where
  runOp _ _ menu_ i = withRef menu_ $ \menu_Ptr -> textWithIndex' menu_Ptr i
textfont' :: (Ptr ()) -> IO ((Font))
textfont' a1 =
  let {a1' = id a1} in 
  textfont''_ a1' >>= \res ->
  let {res' = cToFont res} in
  return (res')

{-# LINE 258 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (Font))) => Op (GetTextfont ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> textfont' menu_Ptr
setTextfont' :: (Ptr ()) -> (Font) -> IO ()
setTextfont' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromFont a2} in 
  setTextfont''_ a1' a2' >>
  return ()

{-# LINE 261 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Font ->  IO ())) => Op (SetTextfont ()) MenuPrim orig impl where
  runOp _ _ menu_ c = withRef menu_ $ \menu_Ptr -> setTextfont' menu_Ptr c
textsize' :: (Ptr ()) -> IO ((CInt))
textsize' a1 =
  let {a1' = id a1} in 
  textsize''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 264 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (FontSize))) => Op (GetTextsize ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> textsize' menu_Ptr >>= return . FontSize
setTextsize' :: (Ptr ()) -> (CInt) -> IO ()
setTextsize' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  setTextsize''_ a1' a2' >>
  return ()

{-# LINE 267 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (FontSize ->  IO ())) => Op (SetTextsize ()) MenuPrim orig impl where
  runOp _ _ menu_ (FontSize c) = withRef menu_ $ \menu_Ptr -> setTextsize' menu_Ptr c
textcolor' :: (Ptr ()) -> IO ((Color))
textcolor' a1 =
  let {a1' = id a1} in 
  textcolor''_ a1' >>= \res ->
  let {res' = cToColor res} in
  return (res')

{-# LINE 270 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (Color))) => Op (GetTextcolor ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> textcolor' menu_Ptr
setTextcolor' :: (Ptr ()) -> (Color) -> IO ()
setTextcolor' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromColor a2} in 
  setTextcolor''_ a1' a2' >>
  return ()

{-# LINE 273 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Color ->  IO ())) => Op (SetTextcolor ()) MenuPrim orig impl where
  runOp _ _ menu_ c = withRef menu_ $ \menu_Ptr -> setTextcolor' menu_Ptr c
downBox' :: (Ptr ()) -> IO ((Boxtype))
downBox' a1 =
  let {a1' = id a1} in 
  downBox''_ a1' >>= \res ->
  let {res' = cToEnum res} in
  return (res')

{-# LINE 276 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (Boxtype))) => Op (GetDownBox ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> downBox' menu_Ptr
setDownBox' :: (Ptr ()) -> (Boxtype) -> IO ()
setDownBox' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromEnum a2} in 
  setDownBox''_ a1' a2' >>
  return ()

{-# LINE 279 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Boxtype ->  IO ())) => Op (SetDownBox ()) MenuPrim orig impl where
  runOp _ _ menu_ b = withRef menu_ $ \menu_Ptr -> setDownBox' menu_Ptr b
downColor' :: (Ptr ()) -> IO ((Color))
downColor' a1 =
  let {a1' = id a1} in 
  downColor''_ a1' >>= \res ->
  let {res' = cToColor res} in
  return (res')

{-# LINE 282 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ ( IO (Color))) => Op (GetDownColor ()) MenuPrim orig impl where
  runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> downColor' menu_Ptr
setDownColor' :: (Ptr ()) -> (Int) -> IO ()
setDownColor' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  setDownColor''_ a1' a2' >>
  return ()

{-# LINE 285 "src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs" #-}

instance (impl ~ (Int ->  IO ())) => Op (SetDownColor ()) MenuPrim orig impl where
  runOp _ _ menu_ c = withRef menu_ $ \menu_Ptr -> setDownColor' menu_Ptr c

-- $functions
-- @
--
-- add:: ('Parent' a 'MenuPrim') => 'Ref' 'MenuPrim' -> 'String' -> 'Maybe' 'Shortcut' -> ('Ref' a -> 'IO' ()) -> 'MenuItemFlags' -> 'IO' 'MenuItemIndex')
--
-- addName :: 'Ref' 'MenuPrim' -> 'String' -> 'IO' ()
--
-- clear :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- clearSubmenu :: 'Ref' 'MenuPrim' -> 'Int' -> 'IO' ('Either' 'OutOfRange' ())
--
-- copy:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> 'Ref' a -> 'IO' ())
--
-- destroy :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- findIndex :: 'Ref' 'MenuPrim' -> 'MenuItemLocator' -> 'IO' ('Maybe' 'Int')
--
-- getDownBox :: 'Ref' 'MenuPrim' -> 'IO' 'Boxtype'
--
-- getDownColor :: 'Ref' 'MenuPrim' -> 'IO' 'Color'
--
-- getMenu :: 'Ref' 'MenuPrim' -> 'IO' ('Ref' 'MenuItem')
--
-- getMode :: 'Ref' 'MenuPrim' -> 'Int' -> 'IO' 'Int'
--
-- getSize :: 'Ref' 'MenuPrim' -> 'IO' 'Int'
--
-- getText :: 'Ref' 'MenuPrim' -> 'IO' 'String'
--
-- getTextWithIndex :: 'Ref' 'MenuPrim' -> 'Int' -> 'IO' 'String'
--
-- getTextcolor :: 'Ref' 'MenuPrim' -> 'IO' 'Color'
--
-- getTextfont :: 'Ref' 'MenuPrim' -> 'IO' 'Font'
--
-- getTextsize :: 'Ref' 'MenuPrim' -> 'IO' 'FontSize'
--
-- getValue :: 'Ref' 'MenuPrim' -> 'IO' 'Int'
--
-- global :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- handle :: 'Ref' 'MenuPrim' -> 'Event' -> 'IO' 'Int'
--
-- handleSuper :: 'Ref' 'MenuPrim' -> 'Int' -> 'IO' 'Int'
--
-- hide :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- hideSuper :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- insert:: ('Parent' a 'MenuPrim') => 'Ref' 'MenuPrim' -> 'Int' -> 'String' -> 'Maybe' 'Shortcut' -> ('Ref' a -> 'IO' ()) -> 'MenuItemFlags' -> 'IO' 'MenuItemIndex')
--
-- itemPathname:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> 'Ref' a -> 'IO' ('Maybe' 'String'))
--
-- itemPathnameRecent :: 'Ref' 'MenuPrim' -> 'IO' ('Maybe' 'String')
--
-- mvalue :: 'Ref' 'MenuPrim' -> 'IO' ('Ref' 'MenuItem')
--
-- picked:: ('Parent' a 'MenuItem', 'Parent' b 'MenuItem') => 'Ref' 'MenuPrim' -> 'Ref' a -> 'IO' ('Ref' b))
--
-- remove :: 'Ref' 'MenuPrim' -> 'Int' -> 'IO' ()
--
-- replace :: 'Ref' 'MenuPrim' -> 'Int' -> 'String' -> 'IO' ()
--
-- resize :: 'Ref' 'MenuPrim' -> 'Rectangle' -> 'IO' ()
--
-- resizeSuper :: 'Ref' 'MenuPrim' -> 'Rectangle' -> 'IO' ()
--
-- setDownBox :: 'Ref' 'MenuPrim' -> 'Boxtype' -> 'IO' ()
--
-- setDownColor :: 'Ref' 'MenuPrim' -> 'Int' -> 'IO' ()
--
-- setMenu:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> ['Ref' a] -> 'IO' ())
--
-- setMode :: 'Ref' 'MenuPrim' -> 'Int' -> 'Int' -> 'IO' ()
--
-- setShortcut :: 'Ref' 'MenuPrim' -> 'Int' -> 'ShortcutKeySequence' -> 'IO' ()
--
-- setSize :: 'Ref' 'MenuPrim' -> 'Int' -> 'Int' -> 'IO' ()
--
-- setTextcolor :: 'Ref' 'MenuPrim' -> 'Color' -> 'IO' ()
--
-- setTextfont :: 'Ref' 'MenuPrim' -> 'Font' -> 'IO' ()
--
-- setTextsize :: 'Ref' 'MenuPrim' -> 'FontSize' -> 'IO' ()
--
-- setValue :: 'Ref' 'MenuPrim' -> 'MenuItemReference' -> 'IO' 'Int'
--
-- showWidget :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- showWidgetSuper :: 'Ref' 'MenuPrim' -> 'IO' ()
--
-- testShortcut:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> 'IO' ('Ref' a))
--
-- @


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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_OverriddenMenu__New_WithLabel"
  overriddenWidgetNewWithLabel''_ :: (CInt -> (CInt -> (CInt -> (CInt -> ((Ptr CChar) -> ((Ptr ()) -> (IO (Ptr ()))))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_OverriddenMenu__New"
  overriddenWidgetNew''_ :: (CInt -> (CInt -> (CInt -> (CInt -> ((Ptr ()) -> (IO (Ptr ())))))))

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__handle"
  menu_Handle''_ :: ((Ptr ()) -> (CInt -> (IO CInt)))

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

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

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

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__show"
  menu_Show''_ :: ((Ptr ()) -> (IO ()))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__item_pathname_with_finditem"
  itemPathnameWithFinditem''_ :: ((Ptr ()) -> ((Ptr CChar) -> (CInt -> ((Ptr ()) -> (IO CInt)))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__item_pathname"
  itemPathname''_ :: ((Ptr ()) -> ((Ptr CChar) -> (CInt -> (IO CInt))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__picked"
  picked''_ :: ((Ptr ()) -> ((Ptr ()) -> (IO (Ptr ()))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__find_index_with_name"
  findIndexWithName''_ :: ((Ptr ()) -> ((Ptr CChar) -> (IO CInt)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__find_index_with_item"
  findIndexWithItem''_ :: ((Ptr ()) -> ((Ptr ()) -> (IO CInt)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__test_shortcut"
  testShortcut''_ :: ((Ptr ()) -> (IO (Ptr ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__global"
  global''_ :: ((Ptr ()) -> (IO ()))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__menu"
  menu''_ :: ((Ptr ()) -> (IO (Ptr ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__menu_with_m"
  menuWithM''_ :: ((Ptr ()) -> ((Ptr (Ptr ())) -> (CInt -> (IO ()))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__copy"
  copy''_ :: ((Ptr ()) -> ((Ptr ()) -> (IO ())))

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

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

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

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

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

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__size"
  size''_ :: ((Ptr ()) -> (IO CInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_size"
  setSize''_ :: ((Ptr ()) -> (CInt -> (CInt -> (IO ()))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__clear"
  clear''_ :: ((Ptr ()) -> (IO ()))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__clear_submenu"
  clearSubmenu''_ :: ((Ptr ()) -> (CInt -> (IO CInt)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__replace"
  replace''_ :: ((Ptr ()) -> (CInt -> ((Ptr CChar) -> (IO ()))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__remove"
  remove''_ :: ((Ptr ()) -> (CInt -> (IO ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__shortcut"
  shortcut''_ :: ((Ptr ()) -> (CInt -> (CInt -> (IO ()))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_mode"
  setMode''_ :: ((Ptr ()) -> (CInt -> (CInt -> (IO ()))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__mode"
  mode''_ :: ((Ptr ()) -> (CInt -> (IO CInt)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__mvalue"
  mvalue''_ :: ((Ptr ()) -> (IO (Ptr ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__value"
  value''_ :: ((Ptr ()) -> (IO CInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__value_with_item"
  valueWithItem''_ :: ((Ptr ()) -> ((Ptr ()) -> (IO CInt)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__value_with_index"
  valueWithIndex''_ :: ((Ptr ()) -> (CInt -> (IO CInt)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__text"
  text''_ :: ((Ptr ()) -> (IO (Ptr CChar)))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__text_with_index"
  textWithIndex''_ :: ((Ptr ()) -> (CInt -> (IO (Ptr CChar))))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__textfont"
  textfont''_ :: ((Ptr ()) -> (IO CInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_textfont"
  setTextfont''_ :: ((Ptr ()) -> (CInt -> (IO ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__textsize"
  textsize''_ :: ((Ptr ()) -> (IO CInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_textsize"
  setTextsize''_ :: ((Ptr ()) -> (CInt -> (IO ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__textcolor"
  textcolor''_ :: ((Ptr ()) -> (IO CUInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_textcolor"
  setTextcolor''_ :: ((Ptr ()) -> (CUInt -> (IO ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__down_box"
  downBox''_ :: ((Ptr ()) -> (IO CInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_down_box"
  setDownBox''_ :: ((Ptr ()) -> (CInt -> (IO ())))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__down_color"
  downColor''_ :: ((Ptr ()) -> (IO CUInt))

foreign import ccall unsafe "Graphics/UI/FLTK/LowLevel/MenuPrim.chs.h Fl_Menu__set_down_color"
  setDownColor''_ :: ((Ptr ()) -> (CUInt -> (IO ())))