{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
{-# LANGUAGE CPP, EmptyDataDecls, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.SysMenuBar
(
sysMenuBarNew
)
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.Dispatch
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.MenuItem
import Graphics.UI.FLTK.LowLevel.MenuPrim
sysMenuBarNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
sysMenuBarNew' a1 a2 a3 a4 =
let {a1' = fromIntegral a1} in
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
sysMenuBarNew''_ a1' a2' a3' a4' >>= \res ->
let {res' = id res} in
return (res')
{-# LINE 29 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
sysMenuBarNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (String) -> 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
let {a5' = unsafeToCString a5} in
sysMenuBarNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
let {res' = id res} in
return (res')
{-# LINE 30 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
sysMenuBarNew :: Rectangle -> Maybe String -> IO (Ref SysMenuBar)
sysMenuBarNew rectangle l'=
let (x_pos, y_pos, width, height) = fromRectangle rectangle
in case l' of
Nothing -> sysMenuBarNew' x_pos y_pos width height >>=
toRef
Just l -> sysMenuBarNewWithLabel' x_pos y_pos width height l >>=
toRef
sysMenuBarDestroy' :: (Ptr ()) -> IO ((()))
sysMenuBarDestroy' a1 =
let {a1' = id a1} in
sysMenuBarDestroy''_ a1' >>= \res ->
let {res' = supressWarningAboutRes res} in
return (res')
{-# LINE 39 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ ( IO ())) => Op (Destroy ()) SysMenuBar orig impl where
runOp _ _ win = swapRef win $ \winPtr -> do
sysMenuBarDestroy' winPtr
return nullPtr
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 44 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ ( Event -> IO Int)) => Op (Handle ()) SysMenuBar orig impl where
runOp _ _ menu_bar event = withRef menu_bar (\p -> sysMenuBarHandle' p (fromIntegral . fromEnum $ event))
remove' :: (Ptr ()) -> (Int) -> IO ()
remove' a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
remove''_ a1' a2' >>
return ()
{-# LINE 47 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (Int -> IO ())) => Op (Remove ()) SysMenuBar orig impl where
runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> remove' menu_Ptr index'
replace' :: (Ptr ()) -> (Int) -> (String) -> IO ()
replace' a1 a2 a3 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
let {a3' = unsafeToCString a3} in
replace''_ a1' a2' a3' >>
return ()
{-# LINE 50 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (Int -> String -> IO ())) => Op (Replace ()) SysMenuBar orig impl where
runOp _ _ menu_ index' name = withRef menu_ $ \menu_Ptr -> replace' menu_Ptr index' name
clear' :: (Ptr ()) -> IO ()
clear' a1 =
let {a1' = id a1} in
clear''_ a1' >>
return ()
{-# LINE 53 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ ( IO ())) => Op (Clear ()) SysMenuBar 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 56 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (Int -> IO (Int))) => Op (ClearSubmenu ()) SysMenuBar orig impl where
runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> clearSubmenu' 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 59 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (Int -> ShortcutKeySequence -> IO ())) => Op (SetShortcut ()) SysMenuBar 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 64 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (Int -> MenuItemFlags -> IO ())) => Op (SetMode ()) SysMenuBar orig impl where
runOp _ _ menu_ 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 67 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (Int -> IO (Maybe MenuItemFlags))) => Op (GetMode ()) SysMenuBar orig impl where
runOp _ _ menu_ 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 70 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ ( IO ())) => Op (Global ()) SysMenuBar 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 73 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ ([Ref MenuItem] -> IO ())) => Op (SetMenu ()) SysMenuBar orig impl where
runOp _ _ menu_ items =
withRef menu_ $ \menu_Ptr ->
withRefs items $ \menu_itemsPtr ->
menuWithM' menu_Ptr menu_itemsPtr (length items)
add' :: (Ptr ()) -> (String) -> IO ()
add' a1 a2 =
let {a1' = id a1} in
let {a2' = unsafeToCString a2} in
add''_ a1' a2' >>
return ()
{-# LINE 80 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (impl ~ (String -> IO ())) => Op (AddName ()) SysMenuBar 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
let {a2' = unsafeToCString a2} in
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 84 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
addWithShortcutnameFlags' :: (Ptr ()) -> (String) -> (String) -> (FunPtr CallbackWithUserDataPrim) -> (Int) -> IO ((Int))
addWithShortcutnameFlags' a1 a2 a3 a4 a5 =
let {a1' = id a1} in
let {a2' = unsafeToCString a2} in
let {a3' = unsafeToCString a3} in
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 85 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (Parent a MenuItem, impl ~ ( String -> Maybe Shortcut -> Maybe (Ref a-> IO ()) -> MenuItemFlags -> IO (MenuItemIndex))) => Op (Add ()) SysMenuBar orig (impl) where
runOp _ _ menu_ name shortcut cb flags =
addMenuItem (Left (safeCast menu_)) name shortcut cb flags addWithFlags' addWithShortcutnameFlags'
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
let {a3' = unsafeToCString a3} in
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 90 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.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
let {a3' = unsafeToCString a3} in
let {a4' = unsafeToCString a4} in
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 91 "src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs" #-}
instance (Parent a MenuPrim, impl ~ ( Int -> String -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> IO (MenuItemIndex))) => Op (Insert ()) SysMenuBar orig impl where
runOp _ _ menu_ index' name shortcut cb flags = insertMenuItem (safeCast menu_) index' name shortcut cb flags insertWithFlags' insertWithShortcutnameFlags'
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/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/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/SysMenuBar.chs.h Fl_Sys_Menu_Bar_Destroy"
sysMenuBarDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/SysMenuBar.chs.h Fl_Sys_Menu_Bar_handle"
sysMenuBarHandle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/SysMenuBar.chs.h Fl_Sys_Menu_Bar_remove"
remove''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/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/SysMenuBar.chs.h Fl_Sys_Menu_Bar_clear"
clear''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/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/SysMenuBar.chs.h Fl_Sys_Menu_Bar_shortcut"
shortcut''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/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/SysMenuBar.chs.h Fl_Sys_Menu_Bar_mode"
mode''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/SysMenuBar.chs.h Fl_Sys_Menu_Bar_global"
global''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/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/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/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/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/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/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)))))))