{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.MenuLinkIter
(
MenuLinkIter(..) ,
IsMenuLinkIter ,
toMenuLinkIter ,
#if defined(ENABLE_OVERLOADING)
ResolveMenuLinkIterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MenuLinkIterGetNameMethodInfo ,
#endif
menuLinkIterGetName ,
#if defined(ENABLE_OVERLOADING)
MenuLinkIterGetNextMethodInfo ,
#endif
menuLinkIterGetNext ,
#if defined(ENABLE_OVERLOADING)
MenuLinkIterGetValueMethodInfo ,
#endif
menuLinkIterGetValue ,
#if defined(ENABLE_OVERLOADING)
MenuLinkIterNextMethodInfo ,
#endif
menuLinkIterNext ,
) 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.BasicTypes as B.Types
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 Control.Monad.IO.Class as MIO
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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
newtype = (SP.ManagedPtr MenuLinkIter)
deriving (MenuLinkIter -> MenuLinkIter -> Bool
(MenuLinkIter -> MenuLinkIter -> Bool)
-> (MenuLinkIter -> MenuLinkIter -> Bool) -> Eq MenuLinkIter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MenuLinkIter -> MenuLinkIter -> Bool
$c/= :: MenuLinkIter -> MenuLinkIter -> Bool
== :: MenuLinkIter -> MenuLinkIter -> Bool
$c== :: MenuLinkIter -> MenuLinkIter -> Bool
Eq)
instance SP.ManagedPtrNewtype MenuLinkIter where
toManagedPtr :: MenuLinkIter -> ManagedPtr MenuLinkIter
toManagedPtr (MenuLinkIter ManagedPtr MenuLinkIter
p) = ManagedPtr MenuLinkIter
p
foreign import ccall "g_menu_link_iter_get_type"
:: IO B.Types.GType
instance B.Types.TypedObject MenuLinkIter where
glibType :: IO GType
glibType = IO GType
c_g_menu_link_iter_get_type
instance B.Types.GObject MenuLinkIter
instance B.GValue.IsGValue MenuLinkIter where
toGValue :: MenuLinkIter -> IO GValue
toGValue MenuLinkIter
o = do
GType
gtype <- IO GType
c_g_menu_link_iter_get_type
MenuLinkIter -> (Ptr MenuLinkIter -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MenuLinkIter
o (GType
-> (GValue -> Ptr MenuLinkIter -> IO ())
-> Ptr MenuLinkIter
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr MenuLinkIter -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO MenuLinkIter
fromGValue GValue
gv = do
Ptr MenuLinkIter
ptr <- GValue -> IO (Ptr MenuLinkIter)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr MenuLinkIter)
(ManagedPtr MenuLinkIter -> MenuLinkIter)
-> Ptr MenuLinkIter -> IO MenuLinkIter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr MenuLinkIter -> MenuLinkIter
MenuLinkIter Ptr MenuLinkIter
ptr
class (SP.GObject o, O.IsDescendantOf MenuLinkIter o) => o
instance (SP.GObject o, O.IsDescendantOf MenuLinkIter o) => IsMenuLinkIter o
instance O.HasParentTypes MenuLinkIter
type instance O.ParentTypes MenuLinkIter = '[GObject.Object.Object]
toMenuLinkIter :: (MonadIO m, IsMenuLinkIter o) => o -> m MenuLinkIter
= IO MenuLinkIter -> m MenuLinkIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuLinkIter -> m MenuLinkIter)
-> (o -> IO MenuLinkIter) -> o -> m MenuLinkIter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MenuLinkIter -> MenuLinkIter) -> o -> IO MenuLinkIter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr MenuLinkIter -> MenuLinkIter
MenuLinkIter
#if defined(ENABLE_OVERLOADING)
type family ResolveMenuLinkIterMethod (t :: Symbol) (o :: *) :: * where
ResolveMenuLinkIterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMenuLinkIterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMenuLinkIterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMenuLinkIterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMenuLinkIterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMenuLinkIterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMenuLinkIterMethod "next" o = MenuLinkIterNextMethodInfo
ResolveMenuLinkIterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMenuLinkIterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMenuLinkIterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMenuLinkIterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMenuLinkIterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMenuLinkIterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMenuLinkIterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMenuLinkIterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMenuLinkIterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMenuLinkIterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMenuLinkIterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMenuLinkIterMethod "getName" o = MenuLinkIterGetNameMethodInfo
ResolveMenuLinkIterMethod "getNext" o = MenuLinkIterGetNextMethodInfo
ResolveMenuLinkIterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMenuLinkIterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMenuLinkIterMethod "getValue" o = MenuLinkIterGetValueMethodInfo
ResolveMenuLinkIterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMenuLinkIterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMenuLinkIterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMenuLinkIterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMenuLinkIterMethod t MenuLinkIter, O.MethodInfo info MenuLinkIter p) => OL.IsLabel t (MenuLinkIter -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MenuLinkIter
type instance O.AttributeList MenuLinkIter = MenuLinkIterAttributeList
type MenuLinkIterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList MenuLinkIter = MenuLinkIterSignalList
type MenuLinkIterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_menu_link_iter_get_name" ::
Ptr MenuLinkIter ->
IO CString
menuLinkIterGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
a
-> m T.Text
a
iter = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
CString
result <- Ptr MenuLinkIter -> IO CString
g_menu_link_iter_get_name Ptr MenuLinkIter
iter'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"menuLinkIterGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data MenuLinkIterGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterGetNameMethodInfo a signature where
overloadedMethod = menuLinkIterGetName
#endif
foreign import ccall "g_menu_link_iter_get_next" ::
Ptr MenuLinkIter ->
Ptr CString ->
Ptr (Ptr Gio.MenuModel.MenuModel) ->
IO CInt
menuLinkIterGetNext ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
a
-> m ((Bool, T.Text, Gio.MenuModel.MenuModel))
a
iter = IO (Bool, Text, MenuModel) -> m (Bool, Text, MenuModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Text, MenuModel) -> m (Bool, Text, MenuModel))
-> IO (Bool, Text, MenuModel) -> m (Bool, Text, MenuModel)
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Ptr CString
outLink <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
Ptr (Ptr MenuModel)
value <- IO (Ptr (Ptr MenuModel))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gio.MenuModel.MenuModel))
CInt
result <- Ptr MenuLinkIter -> Ptr CString -> Ptr (Ptr MenuModel) -> IO CInt
g_menu_link_iter_get_next Ptr MenuLinkIter
iter' Ptr CString
outLink Ptr (Ptr MenuModel)
value
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CString
outLink' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outLink
Text
outLink'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outLink'
Ptr MenuModel
value' <- Ptr (Ptr MenuModel) -> IO (Ptr MenuModel)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr MenuModel)
value
MenuModel
value'' <- ((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
Gio.MenuModel.MenuModel) Ptr MenuModel
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outLink
Ptr (Ptr MenuModel) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr MenuModel)
value
(Bool, Text, MenuModel) -> IO (Bool, Text, MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Text
outLink'', MenuModel
value'')
#if defined(ENABLE_OVERLOADING)
data MenuLinkIterGetNextMethodInfo
instance (signature ~ (m ((Bool, T.Text, Gio.MenuModel.MenuModel))), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterGetNextMethodInfo a signature where
overloadedMethod = menuLinkIterGetNext
#endif
foreign import ccall "g_menu_link_iter_get_value" ::
Ptr MenuLinkIter ->
IO (Ptr Gio.MenuModel.MenuModel)
menuLinkIterGetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
a
-> m Gio.MenuModel.MenuModel
a
iter = 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 MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Ptr MenuModel
result <- Ptr MenuLinkIter -> IO (Ptr MenuModel)
g_menu_link_iter_get_value Ptr MenuLinkIter
iter'
Text -> Ptr MenuModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"menuLinkIterGetValue" 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
Gio.MenuModel.MenuModel) Ptr MenuModel
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
MenuModel -> IO MenuModel
forall (m :: * -> *) a. Monad m => a -> m a
return MenuModel
result'
#if defined(ENABLE_OVERLOADING)
data MenuLinkIterGetValueMethodInfo
instance (signature ~ (m Gio.MenuModel.MenuModel), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterGetValueMethodInfo a signature where
overloadedMethod = menuLinkIterGetValue
#endif
foreign import ccall "g_menu_link_iter_next" ::
Ptr MenuLinkIter ->
IO CInt
menuLinkIterNext ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
a
-> m Bool
a
iter = 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 MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
CInt
result <- Ptr MenuLinkIter -> IO CInt
g_menu_link_iter_next Ptr MenuLinkIter
iter'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MenuLinkIterNextMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterNextMethodInfo a signature where
overloadedMethod = menuLinkIterNext
#endif