{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Interfaces.RepoFinder
(
RepoFinder(..) ,
IsRepoFinder ,
toRepoFinder ,
#if defined(ENABLE_OVERLOADING)
ResolveRepoFinderMethod ,
#endif
repoFinderResolveAllAsync ,
repoFinderResolveAllFinish ,
#if defined(ENABLE_OVERLOADING)
RepoFinderResolveAsyncMethodInfo ,
#endif
repoFinderResolveAsync ,
#if defined(ENABLE_OVERLOADING)
RepoFinderResolveFinishMethodInfo ,
#endif
repoFinderResolveFinish ,
) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
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 GHC.Records as R
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
newtype RepoFinder = RepoFinder (SP.ManagedPtr RepoFinder)
deriving (RepoFinder -> RepoFinder -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepoFinder -> RepoFinder -> Bool
$c/= :: RepoFinder -> RepoFinder -> Bool
== :: RepoFinder -> RepoFinder -> Bool
$c== :: RepoFinder -> RepoFinder -> Bool
Eq)
instance SP.ManagedPtrNewtype RepoFinder where
toManagedPtr :: RepoFinder -> ManagedPtr RepoFinder
toManagedPtr (RepoFinder ManagedPtr RepoFinder
p) = ManagedPtr RepoFinder
p
foreign import ccall "ostree_repo_finder_get_type"
c_ostree_repo_finder_get_type :: IO B.Types.GType
instance B.Types.TypedObject RepoFinder where
glibType :: IO GType
glibType = IO GType
c_ostree_repo_finder_get_type
instance B.Types.GObject RepoFinder
class (SP.GObject o, O.IsDescendantOf RepoFinder o) => IsRepoFinder o
instance (SP.GObject o, O.IsDescendantOf RepoFinder o) => IsRepoFinder o
instance O.HasParentTypes RepoFinder
type instance O.ParentTypes RepoFinder = '[GObject.Object.Object]
toRepoFinder :: (MIO.MonadIO m, IsRepoFinder o) => o -> m RepoFinder
toRepoFinder :: forall (m :: * -> *) o.
(MonadIO m, IsRepoFinder o) =>
o -> m RepoFinder
toRepoFinder = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr RepoFinder -> RepoFinder
RepoFinder
instance B.GValue.IsGValue (Maybe RepoFinder) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_repo_finder_get_type
gvalueSet_ :: Ptr GValue -> Maybe RepoFinder -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RepoFinder
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr RepoFinder)
gvalueSet_ Ptr GValue
gv (P.Just RepoFinder
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinder
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe RepoFinder)
gvalueGet_ Ptr GValue
gv = do
Ptr RepoFinder
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr RepoFinder)
if Ptr RepoFinder
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RepoFinder -> RepoFinder
RepoFinder Ptr RepoFinder
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RepoFinder
type instance O.AttributeList RepoFinder = RepoFinderAttributeList
type RepoFinderAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveRepoFinderMethod (t :: Symbol) (o :: *) :: * where
ResolveRepoFinderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRepoFinderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRepoFinderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRepoFinderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRepoFinderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRepoFinderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRepoFinderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRepoFinderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRepoFinderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRepoFinderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRepoFinderMethod "resolveAsync" o = RepoFinderResolveAsyncMethodInfo
ResolveRepoFinderMethod "resolveFinish" o = RepoFinderResolveFinishMethodInfo
ResolveRepoFinderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRepoFinderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRepoFinderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRepoFinderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRepoFinderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRepoFinderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRepoFinderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRepoFinderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRepoFinderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRepoFinderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRepoFinderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRepoFinderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRepoFinderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRepoFinderMethod t RepoFinder, O.OverloadedMethod info RepoFinder p) => OL.IsLabel t (RepoFinder -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveRepoFinderMethod t RepoFinder, O.OverloadedMethod info RepoFinder p, R.HasField t RepoFinder p) => R.HasField t RepoFinder p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRepoFinderMethod t RepoFinder, O.OverloadedMethodInfo info RepoFinder) => OL.IsLabel t (O.MethodProxy info RepoFinder) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "ostree_repo_finder_resolve_async" ostree_repo_finder_resolve_async ::
Ptr RepoFinder ->
Ptr (Ptr OSTree.CollectionRef.CollectionRef) ->
Ptr OSTree.Repo.Repo ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
repoFinderResolveAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepoFinder a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
a
-> [OSTree.CollectionRef.CollectionRef]
-> b
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
repoFinderResolveAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepoFinder a, IsRepo b,
IsCancellable c) =>
a
-> [CollectionRef]
-> b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoFinderResolveAsync a
self [CollectionRef]
refs b
parentRepo Maybe c
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinder
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
[Ptr CollectionRef]
refs' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [CollectionRef]
refs
Ptr (Ptr CollectionRef)
refs'' <- forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr CollectionRef]
refs'
Ptr Repo
parentRepo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
parentRepo
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = forall a. Ptr a
nullPtr
Ptr RepoFinder
-> Ptr (Ptr CollectionRef)
-> Ptr Repo
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_finder_resolve_async Ptr RepoFinder
self' Ptr (Ptr CollectionRef)
refs'' Ptr Repo
parentRepo' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback forall a. Ptr a
userData
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [CollectionRef]
refs
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
parentRepo
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CollectionRef)
refs''
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoFinderResolveAsyncMethodInfo
instance (signature ~ ([OSTree.CollectionRef.CollectionRef] -> b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepoFinder a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod RepoFinderResolveAsyncMethodInfo a signature where
overloadedMethod = repoFinderResolveAsync
instance O.OverloadedMethodInfo RepoFinderResolveAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-RepoFinder.html#v:repoFinderResolveAsync"
})
#endif
foreign import ccall "ostree_repo_finder_resolve_finish" ostree_repo_finder_resolve_finish ::
Ptr RepoFinder ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GPtrArray (Ptr OSTree.RepoFinderResult.RepoFinderResult)))
repoFinderResolveFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsRepoFinder a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [OSTree.RepoFinderResult.RepoFinderResult]
repoFinderResolveFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepoFinder a, IsAsyncResult b) =>
a -> b -> m [RepoFinderResult]
repoFinderResolveFinish a
self b
result_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinder
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GPtrArray (Ptr RepoFinderResult))
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr RepoFinder
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
ostree_repo_finder_resolve_finish Ptr RepoFinder
self' Ptr AsyncResult
result_'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderResolveFinish" Ptr (GPtrArray (Ptr RepoFinderResult))
result
[Ptr RepoFinderResult]
result' <- forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
[RepoFinderResult]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoFinderResult -> RepoFinderResult
OSTree.RepoFinderResult.RepoFinderResult) [Ptr RepoFinderResult]
result'
forall a. Ptr (GPtrArray a) -> IO ()
unrefPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
forall (m :: * -> *) a. Monad m => a -> m a
return [RepoFinderResult]
result''
) (do
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoFinderResolveFinishMethodInfo
instance (signature ~ (b -> m [OSTree.RepoFinderResult.RepoFinderResult]), MonadIO m, IsRepoFinder a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod RepoFinderResolveFinishMethodInfo a signature where
overloadedMethod = repoFinderResolveFinish
instance O.OverloadedMethodInfo RepoFinderResolveFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Interfaces.RepoFinder.repoFinderResolveFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-RepoFinder.html#v:repoFinderResolveFinish"
})
#endif
foreign import ccall "ostree_repo_finder_resolve_all_async" ostree_repo_finder_resolve_all_async ::
Ptr (Ptr RepoFinder) ->
Ptr (Ptr OSTree.CollectionRef.CollectionRef) ->
Ptr OSTree.Repo.Repo ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
repoFinderResolveAllAsync ::
(B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a, Gio.Cancellable.IsCancellable b) =>
[RepoFinder]
-> [OSTree.CollectionRef.CollectionRef]
-> a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
repoFinderResolveAllAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
[RepoFinder]
-> [CollectionRef]
-> a
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
repoFinderResolveAllAsync [RepoFinder]
finders [CollectionRef]
refs a
parentRepo Maybe b
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
[Ptr RepoFinder]
finders' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [RepoFinder]
finders
Ptr (Ptr RepoFinder)
finders'' <- forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr RepoFinder]
finders'
[Ptr CollectionRef]
refs' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [CollectionRef]
refs
Ptr (Ptr CollectionRef)
refs'' <- forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr CollectionRef]
refs'
Ptr Repo
parentRepo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
parentRepo
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = forall a. Ptr a
nullPtr
Ptr (Ptr RepoFinder)
-> Ptr (Ptr CollectionRef)
-> Ptr Repo
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_finder_resolve_all_async Ptr (Ptr RepoFinder)
finders'' Ptr (Ptr CollectionRef)
refs'' Ptr Repo
parentRepo' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback forall a. Ptr a
userData
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [RepoFinder]
finders
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [CollectionRef]
refs
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
parentRepo
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr RepoFinder)
finders''
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CollectionRef)
refs''
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_finder_resolve_all_finish" ostree_repo_finder_resolve_all_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GPtrArray (Ptr OSTree.RepoFinderResult.RepoFinderResult)))
repoFinderResolveAllFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m [OSTree.RepoFinderResult.RepoFinderResult]
repoFinderResolveAllFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m [RepoFinderResult]
repoFinderResolveAllFinish a
result_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
result_' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GPtrArray (Ptr RepoFinderResult))
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult
-> Ptr (Ptr GError) -> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
ostree_repo_finder_resolve_all_finish Ptr AsyncResult
result_'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderResolveAllFinish" Ptr (GPtrArray (Ptr RepoFinderResult))
result
[Ptr RepoFinderResult]
result' <- forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
[RepoFinderResult]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoFinderResult -> RepoFinderResult
OSTree.RepoFinderResult.RepoFinderResult) [Ptr RepoFinderResult]
result'
forall a. Ptr (GPtrArray a) -> IO ()
unrefPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
forall (m :: * -> *) a. Monad m => a -> m a
return [RepoFinderResult]
result''
) (do
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RepoFinder = RepoFinderSignalList
type RepoFinderSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif