module GI.Gio.Interfaces.AsyncResult
(
AsyncResult(..) ,
noAsyncResult ,
IsAsyncResult ,
toAsyncResult ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AsyncResultGetSourceObjectMethodInfo ,
#endif
asyncResultGetSourceObject ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AsyncResultGetUserDataMethodInfo ,
#endif
asyncResultGetUserData ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AsyncResultIsTaggedMethodInfo ,
#endif
asyncResultIsTagged ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AsyncResultLegacyPropagateErrorMethodInfo,
#endif
asyncResultLegacyPropagateError ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
newtype AsyncResult = AsyncResult (ManagedPtr AsyncResult)
noAsyncResult :: Maybe AsyncResult
noAsyncResult = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList AsyncResult = AsyncResultSignalList
type AsyncResultSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_async_result_get_type"
c_g_async_result_get_type :: IO GType
instance GObject AsyncResult where
gobjectType _ = c_g_async_result_get_type
class GObject o => IsAsyncResult o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError AsyncResult a) =>
IsAsyncResult a
#endif
instance IsAsyncResult AsyncResult
instance GObject.Object.IsObject AsyncResult
toAsyncResult :: (MonadIO m, IsAsyncResult o) => o -> m AsyncResult
toAsyncResult = liftIO . unsafeCastTo AsyncResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList AsyncResult
type instance O.AttributeList AsyncResult = AsyncResultAttributeList
type AsyncResultAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveAsyncResultMethod (t :: Symbol) (o :: *) :: * where
ResolveAsyncResultMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAsyncResultMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAsyncResultMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAsyncResultMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAsyncResultMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAsyncResultMethod "isTagged" o = AsyncResultIsTaggedMethodInfo
ResolveAsyncResultMethod "legacyPropagateError" o = AsyncResultLegacyPropagateErrorMethodInfo
ResolveAsyncResultMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAsyncResultMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAsyncResultMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAsyncResultMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAsyncResultMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveAsyncResultMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveAsyncResultMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAsyncResultMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAsyncResultMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAsyncResultMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAsyncResultMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAsyncResultMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAsyncResultMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAsyncResultMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAsyncResultMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAsyncResultMethod "getSourceObject" o = AsyncResultGetSourceObjectMethodInfo
ResolveAsyncResultMethod "getUserData" o = AsyncResultGetUserDataMethodInfo
ResolveAsyncResultMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAsyncResultMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAsyncResultMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAsyncResultMethod t AsyncResult, O.MethodInfo info AsyncResult p) => O.IsLabelProxy t (AsyncResult -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAsyncResultMethod t AsyncResult, O.MethodInfo info AsyncResult p) => O.IsLabel t (AsyncResult -> 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
#endif
foreign import ccall "g_async_result_get_source_object" g_async_result_get_source_object ::
Ptr AsyncResult ->
IO (Ptr GObject.Object.Object)
asyncResultGetSourceObject ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncResult a) =>
a
-> m GObject.Object.Object
asyncResultGetSourceObject res = liftIO $ do
res' <- unsafeManagedPtrCastPtr res
result <- g_async_result_get_source_object res'
checkUnexpectedReturnNULL "asyncResultGetSourceObject" result
result' <- (wrapObject GObject.Object.Object) result
touchManagedPtr res
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AsyncResultGetSourceObjectMethodInfo
instance (signature ~ (m GObject.Object.Object), MonadIO m, IsAsyncResult a) => O.MethodInfo AsyncResultGetSourceObjectMethodInfo a signature where
overloadedMethod _ = asyncResultGetSourceObject
#endif
foreign import ccall "g_async_result_get_user_data" g_async_result_get_user_data ::
Ptr AsyncResult ->
IO (Ptr ())
asyncResultGetUserData ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncResult a) =>
a
-> m (Ptr ())
asyncResultGetUserData res = liftIO $ do
res' <- unsafeManagedPtrCastPtr res
result <- g_async_result_get_user_data res'
touchManagedPtr res
return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AsyncResultGetUserDataMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m, IsAsyncResult a) => O.MethodInfo AsyncResultGetUserDataMethodInfo a signature where
overloadedMethod _ = asyncResultGetUserData
#endif
foreign import ccall "g_async_result_is_tagged" g_async_result_is_tagged ::
Ptr AsyncResult ->
Ptr () ->
IO CInt
asyncResultIsTagged ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncResult a) =>
a
-> Ptr ()
-> m Bool
asyncResultIsTagged res sourceTag = liftIO $ do
res' <- unsafeManagedPtrCastPtr res
result <- g_async_result_is_tagged res' sourceTag
let result' = (/= 0) result
touchManagedPtr res
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AsyncResultIsTaggedMethodInfo
instance (signature ~ (Ptr () -> m Bool), MonadIO m, IsAsyncResult a) => O.MethodInfo AsyncResultIsTaggedMethodInfo a signature where
overloadedMethod _ = asyncResultIsTagged
#endif
foreign import ccall "g_async_result_legacy_propagate_error" g_async_result_legacy_propagate_error ::
Ptr AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
asyncResultLegacyPropagateError ::
(B.CallStack.HasCallStack, MonadIO m, IsAsyncResult a) =>
a
-> m ()
asyncResultLegacyPropagateError res = liftIO $ do
res' <- unsafeManagedPtrCastPtr res
onException (do
_ <- propagateGError $ g_async_result_legacy_propagate_error res'
touchManagedPtr res
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AsyncResultLegacyPropagateErrorMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAsyncResult a) => O.MethodInfo AsyncResultLegacyPropagateErrorMethodInfo a signature where
overloadedMethod _ = asyncResultLegacyPropagateError
#endif