{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.MenuModel
(
MenuModel(..) ,
IsMenuModel ,
toMenuModel ,
noMenuModel ,
#if defined(ENABLE_OVERLOADING)
ResolveMenuModelMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MenuModelGetItemAttributeValueMethodInfo,
#endif
menuModelGetItemAttributeValue ,
#if defined(ENABLE_OVERLOADING)
MenuModelGetItemLinkMethodInfo ,
#endif
menuModelGetItemLink ,
#if defined(ENABLE_OVERLOADING)
MenuModelGetNItemsMethodInfo ,
#endif
menuModelGetNItems ,
#if defined(ENABLE_OVERLOADING)
MenuModelIsMutableMethodInfo ,
#endif
menuModelIsMutable ,
#if defined(ENABLE_OVERLOADING)
MenuModelItemsChangedMethodInfo ,
#endif
menuModelItemsChanged ,
#if defined(ENABLE_OVERLOADING)
MenuModelIterateItemAttributesMethodInfo,
#endif
menuModelIterateItemAttributes ,
#if defined(ENABLE_OVERLOADING)
MenuModelIterateItemLinksMethodInfo ,
#endif
menuModelIterateItemLinks ,
C_MenuModelItemsChangedCallback ,
MenuModelItemsChangedCallback ,
#if defined(ENABLE_OVERLOADING)
MenuModelItemsChangedSignalInfo ,
#endif
afterMenuModelItemsChanged ,
genClosure_MenuModelItemsChanged ,
mk_MenuModelItemsChangedCallback ,
noMenuModelItemsChangedCallback ,
onMenuModelItemsChanged ,
wrap_MenuModelItemsChangedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.MenuAttributeIter as Gio.MenuAttributeIter
import {-# SOURCE #-} qualified GI.Gio.Objects.MenuLinkIter as Gio.MenuLinkIter
newtype = (ManagedPtr MenuModel)
deriving (MenuModel -> MenuModel -> Bool
(MenuModel -> MenuModel -> Bool)
-> (MenuModel -> MenuModel -> Bool) -> Eq MenuModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MenuModel -> MenuModel -> Bool
$c/= :: MenuModel -> MenuModel -> Bool
== :: MenuModel -> MenuModel -> Bool
$c== :: MenuModel -> MenuModel -> Bool
Eq)
foreign import ccall "g_menu_model_get_type"
:: IO GType
instance GObject MenuModel where
gobjectType :: IO GType
gobjectType = IO GType
c_g_menu_model_get_type
instance B.GValue.IsGValue MenuModel where
toGValue :: MenuModel -> IO GValue
toGValue o :: MenuModel
o = do
GType
gtype <- IO GType
c_g_menu_model_get_type
MenuModel -> (Ptr MenuModel -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MenuModel
o (GType
-> (GValue -> Ptr MenuModel -> IO ()) -> Ptr MenuModel -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr MenuModel -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO MenuModel
fromGValue gv :: GValue
gv = do
Ptr MenuModel
ptr <- GValue -> IO (Ptr MenuModel)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr MenuModel)
(ManagedPtr MenuModel -> MenuModel)
-> Ptr MenuModel -> IO MenuModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr MenuModel -> MenuModel
MenuModel Ptr MenuModel
ptr
class (GObject o, O.IsDescendantOf MenuModel o) => o
instance (GObject o, O.IsDescendantOf MenuModel o) => IsMenuModel o
instance O.HasParentTypes MenuModel
type instance O.ParentTypes MenuModel = '[GObject.Object.Object]
toMenuModel :: (MonadIO m, IsMenuModel o) => o -> m MenuModel
= IO MenuModel -> m MenuModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuModel -> m MenuModel)
-> (o -> IO MenuModel) -> o -> m MenuModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MenuModel -> MenuModel) -> o -> IO MenuModel
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr MenuModel -> MenuModel
MenuModel
noMenuModel :: Maybe MenuModel
= Maybe MenuModel
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveMenuModelMethod (t :: Symbol) (o :: *) :: * where
ResolveMenuModelMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMenuModelMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMenuModelMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMenuModelMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMenuModelMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMenuModelMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMenuModelMethod "isMutable" o = MenuModelIsMutableMethodInfo
ResolveMenuModelMethod "itemsChanged" o = MenuModelItemsChangedMethodInfo
ResolveMenuModelMethod "iterateItemAttributes" o = MenuModelIterateItemAttributesMethodInfo
ResolveMenuModelMethod "iterateItemLinks" o = MenuModelIterateItemLinksMethodInfo
ResolveMenuModelMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMenuModelMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMenuModelMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMenuModelMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMenuModelMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMenuModelMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMenuModelMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMenuModelMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMenuModelMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMenuModelMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMenuModelMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMenuModelMethod "getItemAttributeValue" o = MenuModelGetItemAttributeValueMethodInfo
ResolveMenuModelMethod "getItemLink" o = MenuModelGetItemLinkMethodInfo
ResolveMenuModelMethod "getNItems" o = MenuModelGetNItemsMethodInfo
ResolveMenuModelMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMenuModelMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMenuModelMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMenuModelMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMenuModelMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMenuModelMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMenuModelMethod t MenuModel, O.MethodInfo info MenuModel p) => OL.IsLabel t (MenuModel -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type =
Int32
-> Int32
-> Int32
-> IO ()
noMenuModelItemsChangedCallback :: Maybe MenuModelItemsChangedCallback
= Maybe MenuModelItemsChangedCallback
forall a. Maybe a
Nothing
type =
Ptr () ->
Int32 ->
Int32 ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
:: C_MenuModelItemsChangedCallback -> IO (FunPtr C_MenuModelItemsChangedCallback)
genClosure_MenuModelItemsChanged :: MonadIO m => MenuModelItemsChangedCallback -> m (GClosure C_MenuModelItemsChangedCallback)
cb :: MenuModelItemsChangedCallback
cb = IO (GClosure C_MenuModelItemsChangedCallback)
-> m (GClosure C_MenuModelItemsChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MenuModelItemsChangedCallback)
-> m (GClosure C_MenuModelItemsChangedCallback))
-> IO (GClosure C_MenuModelItemsChangedCallback)
-> m (GClosure C_MenuModelItemsChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MenuModelItemsChangedCallback
cb' = MenuModelItemsChangedCallback -> C_MenuModelItemsChangedCallback
wrap_MenuModelItemsChangedCallback MenuModelItemsChangedCallback
cb
C_MenuModelItemsChangedCallback
-> IO (FunPtr C_MenuModelItemsChangedCallback)
mk_MenuModelItemsChangedCallback C_MenuModelItemsChangedCallback
cb' IO (FunPtr C_MenuModelItemsChangedCallback)
-> (FunPtr C_MenuModelItemsChangedCallback
-> IO (GClosure C_MenuModelItemsChangedCallback))
-> IO (GClosure C_MenuModelItemsChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MenuModelItemsChangedCallback
-> IO (GClosure C_MenuModelItemsChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_MenuModelItemsChangedCallback ::
MenuModelItemsChangedCallback ->
C_MenuModelItemsChangedCallback
_cb :: MenuModelItemsChangedCallback
_cb _ position :: Int32
position removed :: Int32
removed added :: Int32
added _ = do
MenuModelItemsChangedCallback
_cb Int32
position Int32
removed Int32
added
onMenuModelItemsChanged :: (IsMenuModel a, MonadIO m) => a -> MenuModelItemsChangedCallback -> m SignalHandlerId
obj :: a
obj cb :: MenuModelItemsChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MenuModelItemsChangedCallback
cb' = MenuModelItemsChangedCallback -> C_MenuModelItemsChangedCallback
wrap_MenuModelItemsChangedCallback MenuModelItemsChangedCallback
cb
FunPtr C_MenuModelItemsChangedCallback
cb'' <- C_MenuModelItemsChangedCallback
-> IO (FunPtr C_MenuModelItemsChangedCallback)
mk_MenuModelItemsChangedCallback C_MenuModelItemsChangedCallback
cb'
a
-> Text
-> FunPtr C_MenuModelItemsChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "items-changed" FunPtr C_MenuModelItemsChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterMenuModelItemsChanged :: (IsMenuModel a, MonadIO m) => a -> MenuModelItemsChangedCallback -> m SignalHandlerId
obj :: a
obj cb :: MenuModelItemsChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MenuModelItemsChangedCallback
cb' = MenuModelItemsChangedCallback -> C_MenuModelItemsChangedCallback
wrap_MenuModelItemsChangedCallback MenuModelItemsChangedCallback
cb
FunPtr C_MenuModelItemsChangedCallback
cb'' <- C_MenuModelItemsChangedCallback
-> IO (FunPtr C_MenuModelItemsChangedCallback)
mk_MenuModelItemsChangedCallback C_MenuModelItemsChangedCallback
cb'
a
-> Text
-> FunPtr C_MenuModelItemsChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "items-changed" FunPtr C_MenuModelItemsChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data MenuModelItemsChangedSignalInfo
instance SignalInfo MenuModelItemsChangedSignalInfo where
type HaskellCallbackType MenuModelItemsChangedSignalInfo = MenuModelItemsChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_MenuModelItemsChangedCallback cb
cb'' <- mk_MenuModelItemsChangedCallback cb'
connectSignalFunPtr obj "items-changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MenuModel
type instance O.AttributeList MenuModel = MenuModelAttributeList
type MenuModelAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList MenuModel = MenuModelSignalList
type MenuModelSignalList = ('[ '("itemsChanged", MenuModelItemsChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_menu_model_get_item_attribute_value" ::
Ptr MenuModel ->
Int32 ->
CString ->
Ptr GLib.VariantType.VariantType ->
IO (Ptr GVariant)
menuModelGetItemAttributeValue ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> Int32
-> T.Text
-> Maybe (GLib.VariantType.VariantType)
-> m GVariant
model :: a
model itemIndex :: Int32
itemIndex attribute :: Text
attribute expectedType :: Maybe VariantType
expectedType = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
CString
attribute' <- Text -> IO CString
textToCString Text
attribute
Ptr VariantType
maybeExpectedType <- case Maybe VariantType
expectedType of
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
nullPtr
Just jExpectedType :: VariantType
jExpectedType -> do
Ptr VariantType
jExpectedType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jExpectedType
Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jExpectedType'
Ptr GVariant
result <- Ptr MenuModel
-> Int32 -> CString -> Ptr VariantType -> IO (Ptr GVariant)
g_menu_model_get_item_attribute_value Ptr MenuModel
model' Int32
itemIndex CString
attribute' Ptr VariantType
maybeExpectedType
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuModelGetItemAttributeValue" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
Maybe VariantType -> (VariantType -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
expectedType VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
attribute'
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data MenuModelGetItemAttributeValueMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (GLib.VariantType.VariantType) -> m GVariant), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelGetItemAttributeValueMethodInfo a signature where
overloadedMethod = menuModelGetItemAttributeValue
#endif
foreign import ccall "g_menu_model_get_item_link" ::
Ptr MenuModel ->
Int32 ->
CString ->
IO (Ptr MenuModel)
menuModelGetItemLink ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> Int32
-> T.Text
-> m MenuModel
model :: a
model itemIndex :: Int32
itemIndex link :: Text
link = IO MenuModel -> m MenuModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuModel -> m MenuModel) -> IO MenuModel -> m MenuModel
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
CString
link' <- Text -> IO CString
textToCString Text
link
Ptr MenuModel
result <- Ptr MenuModel -> Int32 -> CString -> IO (Ptr MenuModel)
g_menu_model_get_item_link Ptr MenuModel
model' Int32
itemIndex CString
link'
Text -> Ptr MenuModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuModelGetItemLink" Ptr MenuModel
result
MenuModel
result' <- ((ManagedPtr MenuModel -> MenuModel)
-> Ptr MenuModel -> IO MenuModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MenuModel -> MenuModel
MenuModel) Ptr MenuModel
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
link'
MenuModel -> IO MenuModel
forall (m :: * -> *) a. Monad m => a -> m a
return MenuModel
result'
#if defined(ENABLE_OVERLOADING)
data MenuModelGetItemLinkMethodInfo
instance (signature ~ (Int32 -> T.Text -> m MenuModel), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelGetItemLinkMethodInfo a signature where
overloadedMethod = menuModelGetItemLink
#endif
foreign import ccall "g_menu_model_get_n_items" ::
Ptr MenuModel ->
IO Int32
menuModelGetNItems ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> m Int32
model :: a
model = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
Int32
result <- Ptr MenuModel -> IO Int32
g_menu_model_get_n_items Ptr MenuModel
model'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data MenuModelGetNItemsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelGetNItemsMethodInfo a signature where
overloadedMethod = menuModelGetNItems
#endif
foreign import ccall "g_menu_model_is_mutable" ::
Ptr MenuModel ->
IO CInt
menuModelIsMutable ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> m Bool
model :: a
model = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
CInt
result <- Ptr MenuModel -> IO CInt
g_menu_model_is_mutable Ptr MenuModel
model'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MenuModelIsMutableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelIsMutableMethodInfo a signature where
overloadedMethod = menuModelIsMutable
#endif
foreign import ccall "g_menu_model_items_changed" ::
Ptr MenuModel ->
Int32 ->
Int32 ->
Int32 ->
IO ()
menuModelItemsChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> Int32
-> Int32
-> Int32
-> m ()
model :: a
model position :: Int32
position removed :: Int32
removed added :: Int32
added = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
Ptr MenuModel -> MenuModelItemsChangedCallback
g_menu_model_items_changed Ptr MenuModel
model' Int32
position Int32
removed Int32
added
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MenuModelItemsChangedMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelItemsChangedMethodInfo a signature where
overloadedMethod = menuModelItemsChanged
#endif
foreign import ccall "g_menu_model_iterate_item_attributes" ::
Ptr MenuModel ->
Int32 ->
IO (Ptr Gio.MenuAttributeIter.MenuAttributeIter)
menuModelIterateItemAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> Int32
-> m Gio.MenuAttributeIter.MenuAttributeIter
model :: a
model itemIndex :: Int32
itemIndex = IO MenuAttributeIter -> m MenuAttributeIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuAttributeIter -> m MenuAttributeIter)
-> IO MenuAttributeIter -> m MenuAttributeIter
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
Ptr MenuAttributeIter
result <- Ptr MenuModel -> Int32 -> IO (Ptr MenuAttributeIter)
g_menu_model_iterate_item_attributes Ptr MenuModel
model' Int32
itemIndex
Text -> Ptr MenuAttributeIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuModelIterateItemAttributes" Ptr MenuAttributeIter
result
MenuAttributeIter
result' <- ((ManagedPtr MenuAttributeIter -> MenuAttributeIter)
-> Ptr MenuAttributeIter -> IO MenuAttributeIter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MenuAttributeIter -> MenuAttributeIter
Gio.MenuAttributeIter.MenuAttributeIter) Ptr MenuAttributeIter
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
MenuAttributeIter -> IO MenuAttributeIter
forall (m :: * -> *) a. Monad m => a -> m a
return MenuAttributeIter
result'
#if defined(ENABLE_OVERLOADING)
data MenuModelIterateItemAttributesMethodInfo
instance (signature ~ (Int32 -> m Gio.MenuAttributeIter.MenuAttributeIter), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelIterateItemAttributesMethodInfo a signature where
overloadedMethod = menuModelIterateItemAttributes
#endif
foreign import ccall "g_menu_model_iterate_item_links" ::
Ptr MenuModel ->
Int32 ->
IO (Ptr Gio.MenuLinkIter.MenuLinkIter)
menuModelIterateItemLinks ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuModel a) =>
a
-> Int32
-> m Gio.MenuLinkIter.MenuLinkIter
model :: a
model itemIndex :: Int32
itemIndex = IO MenuLinkIter -> m MenuLinkIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuLinkIter -> m MenuLinkIter)
-> IO MenuLinkIter -> m MenuLinkIter
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuModel
model' <- a -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
Ptr MenuLinkIter
result <- Ptr MenuModel -> Int32 -> IO (Ptr MenuLinkIter)
g_menu_model_iterate_item_links Ptr MenuModel
model' Int32
itemIndex
Text -> Ptr MenuLinkIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuModelIterateItemLinks" Ptr MenuLinkIter
result
MenuLinkIter
result' <- ((ManagedPtr MenuLinkIter -> MenuLinkIter)
-> Ptr MenuLinkIter -> IO MenuLinkIter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MenuLinkIter -> MenuLinkIter
Gio.MenuLinkIter.MenuLinkIter) Ptr MenuLinkIter
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
MenuLinkIter -> IO MenuLinkIter
forall (m :: * -> *) a. Monad m => a -> m a
return MenuLinkIter
result'
#if defined(ENABLE_OVERLOADING)
data MenuModelIterateItemLinksMethodInfo
instance (signature ~ (Int32 -> m Gio.MenuLinkIter.MenuLinkIter), MonadIO m, IsMenuModel a) => O.MethodInfo MenuModelIterateItemLinksMethodInfo a signature where
overloadedMethod = menuModelIterateItemLinks
#endif