{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.AsyncProgress
(
AsyncProgress(..) ,
IsAsyncProgress ,
toAsyncProgress ,
noAsyncProgress ,
#if defined(ENABLE_OVERLOADING)
ResolveAsyncProgressMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AsyncProgressFinishMethodInfo ,
#endif
asyncProgressFinish ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressGetStatusMethodInfo ,
#endif
asyncProgressGetStatus ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressGetUintMethodInfo ,
#endif
asyncProgressGetUint ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressGetUint64MethodInfo ,
#endif
asyncProgressGetUint64 ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressGetVariantMethodInfo ,
#endif
asyncProgressGetVariant ,
asyncProgressNew ,
asyncProgressNewAndConnect ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressSetStatusMethodInfo ,
#endif
asyncProgressSetStatus ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressSetUintMethodInfo ,
#endif
asyncProgressSetUint ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressSetUint64MethodInfo ,
#endif
asyncProgressSetUint64 ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressSetVariantMethodInfo ,
#endif
asyncProgressSetVariant ,
AsyncProgressChangedCallback ,
#if defined(ENABLE_OVERLOADING)
AsyncProgressChangedSignalInfo ,
#endif
C_AsyncProgressChangedCallback ,
afterAsyncProgressChanged ,
genClosure_AsyncProgressChanged ,
mk_AsyncProgressChangedCallback ,
noAsyncProgressChangedCallback ,
onAsyncProgressChanged ,
wrap_AsyncProgressChangedCallback ,
) 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 AsyncProgress = AsyncProgress (ManagedPtr AsyncProgress)
deriving (AsyncProgress -> AsyncProgress -> Bool
(AsyncProgress -> AsyncProgress -> Bool)
-> (AsyncProgress -> AsyncProgress -> Bool) -> Eq AsyncProgress
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AsyncProgress -> AsyncProgress -> Bool
$c/= :: AsyncProgress -> AsyncProgress -> Bool
== :: AsyncProgress -> AsyncProgress -> Bool
$c== :: AsyncProgress -> AsyncProgress -> Bool
Eq)
foreign import ccall "ostree_async_progress_get_type"
c_ostree_async_progress_get_type :: IO GType
instance GObject AsyncProgress where
gobjectType :: IO GType
gobjectType = IO GType
c_ostree_async_progress_get_type
instance B.GValue.IsGValue AsyncProgress where
toGValue :: AsyncProgress -> IO GValue
toGValue o :: AsyncProgress
o = do
GType
gtype <- IO GType
c_ostree_async_progress_get_type
AsyncProgress -> (Ptr AsyncProgress -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AsyncProgress
o (GType
-> (GValue -> Ptr AsyncProgress -> IO ())
-> Ptr AsyncProgress
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AsyncProgress -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO AsyncProgress
fromGValue gv :: GValue
gv = do
Ptr AsyncProgress
ptr <- GValue -> IO (Ptr AsyncProgress)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AsyncProgress)
(ManagedPtr AsyncProgress -> AsyncProgress)
-> Ptr AsyncProgress -> IO AsyncProgress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AsyncProgress -> AsyncProgress
AsyncProgress Ptr AsyncProgress
ptr
class (GObject o, O.IsDescendantOf AsyncProgress o) => IsAsyncProgress o
instance (GObject o, O.IsDescendantOf AsyncProgress o) => IsAsyncProgress o
instance O.HasParentTypes AsyncProgress
type instance O.ParentTypes AsyncProgress = '[GObject.Object.Object]
toAsyncProgress :: (MonadIO m, IsAsyncProgress o) => o -> m AsyncProgress
toAsyncProgress :: o -> m AsyncProgress
toAsyncProgress = IO AsyncProgress -> m AsyncProgress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AsyncProgress -> m AsyncProgress)
-> (o -> IO AsyncProgress) -> o -> m AsyncProgress
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AsyncProgress -> AsyncProgress)
-> o -> IO AsyncProgress
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr AsyncProgress -> AsyncProgress
AsyncProgress
noAsyncProgress :: Maybe AsyncProgress
noAsyncProgress :: Maybe AsyncProgress
noAsyncProgress = Maybe AsyncProgress
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAsyncProgressMethod (t :: Symbol) (o :: *) :: * where
ResolveAsyncProgressMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAsyncProgressMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAsyncProgressMethod "finish" o = AsyncProgressFinishMethodInfo
ResolveAsyncProgressMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAsyncProgressMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAsyncProgressMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAsyncProgressMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAsyncProgressMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAsyncProgressMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAsyncProgressMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAsyncProgressMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAsyncProgressMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAsyncProgressMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAsyncProgressMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAsyncProgressMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAsyncProgressMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAsyncProgressMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAsyncProgressMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAsyncProgressMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAsyncProgressMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAsyncProgressMethod "getStatus" o = AsyncProgressGetStatusMethodInfo
ResolveAsyncProgressMethod "getUint" o = AsyncProgressGetUintMethodInfo
ResolveAsyncProgressMethod "getUint64" o = AsyncProgressGetUint64MethodInfo
ResolveAsyncProgressMethod "getVariant" o = AsyncProgressGetVariantMethodInfo
ResolveAsyncProgressMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAsyncProgressMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAsyncProgressMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAsyncProgressMethod "setStatus" o = AsyncProgressSetStatusMethodInfo
ResolveAsyncProgressMethod "setUint" o = AsyncProgressSetUintMethodInfo
ResolveAsyncProgressMethod "setUint64" o = AsyncProgressSetUint64MethodInfo
ResolveAsyncProgressMethod "setVariant" o = AsyncProgressSetVariantMethodInfo
ResolveAsyncProgressMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAsyncProgressMethod t AsyncProgress, O.MethodInfo info AsyncProgress p) => OL.IsLabel t (AsyncProgress -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type AsyncProgressChangedCallback =
IO ()
noAsyncProgressChangedCallback :: Maybe AsyncProgressChangedCallback
noAsyncProgressChangedCallback :: Maybe (IO ())
noAsyncProgressChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_AsyncProgressChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AsyncProgressChangedCallback :: C_AsyncProgressChangedCallback -> IO (FunPtr C_AsyncProgressChangedCallback)
genClosure_AsyncProgressChanged :: MonadIO m => AsyncProgressChangedCallback -> m (GClosure C_AsyncProgressChangedCallback)
genClosure_AsyncProgressChanged :: IO () -> m (GClosure C_AsyncProgressChangedCallback)
genClosure_AsyncProgressChanged cb :: IO ()
cb = IO (GClosure C_AsyncProgressChangedCallback)
-> m (GClosure C_AsyncProgressChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AsyncProgressChangedCallback)
-> m (GClosure C_AsyncProgressChangedCallback))
-> IO (GClosure C_AsyncProgressChangedCallback)
-> m (GClosure C_AsyncProgressChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_AsyncProgressChangedCallback
cb' = IO () -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback IO ()
cb
C_AsyncProgressChangedCallback
-> IO (FunPtr C_AsyncProgressChangedCallback)
mk_AsyncProgressChangedCallback C_AsyncProgressChangedCallback
cb' IO (FunPtr C_AsyncProgressChangedCallback)
-> (FunPtr C_AsyncProgressChangedCallback
-> IO (GClosure C_AsyncProgressChangedCallback))
-> IO (GClosure C_AsyncProgressChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AsyncProgressChangedCallback
-> IO (GClosure C_AsyncProgressChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AsyncProgressChangedCallback ::
AsyncProgressChangedCallback ->
C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback :: IO () -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onAsyncProgressChanged :: (IsAsyncProgress a, MonadIO m) => a -> AsyncProgressChangedCallback -> m SignalHandlerId
onAsyncProgressChanged :: a -> IO () -> m SignalHandlerId
onAsyncProgressChanged obj :: a
obj cb :: IO ()
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_AsyncProgressChangedCallback
cb' = IO () -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback IO ()
cb
FunPtr C_AsyncProgressChangedCallback
cb'' <- C_AsyncProgressChangedCallback
-> IO (FunPtr C_AsyncProgressChangedCallback)
mk_AsyncProgressChangedCallback C_AsyncProgressChangedCallback
cb'
a
-> Text
-> FunPtr C_AsyncProgressChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_AsyncProgressChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterAsyncProgressChanged :: (IsAsyncProgress a, MonadIO m) => a -> AsyncProgressChangedCallback -> m SignalHandlerId
afterAsyncProgressChanged :: a -> IO () -> m SignalHandlerId
afterAsyncProgressChanged obj :: a
obj cb :: IO ()
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_AsyncProgressChangedCallback
cb' = IO () -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback IO ()
cb
FunPtr C_AsyncProgressChangedCallback
cb'' <- C_AsyncProgressChangedCallback
-> IO (FunPtr C_AsyncProgressChangedCallback)
mk_AsyncProgressChangedCallback C_AsyncProgressChangedCallback
cb'
a
-> Text
-> FunPtr C_AsyncProgressChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_AsyncProgressChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data AsyncProgressChangedSignalInfo
instance SignalInfo AsyncProgressChangedSignalInfo where
type HaskellCallbackType AsyncProgressChangedSignalInfo = AsyncProgressChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_AsyncProgressChangedCallback cb
cb'' <- mk_AsyncProgressChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AsyncProgress
type instance O.AttributeList AsyncProgress = AsyncProgressAttributeList
type AsyncProgressAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AsyncProgress = AsyncProgressSignalList
type AsyncProgressSignalList = ('[ '("changed", AsyncProgressChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ostree_async_progress_new" ostree_async_progress_new ::
IO (Ptr AsyncProgress)
asyncProgressNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AsyncProgress
asyncProgressNew :: m AsyncProgress
asyncProgressNew = IO AsyncProgress -> m AsyncProgress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AsyncProgress -> m AsyncProgress)
-> IO AsyncProgress -> m AsyncProgress
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncProgress
result <- IO (Ptr AsyncProgress)
ostree_async_progress_new
Text -> Ptr AsyncProgress -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "asyncProgressNew" Ptr AsyncProgress
result
AsyncProgress
result' <- ((ManagedPtr AsyncProgress -> AsyncProgress)
-> Ptr AsyncProgress -> IO AsyncProgress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr AsyncProgress -> AsyncProgress
AsyncProgress) Ptr AsyncProgress
result
AsyncProgress -> IO AsyncProgress
forall (m :: * -> *) a. Monad m => a -> m a
return AsyncProgress
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_async_progress_new_and_connect" ostree_async_progress_new_and_connect ::
Ptr () ->
Ptr () ->
IO (Ptr AsyncProgress)
asyncProgressNewAndConnect ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> Ptr ()
-> m AsyncProgress
asyncProgressNewAndConnect :: Ptr () -> Ptr () -> m AsyncProgress
asyncProgressNewAndConnect changed :: Ptr ()
changed userData :: Ptr ()
userData = IO AsyncProgress -> m AsyncProgress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AsyncProgress -> m AsyncProgress)
-> IO AsyncProgress -> m AsyncProgress
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncProgress
result <- Ptr () -> Ptr () -> IO (Ptr AsyncProgress)
ostree_async_progress_new_and_connect Ptr ()
changed Ptr ()
userData
Text -> Ptr AsyncProgress -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "asyncProgressNewAndConnect" Ptr AsyncProgress
result
AsyncProgress
result' <- ((ManagedPtr AsyncProgress -> AsyncProgress)
-> Ptr AsyncProgress -> IO AsyncProgress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr AsyncProgress -> AsyncProgress
AsyncProgress) Ptr AsyncProgress
result
AsyncProgress -> IO AsyncProgress
forall (m :: * -> *) a. Monad m => a -> m a
return AsyncProgress
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_async_progress_finish" ostree_async_progress_finish ::
Ptr AsyncProgress ->
IO ()
asyncProgressFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> m ()
asyncProgressFinish :: a -> m ()
asyncProgressFinish self :: a
self = 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 AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncProgress -> IO ()
ostree_async_progress_finish Ptr AsyncProgress
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AsyncProgressFinishMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressFinishMethodInfo a signature where
overloadedMethod = asyncProgressFinish
#endif
foreign import ccall "ostree_async_progress_get_status" ostree_async_progress_get_status ::
Ptr AsyncProgress ->
IO CString
asyncProgressGetStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> m (Maybe T.Text)
asyncProgressGetStatus :: a -> m (Maybe Text)
asyncProgressGetStatus self :: a
self = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr AsyncProgress -> IO CString
ostree_async_progress_get_status Ptr AsyncProgress
self'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetStatusMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressGetStatusMethodInfo a signature where
overloadedMethod = asyncProgressGetStatus
#endif
foreign import ccall "ostree_async_progress_get_uint" ostree_async_progress_get_uint ::
Ptr AsyncProgress ->
CString ->
IO Word32
asyncProgressGetUint ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> T.Text
-> m Word32
asyncProgressGetUint :: a -> Text -> m Word32
asyncProgressGetUint self :: a
self key :: Text
key = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
Word32
result <- Ptr AsyncProgress -> CString -> IO Word32
ostree_async_progress_get_uint Ptr AsyncProgress
self' CString
key'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetUintMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressGetUintMethodInfo a signature where
overloadedMethod = asyncProgressGetUint
#endif
foreign import ccall "ostree_async_progress_get_uint64" ostree_async_progress_get_uint64 ::
Ptr AsyncProgress ->
CString ->
IO Word64
asyncProgressGetUint64 ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> T.Text
-> m Word64
asyncProgressGetUint64 :: a -> Text -> m Word64
asyncProgressGetUint64 self :: a
self key :: Text
key = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
Word64
result <- Ptr AsyncProgress -> CString -> IO Word64
ostree_async_progress_get_uint64 Ptr AsyncProgress
self' CString
key'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetUint64MethodInfo
instance (signature ~ (T.Text -> m Word64), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressGetUint64MethodInfo a signature where
overloadedMethod = asyncProgressGetUint64
#endif
foreign import ccall "ostree_async_progress_get_variant" ostree_async_progress_get_variant ::
Ptr AsyncProgress ->
CString ->
IO (Ptr GVariant)
asyncProgressGetVariant ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> T.Text
-> m (Maybe GVariant)
asyncProgressGetVariant :: a -> Text -> m (Maybe GVariant)
asyncProgressGetVariant self :: a
self key :: Text
key = IO (Maybe GVariant) -> m (Maybe GVariant)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr GVariant
result <- Ptr AsyncProgress -> CString -> IO (Ptr GVariant)
ostree_async_progress_get_variant Ptr AsyncProgress
self' CString
key'
Maybe GVariant
maybeResult <- Ptr GVariant
-> (Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GVariant
result ((Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant))
-> (Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr GVariant
result' -> do
GVariant
result'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result'
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Maybe GVariant -> IO (Maybe GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GVariant
maybeResult
#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetVariantMethodInfo
instance (signature ~ (T.Text -> m (Maybe GVariant)), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressGetVariantMethodInfo a signature where
overloadedMethod = asyncProgressGetVariant
#endif
foreign import ccall "ostree_async_progress_set_status" ostree_async_progress_set_status ::
Ptr AsyncProgress ->
CString ->
IO ()
asyncProgressSetStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> Maybe (T.Text)
-> m ()
asyncProgressSetStatus :: a -> Maybe Text -> m ()
asyncProgressSetStatus self :: a
self status :: Maybe Text
status = 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 AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeStatus <- case Maybe Text
status of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jStatus :: Text
jStatus -> do
CString
jStatus' <- Text -> IO CString
textToCString Text
jStatus
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jStatus'
Ptr AsyncProgress -> CString -> IO ()
ostree_async_progress_set_status Ptr AsyncProgress
self' CString
maybeStatus
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeStatus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetStatusMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressSetStatusMethodInfo a signature where
overloadedMethod = asyncProgressSetStatus
#endif
foreign import ccall "ostree_async_progress_set_uint" ostree_async_progress_set_uint ::
Ptr AsyncProgress ->
CString ->
Word32 ->
IO ()
asyncProgressSetUint ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> T.Text
-> Word32
-> m ()
asyncProgressSetUint :: a -> Text -> Word32 -> m ()
asyncProgressSetUint self :: a
self key :: Text
key value :: Word32
value = 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 AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr AsyncProgress -> CString -> Word32 -> IO ()
ostree_async_progress_set_uint Ptr AsyncProgress
self' CString
key' Word32
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetUintMethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressSetUintMethodInfo a signature where
overloadedMethod = asyncProgressSetUint
#endif
foreign import ccall "ostree_async_progress_set_uint64" ostree_async_progress_set_uint64 ::
Ptr AsyncProgress ->
CString ->
Word64 ->
IO ()
asyncProgressSetUint64 ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> T.Text
-> Word64
-> m ()
asyncProgressSetUint64 :: a -> Text -> Word64 -> m ()
asyncProgressSetUint64 self :: a
self key :: Text
key value :: Word64
value = 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 AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr AsyncProgress -> CString -> Word64 -> IO ()
ostree_async_progress_set_uint64 Ptr AsyncProgress
self' CString
key' Word64
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetUint64MethodInfo
instance (signature ~ (T.Text -> Word64 -> m ()), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressSetUint64MethodInfo a signature where
overloadedMethod = asyncProgressSetUint64
#endif
foreign import ccall "ostree_async_progress_set_variant" ostree_async_progress_set_variant ::
Ptr AsyncProgress ->
CString ->
Ptr GVariant ->
IO ()
asyncProgressSetVariant ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
a
-> T.Text
-> GVariant
-> m ()
asyncProgressSetVariant :: a -> Text -> GVariant -> m ()
asyncProgressSetVariant self :: a
self key :: Text
key value :: GVariant
value = 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 AsyncProgress
self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr GVariant
value' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
value
Ptr AsyncProgress -> CString -> Ptr GVariant -> IO ()
ostree_async_progress_set_variant Ptr AsyncProgress
self' CString
key' Ptr GVariant
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
value
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetVariantMethodInfo
instance (signature ~ (T.Text -> GVariant -> m ()), MonadIO m, IsAsyncProgress a) => O.MethodInfo AsyncProgressSetVariantMethodInfo a signature where
overloadedMethod = asyncProgressSetVariant
#endif