{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.SimpleAsyncResult
(
SimpleAsyncResult(..) ,
IsSimpleAsyncResult ,
toSimpleAsyncResult ,
#if defined(ENABLE_OVERLOADING)
ResolveSimpleAsyncResultMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultCompleteMethodInfo ,
#endif
simpleAsyncResultComplete ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultCompleteInIdleMethodInfo,
#endif
simpleAsyncResultCompleteInIdle ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultGetOpResGbooleanMethodInfo,
#endif
simpleAsyncResultGetOpResGboolean ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultGetOpResGssizeMethodInfo,
#endif
simpleAsyncResultGetOpResGssize ,
simpleAsyncResultIsValid ,
simpleAsyncResultNew ,
simpleAsyncResultNewFromError ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultPropagateErrorMethodInfo,
#endif
simpleAsyncResultPropagateError ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultSetCheckCancellableMethodInfo,
#endif
simpleAsyncResultSetCheckCancellable ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultSetFromErrorMethodInfo ,
#endif
simpleAsyncResultSetFromError ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultSetHandleCancellationMethodInfo,
#endif
simpleAsyncResultSetHandleCancellation ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultSetOpResGbooleanMethodInfo,
#endif
simpleAsyncResultSetOpResGboolean ,
#if defined(ENABLE_OVERLOADING)
SimpleAsyncResultSetOpResGssizeMethodInfo,
#endif
simpleAsyncResultSetOpResGssize ,
) 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.Kind as DK
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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
#endif
newtype SimpleAsyncResult = SimpleAsyncResult (SP.ManagedPtr SimpleAsyncResult)
deriving (SimpleAsyncResult -> SimpleAsyncResult -> Bool
(SimpleAsyncResult -> SimpleAsyncResult -> Bool)
-> (SimpleAsyncResult -> SimpleAsyncResult -> Bool)
-> Eq SimpleAsyncResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SimpleAsyncResult -> SimpleAsyncResult -> Bool
== :: SimpleAsyncResult -> SimpleAsyncResult -> Bool
$c/= :: SimpleAsyncResult -> SimpleAsyncResult -> Bool
/= :: SimpleAsyncResult -> SimpleAsyncResult -> Bool
Eq)
instance SP.ManagedPtrNewtype SimpleAsyncResult where
toManagedPtr :: SimpleAsyncResult -> ManagedPtr SimpleAsyncResult
toManagedPtr (SimpleAsyncResult ManagedPtr SimpleAsyncResult
p) = ManagedPtr SimpleAsyncResult
p
foreign import ccall "g_simple_async_result_get_type"
c_g_simple_async_result_get_type :: IO B.Types.GType
instance B.Types.TypedObject SimpleAsyncResult where
glibType :: IO GType
glibType = IO GType
c_g_simple_async_result_get_type
instance B.Types.GObject SimpleAsyncResult
class (SP.GObject o, O.IsDescendantOf SimpleAsyncResult o) => IsSimpleAsyncResult o
instance (SP.GObject o, O.IsDescendantOf SimpleAsyncResult o) => IsSimpleAsyncResult o
instance O.HasParentTypes SimpleAsyncResult
type instance O.ParentTypes SimpleAsyncResult = '[GObject.Object.Object, Gio.AsyncResult.AsyncResult]
toSimpleAsyncResult :: (MIO.MonadIO m, IsSimpleAsyncResult o) => o -> m SimpleAsyncResult
toSimpleAsyncResult :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAsyncResult o) =>
o -> m SimpleAsyncResult
toSimpleAsyncResult = IO SimpleAsyncResult -> m SimpleAsyncResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SimpleAsyncResult -> m SimpleAsyncResult)
-> (o -> IO SimpleAsyncResult) -> o -> m SimpleAsyncResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SimpleAsyncResult -> SimpleAsyncResult)
-> o -> IO SimpleAsyncResult
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SimpleAsyncResult -> SimpleAsyncResult
SimpleAsyncResult
instance B.GValue.IsGValue (Maybe SimpleAsyncResult) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_simple_async_result_get_type
gvalueSet_ :: Ptr GValue -> Maybe SimpleAsyncResult -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SimpleAsyncResult
P.Nothing = Ptr GValue -> Ptr SimpleAsyncResult -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SimpleAsyncResult
forall a. Ptr a
FP.nullPtr :: FP.Ptr SimpleAsyncResult)
gvalueSet_ Ptr GValue
gv (P.Just SimpleAsyncResult
obj) = SimpleAsyncResult -> (Ptr SimpleAsyncResult -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SimpleAsyncResult
obj (Ptr GValue -> Ptr SimpleAsyncResult -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SimpleAsyncResult)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr SimpleAsyncResult)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SimpleAsyncResult)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject SimpleAsyncResult ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSimpleAsyncResultMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSimpleAsyncResultMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSimpleAsyncResultMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSimpleAsyncResultMethod "complete" o = SimpleAsyncResultCompleteMethodInfo
ResolveSimpleAsyncResultMethod "completeInIdle" o = SimpleAsyncResultCompleteInIdleMethodInfo
ResolveSimpleAsyncResultMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSimpleAsyncResultMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSimpleAsyncResultMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSimpleAsyncResultMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSimpleAsyncResultMethod "isTagged" o = Gio.AsyncResult.AsyncResultIsTaggedMethodInfo
ResolveSimpleAsyncResultMethod "legacyPropagateError" o = Gio.AsyncResult.AsyncResultLegacyPropagateErrorMethodInfo
ResolveSimpleAsyncResultMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSimpleAsyncResultMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSimpleAsyncResultMethod "propagateError" o = SimpleAsyncResultPropagateErrorMethodInfo
ResolveSimpleAsyncResultMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSimpleAsyncResultMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSimpleAsyncResultMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSimpleAsyncResultMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSimpleAsyncResultMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSimpleAsyncResultMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSimpleAsyncResultMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSimpleAsyncResultMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSimpleAsyncResultMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSimpleAsyncResultMethod "getOpResGboolean" o = SimpleAsyncResultGetOpResGbooleanMethodInfo
ResolveSimpleAsyncResultMethod "getOpResGssize" o = SimpleAsyncResultGetOpResGssizeMethodInfo
ResolveSimpleAsyncResultMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSimpleAsyncResultMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSimpleAsyncResultMethod "getSourceObject" o = Gio.AsyncResult.AsyncResultGetSourceObjectMethodInfo
ResolveSimpleAsyncResultMethod "getUserData" o = Gio.AsyncResult.AsyncResultGetUserDataMethodInfo
ResolveSimpleAsyncResultMethod "setCheckCancellable" o = SimpleAsyncResultSetCheckCancellableMethodInfo
ResolveSimpleAsyncResultMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSimpleAsyncResultMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSimpleAsyncResultMethod "setFromError" o = SimpleAsyncResultSetFromErrorMethodInfo
ResolveSimpleAsyncResultMethod "setHandleCancellation" o = SimpleAsyncResultSetHandleCancellationMethodInfo
ResolveSimpleAsyncResultMethod "setOpResGboolean" o = SimpleAsyncResultSetOpResGbooleanMethodInfo
ResolveSimpleAsyncResultMethod "setOpResGssize" o = SimpleAsyncResultSetOpResGssizeMethodInfo
ResolveSimpleAsyncResultMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSimpleAsyncResultMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSimpleAsyncResultMethod t SimpleAsyncResult, O.OverloadedMethod info SimpleAsyncResult p) => OL.IsLabel t (SimpleAsyncResult -> 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 ~ ResolveSimpleAsyncResultMethod t SimpleAsyncResult, O.OverloadedMethod info SimpleAsyncResult p, R.HasField t SimpleAsyncResult p) => R.HasField t SimpleAsyncResult p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSimpleAsyncResultMethod t SimpleAsyncResult, O.OverloadedMethodInfo info SimpleAsyncResult) => OL.IsLabel t (O.MethodProxy info SimpleAsyncResult) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SimpleAsyncResult
type instance O.AttributeList SimpleAsyncResult = SimpleAsyncResultAttributeList
type SimpleAsyncResultAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SimpleAsyncResult = SimpleAsyncResultSignalList
type SimpleAsyncResultSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_simple_async_result_new" g_simple_async_result_new ::
Ptr GObject.Object.Object ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
Ptr () ->
IO (Ptr SimpleAsyncResult)
{-# DEPRECATED simpleAsyncResultNew ["(Since version 2.46)","Use 'GI.Gio.Objects.Task.taskNew' instead."] #-}
simpleAsyncResultNew ::
(B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> Ptr ()
-> m SimpleAsyncResult
simpleAsyncResultNew :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsObject a) =>
Maybe a
-> Maybe AsyncReadyCallback -> Ptr () -> m SimpleAsyncResult
simpleAsyncResultNew Maybe a
sourceObject Maybe AsyncReadyCallback
callback Ptr ()
sourceTag = IO SimpleAsyncResult -> m SimpleAsyncResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SimpleAsyncResult -> m SimpleAsyncResult)
-> IO SimpleAsyncResult -> m SimpleAsyncResult
forall a b. (a -> b) -> a -> b
$ do
maybeSourceObject <- case Maybe a
sourceObject of
Maybe a
Nothing -> Ptr Object -> IO (Ptr Object)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
FP.nullPtr
Just a
jSourceObject -> do
jSourceObject' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jSourceObject
return jSourceObject'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
result <- g_simple_async_result_new maybeSourceObject maybeCallback userData sourceTag
checkUnexpectedReturnNULL "simpleAsyncResultNew" result
result' <- (wrapObject SimpleAsyncResult) result
whenJust sourceObject touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_simple_async_result_new_from_error" g_simple_async_result_new_from_error ::
Ptr GObject.Object.Object ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
Ptr GError ->
IO (Ptr SimpleAsyncResult)
{-# DEPRECATED simpleAsyncResultNewFromError ["(Since version 2.46)","Use 'GI.Gio.Objects.Task.taskNew' and 'GI.Gio.Objects.Task.taskReturnError' instead."] #-}
simpleAsyncResultNewFromError ::
(B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> GError
-> m SimpleAsyncResult
simpleAsyncResultNewFromError :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsObject a) =>
Maybe a
-> Maybe AsyncReadyCallback -> GError -> m SimpleAsyncResult
simpleAsyncResultNewFromError Maybe a
sourceObject Maybe AsyncReadyCallback
callback GError
error_ = IO SimpleAsyncResult -> m SimpleAsyncResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SimpleAsyncResult -> m SimpleAsyncResult)
-> IO SimpleAsyncResult -> m SimpleAsyncResult
forall a b. (a -> b) -> a -> b
$ do
maybeSourceObject <- case Maybe a
sourceObject of
Maybe a
Nothing -> Ptr Object -> IO (Ptr Object)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
FP.nullPtr
Just a
jSourceObject -> do
jSourceObject' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jSourceObject
return jSourceObject'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
error_' <- unsafeManagedPtrGetPtr error_
let userData = Ptr a
forall a. Ptr a
nullPtr
result <- g_simple_async_result_new_from_error maybeSourceObject maybeCallback userData error_'
checkUnexpectedReturnNULL "simpleAsyncResultNewFromError" result
result' <- (wrapObject SimpleAsyncResult) result
whenJust sourceObject touchManagedPtr
touchManagedPtr error_
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_simple_async_result_complete" g_simple_async_result_complete ::
Ptr SimpleAsyncResult ->
IO ()
{-# DEPRECATED simpleAsyncResultComplete ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' instead."] #-}
simpleAsyncResultComplete ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> m ()
simpleAsyncResultComplete :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> m ()
simpleAsyncResultComplete a
simple = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
g_simple_async_result_complete simple'
touchManagedPtr simple
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultCompleteMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultCompleteMethodInfo a signature where
overloadedMethod = simpleAsyncResultComplete
instance O.OverloadedMethodInfo SimpleAsyncResultCompleteMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultComplete",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultComplete"
})
#endif
foreign import ccall "g_simple_async_result_complete_in_idle" g_simple_async_result_complete_in_idle ::
Ptr SimpleAsyncResult ->
IO ()
{-# DEPRECATED simpleAsyncResultCompleteInIdle ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' instead."] #-}
simpleAsyncResultCompleteInIdle ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> m ()
simpleAsyncResultCompleteInIdle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> m ()
simpleAsyncResultCompleteInIdle a
simple = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
g_simple_async_result_complete_in_idle simple'
touchManagedPtr simple
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultCompleteInIdleMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultCompleteInIdleMethodInfo a signature where
overloadedMethod = simpleAsyncResultCompleteInIdle
instance O.OverloadedMethodInfo SimpleAsyncResultCompleteInIdleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultCompleteInIdle",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultCompleteInIdle"
})
#endif
foreign import ccall "g_simple_async_result_get_op_res_gboolean" g_simple_async_result_get_op_res_gboolean ::
Ptr SimpleAsyncResult ->
IO CInt
{-# DEPRECATED simpleAsyncResultGetOpResGboolean ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' and 'GI.Gio.Objects.Task.taskPropagateBoolean' instead."] #-}
simpleAsyncResultGetOpResGboolean ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> m Bool
simpleAsyncResultGetOpResGboolean :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> m Bool
simpleAsyncResultGetOpResGboolean a
simple = IO Bool -> m Bool
forall a. IO a -> m a
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
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
result <- g_simple_async_result_get_op_res_gboolean simple'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr simple
return result'
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultGetOpResGbooleanMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultGetOpResGbooleanMethodInfo a signature where
overloadedMethod = simpleAsyncResultGetOpResGboolean
instance O.OverloadedMethodInfo SimpleAsyncResultGetOpResGbooleanMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultGetOpResGboolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultGetOpResGboolean"
})
#endif
foreign import ccall "g_simple_async_result_get_op_res_gssize" g_simple_async_result_get_op_res_gssize ::
Ptr SimpleAsyncResult ->
IO DI.Int64
{-# DEPRECATED simpleAsyncResultGetOpResGssize ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' and 'GI.Gio.Objects.Task.taskPropagateInt' instead."] #-}
simpleAsyncResultGetOpResGssize ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> m DI.Int64
simpleAsyncResultGetOpResGssize :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> m Int64
simpleAsyncResultGetOpResGssize a
simple = IO Int64 -> m Int64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
result <- g_simple_async_result_get_op_res_gssize simple'
touchManagedPtr simple
return result
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultGetOpResGssizeMethodInfo
instance (signature ~ (m DI.Int64), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultGetOpResGssizeMethodInfo a signature where
overloadedMethod = simpleAsyncResultGetOpResGssize
instance O.OverloadedMethodInfo SimpleAsyncResultGetOpResGssizeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultGetOpResGssize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultGetOpResGssize"
})
#endif
foreign import ccall "g_simple_async_result_propagate_error" g_simple_async_result_propagate_error ::
Ptr SimpleAsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED simpleAsyncResultPropagateError ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' instead."] #-}
simpleAsyncResultPropagateError ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> m ()
simpleAsyncResultPropagateError :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> m ()
simpleAsyncResultPropagateError a
simple = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
onException (do
_ <- propagateGError $ g_simple_async_result_propagate_error simple'
touchManagedPtr simple
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultPropagateErrorMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultPropagateErrorMethodInfo a signature where
overloadedMethod = simpleAsyncResultPropagateError
instance O.OverloadedMethodInfo SimpleAsyncResultPropagateErrorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultPropagateError",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultPropagateError"
})
#endif
foreign import ccall "g_simple_async_result_set_check_cancellable" g_simple_async_result_set_check_cancellable ::
Ptr SimpleAsyncResult ->
Ptr Gio.Cancellable.Cancellable ->
IO ()
{-# DEPRECATED simpleAsyncResultSetCheckCancellable ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' instead."] #-}
simpleAsyncResultSetCheckCancellable ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
simpleAsyncResultSetCheckCancellable :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a,
IsCancellable b) =>
a -> Maybe b -> m ()
simpleAsyncResultSetCheckCancellable a
simple Maybe b
checkCancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
maybeCheckCancellable <- case checkCancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCheckCancellable -> do
jCheckCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCheckCancellable
return jCheckCancellable'
g_simple_async_result_set_check_cancellable simple' maybeCheckCancellable
touchManagedPtr simple
whenJust checkCancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultSetCheckCancellableMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSimpleAsyncResult a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SimpleAsyncResultSetCheckCancellableMethodInfo a signature where
overloadedMethod = simpleAsyncResultSetCheckCancellable
instance O.OverloadedMethodInfo SimpleAsyncResultSetCheckCancellableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultSetCheckCancellable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultSetCheckCancellable"
})
#endif
foreign import ccall "g_simple_async_result_set_from_error" g_simple_async_result_set_from_error ::
Ptr SimpleAsyncResult ->
Ptr GError ->
IO ()
{-# DEPRECATED simpleAsyncResultSetFromError ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' and 'GI.Gio.Objects.Task.taskReturnError' instead."] #-}
simpleAsyncResultSetFromError ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> GError
-> m ()
simpleAsyncResultSetFromError :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> GError -> m ()
simpleAsyncResultSetFromError a
simple GError
error_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
error_' <- unsafeManagedPtrGetPtr error_
g_simple_async_result_set_from_error simple' error_'
touchManagedPtr simple
touchManagedPtr error_
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultSetFromErrorMethodInfo
instance (signature ~ (GError -> m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultSetFromErrorMethodInfo a signature where
overloadedMethod = simpleAsyncResultSetFromError
instance O.OverloadedMethodInfo SimpleAsyncResultSetFromErrorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultSetFromError",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultSetFromError"
})
#endif
foreign import ccall "g_simple_async_result_set_handle_cancellation" g_simple_async_result_set_handle_cancellation ::
Ptr SimpleAsyncResult ->
CInt ->
IO ()
{-# DEPRECATED simpleAsyncResultSetHandleCancellation ["(Since version 2.46)"] #-}
simpleAsyncResultSetHandleCancellation ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> Bool
-> m ()
simpleAsyncResultSetHandleCancellation :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> Bool -> m ()
simpleAsyncResultSetHandleCancellation a
simple Bool
handleCancellation = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
let handleCancellation' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
handleCancellation
g_simple_async_result_set_handle_cancellation simple' handleCancellation'
touchManagedPtr simple
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultSetHandleCancellationMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultSetHandleCancellationMethodInfo a signature where
overloadedMethod = simpleAsyncResultSetHandleCancellation
instance O.OverloadedMethodInfo SimpleAsyncResultSetHandleCancellationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultSetHandleCancellation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultSetHandleCancellation"
})
#endif
foreign import ccall "g_simple_async_result_set_op_res_gboolean" g_simple_async_result_set_op_res_gboolean ::
Ptr SimpleAsyncResult ->
CInt ->
IO ()
{-# DEPRECATED simpleAsyncResultSetOpResGboolean ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' and 'GI.Gio.Objects.Task.taskReturnBoolean' instead."] #-}
simpleAsyncResultSetOpResGboolean ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> Bool
-> m ()
simpleAsyncResultSetOpResGboolean :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> Bool -> m ()
simpleAsyncResultSetOpResGboolean a
simple Bool
opRes = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
let opRes' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
opRes
g_simple_async_result_set_op_res_gboolean simple' opRes'
touchManagedPtr simple
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultSetOpResGbooleanMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultSetOpResGbooleanMethodInfo a signature where
overloadedMethod = simpleAsyncResultSetOpResGboolean
instance O.OverloadedMethodInfo SimpleAsyncResultSetOpResGbooleanMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultSetOpResGboolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultSetOpResGboolean"
})
#endif
foreign import ccall "g_simple_async_result_set_op_res_gssize" g_simple_async_result_set_op_res_gssize ::
Ptr SimpleAsyncResult ->
DI.Int64 ->
IO ()
{-# DEPRECATED simpleAsyncResultSetOpResGssize ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' and 'GI.Gio.Objects.Task.taskReturnInt' instead."] #-}
simpleAsyncResultSetOpResGssize ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a
-> DI.Int64
-> m ()
simpleAsyncResultSetOpResGssize :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAsyncResult a) =>
a -> Int64 -> m ()
simpleAsyncResultSetOpResGssize a
simple Int64
opRes = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
simple' <- a -> IO (Ptr SimpleAsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
g_simple_async_result_set_op_res_gssize simple' opRes
touchManagedPtr simple
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleAsyncResultSetOpResGssizeMethodInfo
instance (signature ~ (DI.Int64 -> m ()), MonadIO m, IsSimpleAsyncResult a) => O.OverloadedMethod SimpleAsyncResultSetOpResGssizeMethodInfo a signature where
overloadedMethod = simpleAsyncResultSetOpResGssize
instance O.OverloadedMethodInfo SimpleAsyncResultSetOpResGssizeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAsyncResult.simpleAsyncResultSetOpResGssize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAsyncResult.html#v:simpleAsyncResultSetOpResGssize"
})
#endif
foreign import ccall "g_simple_async_result_is_valid" g_simple_async_result_is_valid ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr GObject.Object.Object ->
Ptr () ->
IO CInt
{-# DEPRECATED simpleAsyncResultIsValid ["(Since version 2.46)","Use t'GI.Gio.Objects.Task.Task' and 'GI.Gio.Objects.Task.taskIsValid' instead."] #-}
simpleAsyncResultIsValid ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a, GObject.Object.IsObject b) =>
a
-> Maybe (b)
-> Ptr ()
-> m Bool
simpleAsyncResultIsValid :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAsyncResult a, IsObject b) =>
a -> Maybe b -> Ptr () -> m Bool
simpleAsyncResultIsValid a
result_ Maybe b
source Ptr ()
sourceTag = IO Bool -> m Bool
forall a. IO a -> m a
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
result_' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
maybeSource <- case source of
Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
FP.nullPtr
Just b
jSource -> do
jSource' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jSource
return jSource'
result <- g_simple_async_result_is_valid result_' maybeSource sourceTag
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr result_
whenJust source touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
#endif