{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.MenuAttributeIter
(
MenuAttributeIter(..) ,
IsMenuAttributeIter ,
toMenuAttributeIter ,
noMenuAttributeIter ,
#if defined(ENABLE_OVERLOADING)
ResolveMenuAttributeIterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MenuAttributeIterGetNameMethodInfo ,
#endif
menuAttributeIterGetName ,
#if defined(ENABLE_OVERLOADING)
MenuAttributeIterGetNextMethodInfo ,
#endif
menuAttributeIterGetNext ,
#if defined(ENABLE_OVERLOADING)
MenuAttributeIterGetValueMethodInfo ,
#endif
menuAttributeIterGetValue ,
#if defined(ENABLE_OVERLOADING)
MenuAttributeIterNextMethodInfo ,
#endif
menuAttributeIterNext ,
) 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.GObject.Objects.Object as GObject.Object
newtype = (ManagedPtr MenuAttributeIter)
deriving (MenuAttributeIter -> MenuAttributeIter -> Bool
(MenuAttributeIter -> MenuAttributeIter -> Bool)
-> (MenuAttributeIter -> MenuAttributeIter -> Bool)
-> Eq MenuAttributeIter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MenuAttributeIter -> MenuAttributeIter -> Bool
$c/= :: MenuAttributeIter -> MenuAttributeIter -> Bool
== :: MenuAttributeIter -> MenuAttributeIter -> Bool
$c== :: MenuAttributeIter -> MenuAttributeIter -> Bool
Eq)
foreign import ccall "g_menu_attribute_iter_get_type"
:: IO GType
instance GObject MenuAttributeIter where
gobjectType :: IO GType
gobjectType = IO GType
c_g_menu_attribute_iter_get_type
instance B.GValue.IsGValue MenuAttributeIter where
toGValue :: MenuAttributeIter -> IO GValue
toGValue o :: MenuAttributeIter
o = do
GType
gtype <- IO GType
c_g_menu_attribute_iter_get_type
MenuAttributeIter
-> (Ptr MenuAttributeIter -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MenuAttributeIter
o (GType
-> (GValue -> Ptr MenuAttributeIter -> IO ())
-> Ptr MenuAttributeIter
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr MenuAttributeIter -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO MenuAttributeIter
fromGValue gv :: GValue
gv = do
Ptr MenuAttributeIter
ptr <- GValue -> IO (Ptr MenuAttributeIter)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr MenuAttributeIter)
(ManagedPtr MenuAttributeIter -> MenuAttributeIter)
-> Ptr MenuAttributeIter -> IO MenuAttributeIter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr MenuAttributeIter -> MenuAttributeIter
MenuAttributeIter Ptr MenuAttributeIter
ptr
class (GObject o, O.IsDescendantOf MenuAttributeIter o) => o
instance (GObject o, O.IsDescendantOf MenuAttributeIter o) => IsMenuAttributeIter o
instance O.HasParentTypes MenuAttributeIter
type instance O.ParentTypes MenuAttributeIter = '[GObject.Object.Object]
toMenuAttributeIter :: (MonadIO m, IsMenuAttributeIter o) => o -> m MenuAttributeIter
= IO MenuAttributeIter -> m MenuAttributeIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuAttributeIter -> m MenuAttributeIter)
-> (o -> IO MenuAttributeIter) -> o -> m MenuAttributeIter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MenuAttributeIter -> MenuAttributeIter)
-> o -> IO MenuAttributeIter
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr MenuAttributeIter -> MenuAttributeIter
MenuAttributeIter
noMenuAttributeIter :: Maybe MenuAttributeIter
= Maybe MenuAttributeIter
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveMenuAttributeIterMethod (t :: Symbol) (o :: *) :: * where
ResolveMenuAttributeIterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMenuAttributeIterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMenuAttributeIterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMenuAttributeIterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMenuAttributeIterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMenuAttributeIterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMenuAttributeIterMethod "next" o = MenuAttributeIterNextMethodInfo
ResolveMenuAttributeIterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMenuAttributeIterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMenuAttributeIterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMenuAttributeIterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMenuAttributeIterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMenuAttributeIterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMenuAttributeIterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMenuAttributeIterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMenuAttributeIterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMenuAttributeIterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMenuAttributeIterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMenuAttributeIterMethod "getName" o = MenuAttributeIterGetNameMethodInfo
ResolveMenuAttributeIterMethod "getNext" o = MenuAttributeIterGetNextMethodInfo
ResolveMenuAttributeIterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMenuAttributeIterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMenuAttributeIterMethod "getValue" o = MenuAttributeIterGetValueMethodInfo
ResolveMenuAttributeIterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMenuAttributeIterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMenuAttributeIterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMenuAttributeIterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMenuAttributeIterMethod t MenuAttributeIter, O.MethodInfo info MenuAttributeIter p) => OL.IsLabel t (MenuAttributeIter -> 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 MenuAttributeIter
type instance O.AttributeList MenuAttributeIter = MenuAttributeIterAttributeList
type MenuAttributeIterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList MenuAttributeIter = MenuAttributeIterSignalList
type MenuAttributeIterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_menu_attribute_iter_get_name" ::
Ptr MenuAttributeIter ->
IO CString
menuAttributeIterGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m T.Text
iter :: 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 MenuAttributeIter
iter' <- a -> IO (Ptr MenuAttributeIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
CString
result <- Ptr MenuAttributeIter -> IO CString
g_menu_attribute_iter_get_name Ptr MenuAttributeIter
iter'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuAttributeIterGetName" 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 MenuAttributeIterGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMenuAttributeIter a) => O.MethodInfo MenuAttributeIterGetNameMethodInfo a signature where
overloadedMethod = menuAttributeIterGetName
#endif
foreign import ccall "g_menu_attribute_iter_get_next" ::
Ptr MenuAttributeIter ->
Ptr CString ->
Ptr (Ptr GVariant) ->
IO CInt
menuAttributeIterGetNext ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m ((Bool, T.Text, GVariant))
iter :: a
iter = IO (Bool, Text, GVariant) -> m (Bool, Text, GVariant)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Text, GVariant) -> m (Bool, Text, GVariant))
-> IO (Bool, Text, GVariant) -> m (Bool, Text, GVariant)
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuAttributeIter
iter' <- a -> IO (Ptr MenuAttributeIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Ptr CString
outName <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
Ptr (Ptr GVariant)
value <- IO (Ptr (Ptr GVariant))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GVariant))
CInt
result <- Ptr MenuAttributeIter
-> Ptr CString -> Ptr (Ptr GVariant) -> IO CInt
g_menu_attribute_iter_get_next Ptr MenuAttributeIter
iter' Ptr CString
outName Ptr (Ptr GVariant)
value
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CString
outName' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outName
Text
outName'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outName'
Ptr GVariant
value' <- Ptr (Ptr GVariant) -> IO (Ptr GVariant)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GVariant)
value
GVariant
value'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outName
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
value
(Bool, Text, GVariant) -> IO (Bool, Text, GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Text
outName'', GVariant
value'')
#if defined(ENABLE_OVERLOADING)
data MenuAttributeIterGetNextMethodInfo
instance (signature ~ (m ((Bool, T.Text, GVariant))), MonadIO m, IsMenuAttributeIter a) => O.MethodInfo MenuAttributeIterGetNextMethodInfo a signature where
overloadedMethod = menuAttributeIterGetNext
#endif
foreign import ccall "g_menu_attribute_iter_get_value" ::
Ptr MenuAttributeIter ->
IO (Ptr GVariant)
menuAttributeIterGetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m GVariant
iter :: a
iter = 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 MenuAttributeIter
iter' <- a -> IO (Ptr MenuAttributeIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Ptr GVariant
result <- Ptr MenuAttributeIter -> IO (Ptr GVariant)
g_menu_attribute_iter_get_value Ptr MenuAttributeIter
iter'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuAttributeIterGetValue" 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
iter
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data MenuAttributeIterGetValueMethodInfo
instance (signature ~ (m GVariant), MonadIO m, IsMenuAttributeIter a) => O.MethodInfo MenuAttributeIterGetValueMethodInfo a signature where
overloadedMethod = menuAttributeIterGetValue
#endif
foreign import ccall "g_menu_attribute_iter_next" ::
Ptr MenuAttributeIter ->
IO CInt
menuAttributeIterNext ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m Bool
iter :: 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 MenuAttributeIter
iter' <- a -> IO (Ptr MenuAttributeIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
CInt
result <- Ptr MenuAttributeIter -> IO CInt
g_menu_attribute_iter_next Ptr MenuAttributeIter
iter'
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
iter
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MenuAttributeIterNextMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMenuAttributeIter a) => O.MethodInfo MenuAttributeIterNextMethodInfo a signature where
overloadedMethod = menuAttributeIterNext
#endif