#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.MenuAttributeIter
(
MenuAttributeIter(..) ,
IsMenuAttributeIter ,
toMenuAttributeIter ,
noMenuAttributeIter ,
#if ENABLE_OVERLOADING
MenuAttributeIterGetNameMethodInfo ,
#endif
menuAttributeIterGetName ,
#if ENABLE_OVERLOADING
MenuAttributeIterGetNextMethodInfo ,
#endif
menuAttributeIterGetNext ,
#if ENABLE_OVERLOADING
MenuAttributeIterGetValueMethodInfo ,
#endif
menuAttributeIterGetValue ,
#if 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.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 MenuAttributeIter = MenuAttributeIter (ManagedPtr MenuAttributeIter)
foreign import ccall "g_menu_attribute_iter_get_type"
c_g_menu_attribute_iter_get_type :: IO GType
instance GObject MenuAttributeIter where
gobjectType = c_g_menu_attribute_iter_get_type
class (GObject o, O.IsDescendantOf MenuAttributeIter o) => IsMenuAttributeIter 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
toMenuAttributeIter = liftIO . unsafeCastTo MenuAttributeIter
noMenuAttributeIter :: Maybe MenuAttributeIter
noMenuAttributeIter = Nothing
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList MenuAttributeIter
type instance O.AttributeList MenuAttributeIter = MenuAttributeIterAttributeList
type MenuAttributeIterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if 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" g_menu_attribute_iter_get_name ::
Ptr MenuAttributeIter ->
IO CString
menuAttributeIterGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m T.Text
menuAttributeIterGetName iter = liftIO $ do
iter' <- unsafeManagedPtrCastPtr iter
result <- g_menu_attribute_iter_get_name iter'
checkUnexpectedReturnNULL "menuAttributeIterGetName" result
result' <- cstringToText result
touchManagedPtr iter
return result'
#if 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" 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))
menuAttributeIterGetNext iter = liftIO $ do
iter' <- unsafeManagedPtrCastPtr iter
outName <- allocMem :: IO (Ptr CString)
value <- allocMem :: IO (Ptr (Ptr GVariant))
result <- g_menu_attribute_iter_get_next iter' outName value
let result' = (/= 0) result
outName' <- peek outName
outName'' <- cstringToText outName'
value' <- peek value
value'' <- B.GVariant.wrapGVariantPtr value'
touchManagedPtr iter
freeMem outName
freeMem value
return (result', outName'', value'')
#if 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" g_menu_attribute_iter_get_value ::
Ptr MenuAttributeIter ->
IO (Ptr GVariant)
menuAttributeIterGetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m GVariant
menuAttributeIterGetValue iter = liftIO $ do
iter' <- unsafeManagedPtrCastPtr iter
result <- g_menu_attribute_iter_get_value iter'
checkUnexpectedReturnNULL "menuAttributeIterGetValue" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr iter
return result'
#if 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" g_menu_attribute_iter_next ::
Ptr MenuAttributeIter ->
IO CInt
menuAttributeIterNext ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuAttributeIter a) =>
a
-> m Bool
menuAttributeIterNext iter = liftIO $ do
iter' <- unsafeManagedPtrCastPtr iter
result <- g_menu_attribute_iter_next iter'
let result' = (/= 0) result
touchManagedPtr iter
return result'
#if ENABLE_OVERLOADING
data MenuAttributeIterNextMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMenuAttributeIter a) => O.MethodInfo MenuAttributeIterNextMethodInfo a signature where
overloadedMethod _ = menuAttributeIterNext
#endif