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
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')
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')
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')
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')
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 ()
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 ()
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 ()
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')
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 ()
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 ()
instance (impl ~ (Int -> Int -> IO ())) => Op (SetMode ()) SysMenuBar 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')
instance (impl ~ (Int -> IO (Int))) => Op (GetMode ()) SysMenuBar orig impl where
runOp _ _ menu_ i = withRef menu_ $ \menu_Ptr -> mode' menu_Ptr i
global' :: (Ptr ()) -> IO ()
global' a1 =
let {a1' = id a1} in
global''_ a1' >>
return ()
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 ()
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)
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 ()))))