{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.Resolver
(
Resolver(..) ,
IsResolver ,
toResolver ,
#if defined(ENABLE_OVERLOADING)
ResolveResolverMethod ,
#endif
resolverGetDefault ,
#if defined(ENABLE_OVERLOADING)
ResolverGetTimeoutMethodInfo ,
#endif
resolverGetTimeout ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByAddressMethodInfo ,
#endif
resolverLookupByAddress ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByAddressAsyncMethodInfo ,
#endif
resolverLookupByAddressAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByAddressFinishMethodInfo ,
#endif
resolverLookupByAddressFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameMethodInfo ,
#endif
resolverLookupByName ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameAsyncMethodInfo ,
#endif
resolverLookupByNameAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameFinishMethodInfo ,
#endif
resolverLookupByNameFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameWithFlagsMethodInfo ,
#endif
resolverLookupByNameWithFlags ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameWithFlagsAsyncMethodInfo,
#endif
resolverLookupByNameWithFlagsAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameWithFlagsFinishMethodInfo,
#endif
resolverLookupByNameWithFlagsFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupRecordsMethodInfo ,
#endif
resolverLookupRecords ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupRecordsAsyncMethodInfo ,
#endif
resolverLookupRecordsAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupRecordsFinishMethodInfo ,
#endif
resolverLookupRecordsFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupServiceMethodInfo ,
#endif
resolverLookupService ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupServiceAsyncMethodInfo ,
#endif
resolverLookupServiceAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupServiceFinishMethodInfo ,
#endif
resolverLookupServiceFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverSetDefaultMethodInfo ,
#endif
resolverSetDefault ,
#if defined(ENABLE_OVERLOADING)
ResolverSetTimeoutMethodInfo ,
#endif
resolverSetTimeout ,
#if defined(ENABLE_OVERLOADING)
ResolverTimeoutPropertyInfo ,
#endif
constructResolverTimeout ,
getResolverTimeout ,
#if defined(ENABLE_OVERLOADING)
resolverTimeout ,
#endif
setResolverTimeout ,
ResolverReloadCallback ,
#if defined(ENABLE_OVERLOADING)
ResolverReloadSignalInfo ,
#endif
afterResolverReload ,
onResolverReload ,
) 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.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Structs.SrvTarget as Gio.SrvTarget
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Structs.SrvTarget as Gio.SrvTarget
#endif
newtype Resolver = Resolver (SP.ManagedPtr Resolver)
deriving (Resolver -> Resolver -> Bool
(Resolver -> Resolver -> Bool)
-> (Resolver -> Resolver -> Bool) -> Eq Resolver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Resolver -> Resolver -> Bool
== :: Resolver -> Resolver -> Bool
$c/= :: Resolver -> Resolver -> Bool
/= :: Resolver -> Resolver -> Bool
Eq)
instance SP.ManagedPtrNewtype Resolver where
toManagedPtr :: Resolver -> ManagedPtr Resolver
toManagedPtr (Resolver ManagedPtr Resolver
p) = ManagedPtr Resolver
p
foreign import ccall "g_resolver_get_type"
c_g_resolver_get_type :: IO B.Types.GType
instance B.Types.TypedObject Resolver where
glibType :: IO GType
glibType = IO GType
c_g_resolver_get_type
instance B.Types.GObject Resolver
class (SP.GObject o, O.IsDescendantOf Resolver o) => IsResolver o
instance (SP.GObject o, O.IsDescendantOf Resolver o) => IsResolver o
instance O.HasParentTypes Resolver
type instance O.ParentTypes Resolver = '[GObject.Object.Object]
toResolver :: (MIO.MonadIO m, IsResolver o) => o -> m Resolver
toResolver :: forall (m :: * -> *) o.
(MonadIO m, IsResolver o) =>
o -> m Resolver
toResolver = IO Resolver -> m Resolver
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Resolver -> m Resolver)
-> (o -> IO Resolver) -> o -> m Resolver
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Resolver -> Resolver) -> o -> IO Resolver
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Resolver -> Resolver
Resolver
instance B.GValue.IsGValue (Maybe Resolver) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_resolver_get_type
gvalueSet_ :: Ptr GValue -> Maybe Resolver -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Resolver
P.Nothing = Ptr GValue -> Ptr Resolver -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Resolver
forall a. Ptr a
FP.nullPtr :: FP.Ptr Resolver)
gvalueSet_ Ptr GValue
gv (P.Just Resolver
obj) = Resolver -> (Ptr Resolver -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Resolver
obj (Ptr GValue -> Ptr Resolver -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Resolver)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Resolver)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Resolver)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Resolver ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveResolverMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveResolverMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveResolverMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveResolverMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveResolverMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveResolverMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveResolverMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveResolverMethod "lookupByAddress" o = ResolverLookupByAddressMethodInfo
ResolveResolverMethod "lookupByAddressAsync" o = ResolverLookupByAddressAsyncMethodInfo
ResolveResolverMethod "lookupByAddressFinish" o = ResolverLookupByAddressFinishMethodInfo
ResolveResolverMethod "lookupByName" o = ResolverLookupByNameMethodInfo
ResolveResolverMethod "lookupByNameAsync" o = ResolverLookupByNameAsyncMethodInfo
ResolveResolverMethod "lookupByNameFinish" o = ResolverLookupByNameFinishMethodInfo
ResolveResolverMethod "lookupByNameWithFlags" o = ResolverLookupByNameWithFlagsMethodInfo
ResolveResolverMethod "lookupByNameWithFlagsAsync" o = ResolverLookupByNameWithFlagsAsyncMethodInfo
ResolveResolverMethod "lookupByNameWithFlagsFinish" o = ResolverLookupByNameWithFlagsFinishMethodInfo
ResolveResolverMethod "lookupRecords" o = ResolverLookupRecordsMethodInfo
ResolveResolverMethod "lookupRecordsAsync" o = ResolverLookupRecordsAsyncMethodInfo
ResolveResolverMethod "lookupRecordsFinish" o = ResolverLookupRecordsFinishMethodInfo
ResolveResolverMethod "lookupService" o = ResolverLookupServiceMethodInfo
ResolveResolverMethod "lookupServiceAsync" o = ResolverLookupServiceAsyncMethodInfo
ResolveResolverMethod "lookupServiceFinish" o = ResolverLookupServiceFinishMethodInfo
ResolveResolverMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveResolverMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveResolverMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveResolverMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveResolverMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveResolverMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveResolverMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveResolverMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveResolverMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveResolverMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveResolverMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveResolverMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveResolverMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveResolverMethod "getTimeout" o = ResolverGetTimeoutMethodInfo
ResolveResolverMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveResolverMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveResolverMethod "setDefault" o = ResolverSetDefaultMethodInfo
ResolveResolverMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveResolverMethod "setTimeout" o = ResolverSetTimeoutMethodInfo
ResolveResolverMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveResolverMethod t Resolver, O.OverloadedMethod info Resolver p) => OL.IsLabel t (Resolver -> 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 ~ ResolveResolverMethod t Resolver, O.OverloadedMethod info Resolver p, R.HasField t Resolver p) => R.HasField t Resolver p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveResolverMethod t Resolver, O.OverloadedMethodInfo info Resolver) => OL.IsLabel t (O.MethodProxy info Resolver) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type ResolverReloadCallback =
IO ()
type C_ResolverReloadCallback =
Ptr Resolver ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ResolverReloadCallback :: C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
wrap_ResolverReloadCallback ::
GObject a => (a -> ResolverReloadCallback) ->
C_ResolverReloadCallback
wrap_ResolverReloadCallback :: forall a. GObject a => (a -> IO ()) -> C_ResolverReloadCallback
wrap_ResolverReloadCallback a -> IO ()
gi'cb Ptr Resolver
gi'selfPtr Ptr ()
_ = do
Ptr Resolver -> (Resolver -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Resolver
gi'selfPtr ((Resolver -> IO ()) -> IO ()) -> (Resolver -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Resolver
gi'self -> a -> IO ()
gi'cb (Resolver -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Resolver
gi'self)
onResolverReload :: (IsResolver a, MonadIO m) => a -> ((?self :: a) => ResolverReloadCallback) -> m SignalHandlerId
onResolverReload :: forall a (m :: * -> *).
(IsResolver a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onResolverReload a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_ResolverReloadCallback
wrapped' = (a -> IO ()) -> C_ResolverReloadCallback
forall a. GObject a => (a -> IO ()) -> C_ResolverReloadCallback
wrap_ResolverReloadCallback a -> IO ()
wrapped
wrapped'' <- C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
mk_ResolverReloadCallback C_ResolverReloadCallback
wrapped'
connectSignalFunPtr obj "reload" wrapped'' SignalConnectBefore Nothing
afterResolverReload :: (IsResolver a, MonadIO m) => a -> ((?self :: a) => ResolverReloadCallback) -> m SignalHandlerId
afterResolverReload :: forall a (m :: * -> *).
(IsResolver a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterResolverReload a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_ResolverReloadCallback
wrapped' = (a -> IO ()) -> C_ResolverReloadCallback
forall a. GObject a => (a -> IO ()) -> C_ResolverReloadCallback
wrap_ResolverReloadCallback a -> IO ()
wrapped
wrapped'' <- C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
mk_ResolverReloadCallback C_ResolverReloadCallback
wrapped'
connectSignalFunPtr obj "reload" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data ResolverReloadSignalInfo
instance SignalInfo ResolverReloadSignalInfo where
type HaskellCallbackType ResolverReloadSignalInfo = ResolverReloadCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ResolverReloadCallback cb
cb'' <- mk_ResolverReloadCallback cb'
connectSignalFunPtr obj "reload" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver::reload"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#g:signal:reload"})
#endif
getResolverTimeout :: (MonadIO m, IsResolver o) => o -> m Word32
getResolverTimeout :: forall (m :: * -> *) o. (MonadIO m, IsResolver o) => o -> m Word32
getResolverTimeout o
obj = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"timeout"
setResolverTimeout :: (MonadIO m, IsResolver o) => o -> Word32 -> m ()
setResolverTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsResolver o) =>
o -> Word32 -> m ()
setResolverTimeout o
obj Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"timeout" Word32
val
constructResolverTimeout :: (IsResolver o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructResolverTimeout :: forall o (m :: * -> *).
(IsResolver o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructResolverTimeout Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"timeout" Word32
val
#if defined(ENABLE_OVERLOADING)
data ResolverTimeoutPropertyInfo
instance AttrInfo ResolverTimeoutPropertyInfo where
type AttrAllowedOps ResolverTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ResolverTimeoutPropertyInfo = IsResolver
type AttrSetTypeConstraint ResolverTimeoutPropertyInfo = (~) Word32
type AttrTransferTypeConstraint ResolverTimeoutPropertyInfo = (~) Word32
type AttrTransferType ResolverTimeoutPropertyInfo = Word32
type AttrGetType ResolverTimeoutPropertyInfo = Word32
type AttrLabel ResolverTimeoutPropertyInfo = "timeout"
type AttrOrigin ResolverTimeoutPropertyInfo = Resolver
attrGet = getResolverTimeout
attrSet = setResolverTimeout
attrTransfer _ v = do
return v
attrConstruct = constructResolverTimeout
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.timeout"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#g:attr:timeout"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Resolver
type instance O.AttributeList Resolver = ResolverAttributeList
type ResolverAttributeList = ('[ '("timeout", ResolverTimeoutPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
resolverTimeout :: AttrLabelProxy "timeout"
resolverTimeout = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Resolver = ResolverSignalList
type ResolverSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("reload", ResolverReloadSignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_resolver_get_timeout" g_resolver_get_timeout ::
Ptr Resolver ->
IO Word32
resolverGetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a) =>
a
-> m Word32
resolverGetTimeout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsResolver a) =>
a -> m Word32
resolverGetTimeout a
resolver = IO Word32 -> m Word32
forall a. IO a -> m a
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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
result <- g_resolver_get_timeout resolver'
touchManagedPtr resolver
return result
#if defined(ENABLE_OVERLOADING)
data ResolverGetTimeoutMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsResolver a) => O.OverloadedMethod ResolverGetTimeoutMethodInfo a signature where
overloadedMethod = resolverGetTimeout
instance O.OverloadedMethodInfo ResolverGetTimeoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverGetTimeout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverGetTimeout"
})
#endif
foreign import ccall "g_resolver_lookup_by_address" g_resolver_lookup_by_address ::
Ptr Resolver ->
Ptr Gio.InetAddress.InetAddress ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CString
resolverLookupByAddress ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m T.Text
resolverLookupByAddress :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsResolver a, IsInetAddress b,
IsCancellable c) =>
a -> b -> Maybe c -> m Text
resolverLookupByAddress a
resolver b
address Maybe c
cancellable = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
address' <- unsafeManagedPtrCastPtr address
maybeCancellable <- case cancellable of
Maybe c
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 c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_resolver_lookup_by_address resolver' address' maybeCancellable
checkUnexpectedReturnNULL "resolverLookupByAddress" result
result' <- cstringToText result
freeMem result
touchManagedPtr resolver
touchManagedPtr address
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByAddressMethodInfo
instance (signature ~ (b -> Maybe (c) -> m T.Text), MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod ResolverLookupByAddressMethodInfo a signature where
overloadedMethod = resolverLookupByAddress
instance O.OverloadedMethodInfo ResolverLookupByAddressMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByAddress",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByAddress"
})
#endif
foreign import ccall "g_resolver_lookup_by_address_async" g_resolver_lookup_by_address_async ::
Ptr Resolver ->
Ptr Gio.InetAddress.InetAddress ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupByAddressAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupByAddressAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsResolver a, IsInetAddress b,
IsCancellable c) =>
a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
resolverLookupByAddressAsync a
resolver b
address Maybe c
cancellable Maybe AsyncReadyCallback
callback = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
address' <- unsafeManagedPtrCastPtr address
maybeCancellable <- case cancellable of
Maybe c
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 c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
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
g_resolver_lookup_by_address_async resolver' address' maybeCancellable maybeCallback userData
touchManagedPtr resolver
touchManagedPtr address
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByAddressAsyncMethodInfo
instance (signature ~ (b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod ResolverLookupByAddressAsyncMethodInfo a signature where
overloadedMethod = resolverLookupByAddressAsync
instance O.OverloadedMethodInfo ResolverLookupByAddressAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByAddressAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByAddressAsync"
})
#endif
foreign import ccall "g_resolver_lookup_by_address_finish" g_resolver_lookup_by_address_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CString
resolverLookupByAddressFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m T.Text
resolverLookupByAddressFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsAsyncResult b) =>
a -> b -> m Text
resolverLookupByAddressFinish a
resolver b
result_ = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_resolver_lookup_by_address_finish resolver' result_'
checkUnexpectedReturnNULL "resolverLookupByAddressFinish" result
result' <- cstringToText result
freeMem result
touchManagedPtr resolver
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByAddressFinishMethodInfo
instance (signature ~ (b -> m T.Text), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ResolverLookupByAddressFinishMethodInfo a signature where
overloadedMethod = resolverLookupByAddressFinish
instance O.OverloadedMethodInfo ResolverLookupByAddressFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByAddressFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByAddressFinish"
})
#endif
foreign import ccall "g_resolver_lookup_by_name" g_resolver_lookup_by_name ::
Ptr Resolver ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByName ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m [Gio.InetAddress.InetAddress]
resolverLookupByName :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a -> Text -> Maybe b -> m [InetAddress]
resolverLookupByName a
resolver Text
hostname Maybe b
cancellable = IO [InetAddress] -> m [InetAddress]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [InetAddress] -> m [InetAddress])
-> IO [InetAddress] -> m [InetAddress]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
hostname' <- textToCString hostname
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_resolver_lookup_by_name resolver' hostname' maybeCancellable
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.InetAddress.InetAddress) result'
g_list_free result
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem hostname'
return result''
) (do
freeMem hostname'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupByNameMethodInfo a signature where
overloadedMethod = resolverLookupByName
instance O.OverloadedMethodInfo ResolverLookupByNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByName"
})
#endif
foreign import ccall "g_resolver_lookup_by_name_async" g_resolver_lookup_by_name_async ::
Ptr Resolver ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupByNameAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupByNameAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
resolverLookupByNameAsync a
resolver Text
hostname Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
hostname' <- textToCString hostname
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
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
g_resolver_lookup_by_name_async resolver' hostname' maybeCancellable maybeCallback userData
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem hostname'
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameAsyncMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupByNameAsyncMethodInfo a signature where
overloadedMethod = resolverLookupByNameAsync
instance O.OverloadedMethodInfo ResolverLookupByNameAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByNameAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByNameAsync"
})
#endif
foreign import ccall "g_resolver_lookup_by_name_finish" g_resolver_lookup_by_name_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByNameFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.InetAddress.InetAddress]
resolverLookupByNameFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsAsyncResult b) =>
a -> b -> m [InetAddress]
resolverLookupByNameFinish a
resolver b
result_ = IO [InetAddress] -> m [InetAddress]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [InetAddress] -> m [InetAddress])
-> IO [InetAddress] -> m [InetAddress]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_resolver_lookup_by_name_finish resolver' result_'
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.InetAddress.InetAddress) result'
g_list_free result
touchManagedPtr resolver
touchManagedPtr result_
return result''
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameFinishMethodInfo
instance (signature ~ (b -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ResolverLookupByNameFinishMethodInfo a signature where
overloadedMethod = resolverLookupByNameFinish
instance O.OverloadedMethodInfo ResolverLookupByNameFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByNameFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByNameFinish"
})
#endif
foreign import ccall "g_resolver_lookup_by_name_with_flags" g_resolver_lookup_by_name_with_flags ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByNameWithFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> [Gio.Flags.ResolverNameLookupFlags]
-> Maybe (b)
-> m [Gio.InetAddress.InetAddress]
resolverLookupByNameWithFlags :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a
-> Text -> [ResolverNameLookupFlags] -> Maybe b -> m [InetAddress]
resolverLookupByNameWithFlags a
resolver Text
hostname [ResolverNameLookupFlags]
flags Maybe b
cancellable = IO [InetAddress] -> m [InetAddress]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [InetAddress] -> m [InetAddress])
-> IO [InetAddress] -> m [InetAddress]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
hostname' <- textToCString hostname
let flags' = [ResolverNameLookupFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ResolverNameLookupFlags]
flags
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_resolver_lookup_by_name_with_flags resolver' hostname' flags' maybeCancellable
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.InetAddress.InetAddress) result'
g_list_free result
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem hostname'
return result''
) (do
freeMem hostname'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameWithFlagsMethodInfo
instance (signature ~ (T.Text -> [Gio.Flags.ResolverNameLookupFlags] -> Maybe (b) -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupByNameWithFlagsMethodInfo a signature where
overloadedMethod = resolverLookupByNameWithFlags
instance O.OverloadedMethodInfo ResolverLookupByNameWithFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByNameWithFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByNameWithFlags"
})
#endif
foreign import ccall "g_resolver_lookup_by_name_with_flags_async" g_resolver_lookup_by_name_with_flags_async ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupByNameWithFlagsAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> [Gio.Flags.ResolverNameLookupFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupByNameWithFlagsAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a
-> Text
-> [ResolverNameLookupFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
resolverLookupByNameWithFlagsAsync a
resolver Text
hostname [ResolverNameLookupFlags]
flags Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
hostname' <- textToCString hostname
let flags' = [ResolverNameLookupFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ResolverNameLookupFlags]
flags
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
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
g_resolver_lookup_by_name_with_flags_async resolver' hostname' flags' maybeCancellable maybeCallback userData
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem hostname'
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameWithFlagsAsyncMethodInfo
instance (signature ~ (T.Text -> [Gio.Flags.ResolverNameLookupFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupByNameWithFlagsAsyncMethodInfo a signature where
overloadedMethod = resolverLookupByNameWithFlagsAsync
instance O.OverloadedMethodInfo ResolverLookupByNameWithFlagsAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByNameWithFlagsAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByNameWithFlagsAsync"
})
#endif
foreign import ccall "g_resolver_lookup_by_name_with_flags_finish" g_resolver_lookup_by_name_with_flags_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByNameWithFlagsFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.InetAddress.InetAddress]
resolverLookupByNameWithFlagsFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsAsyncResult b) =>
a -> b -> m [InetAddress]
resolverLookupByNameWithFlagsFinish a
resolver b
result_ = IO [InetAddress] -> m [InetAddress]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [InetAddress] -> m [InetAddress])
-> IO [InetAddress] -> m [InetAddress]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_resolver_lookup_by_name_with_flags_finish resolver' result_'
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.InetAddress.InetAddress) result'
g_list_free result
touchManagedPtr resolver
touchManagedPtr result_
return result''
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameWithFlagsFinishMethodInfo
instance (signature ~ (b -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ResolverLookupByNameWithFlagsFinishMethodInfo a signature where
overloadedMethod = resolverLookupByNameWithFlagsFinish
instance O.OverloadedMethodInfo ResolverLookupByNameWithFlagsFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupByNameWithFlagsFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupByNameWithFlagsFinish"
})
#endif
foreign import ccall "g_resolver_lookup_records" g_resolver_lookup_records ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr GVariant)))
resolverLookupRecords ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Gio.Enums.ResolverRecordType
-> Maybe (b)
-> m [GVariant]
resolverLookupRecords :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a -> Text -> ResolverRecordType -> Maybe b -> m [GVariant]
resolverLookupRecords a
resolver Text
rrname ResolverRecordType
recordType Maybe b
cancellable = IO [GVariant] -> m [GVariant]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GVariant] -> m [GVariant]) -> IO [GVariant] -> m [GVariant]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
rrname' <- textToCString rrname
let recordType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ResolverRecordType -> Int) -> ResolverRecordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResolverRecordType -> Int
forall a. Enum a => a -> Int
fromEnum) ResolverRecordType
recordType
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_resolver_lookup_records resolver' rrname' recordType' maybeCancellable
result' <- unpackGList result
result'' <- mapM B.GVariant.wrapGVariantPtr result'
g_list_free result
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem rrname'
return result''
) (do
freeMem rrname'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupRecordsMethodInfo
instance (signature ~ (T.Text -> Gio.Enums.ResolverRecordType -> Maybe (b) -> m [GVariant]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupRecordsMethodInfo a signature where
overloadedMethod = resolverLookupRecords
instance O.OverloadedMethodInfo ResolverLookupRecordsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupRecords",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupRecords"
})
#endif
foreign import ccall "g_resolver_lookup_records_async" g_resolver_lookup_records_async ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupRecordsAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Gio.Enums.ResolverRecordType
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupRecordsAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a
-> Text
-> ResolverRecordType
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
resolverLookupRecordsAsync a
resolver Text
rrname ResolverRecordType
recordType Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
rrname' <- textToCString rrname
let recordType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ResolverRecordType -> Int) -> ResolverRecordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResolverRecordType -> Int
forall a. Enum a => a -> Int
fromEnum) ResolverRecordType
recordType
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
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
g_resolver_lookup_records_async resolver' rrname' recordType' maybeCancellable maybeCallback userData
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem rrname'
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupRecordsAsyncMethodInfo
instance (signature ~ (T.Text -> Gio.Enums.ResolverRecordType -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupRecordsAsyncMethodInfo a signature where
overloadedMethod = resolverLookupRecordsAsync
instance O.OverloadedMethodInfo ResolverLookupRecordsAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupRecordsAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupRecordsAsync"
})
#endif
foreign import ccall "g_resolver_lookup_records_finish" g_resolver_lookup_records_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr GVariant)))
resolverLookupRecordsFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [GVariant]
resolverLookupRecordsFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsAsyncResult b) =>
a -> b -> m [GVariant]
resolverLookupRecordsFinish a
resolver b
result_ = IO [GVariant] -> m [GVariant]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GVariant] -> m [GVariant]) -> IO [GVariant] -> m [GVariant]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_resolver_lookup_records_finish resolver' result_'
result' <- unpackGList result
result'' <- mapM B.GVariant.wrapGVariantPtr result'
g_list_free result
touchManagedPtr resolver
touchManagedPtr result_
return result''
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupRecordsFinishMethodInfo
instance (signature ~ (b -> m [GVariant]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ResolverLookupRecordsFinishMethodInfo a signature where
overloadedMethod = resolverLookupRecordsFinish
instance O.OverloadedMethodInfo ResolverLookupRecordsFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupRecordsFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupRecordsFinish"
})
#endif
foreign import ccall "g_resolver_lookup_service" g_resolver_lookup_service ::
Ptr Resolver ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.SrvTarget.SrvTarget)))
resolverLookupService ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> T.Text
-> Maybe (b)
-> m [Gio.SrvTarget.SrvTarget]
resolverLookupService :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a -> Text -> Text -> Text -> Maybe b -> m [SrvTarget]
resolverLookupService a
resolver Text
service Text
protocol Text
domain Maybe b
cancellable = IO [SrvTarget] -> m [SrvTarget]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SrvTarget] -> m [SrvTarget])
-> IO [SrvTarget] -> m [SrvTarget]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
service' <- textToCString service
protocol' <- textToCString protocol
domain' <- textToCString domain
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_resolver_lookup_service resolver' service' protocol' domain' maybeCancellable
result' <- unpackGList result
result'' <- mapM (wrapBoxed Gio.SrvTarget.SrvTarget) result'
g_list_free result
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem service'
freeMem protocol'
freeMem domain'
return result''
) (do
freeMem service'
freeMem protocol'
freeMem domain'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupServiceMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> Maybe (b) -> m [Gio.SrvTarget.SrvTarget]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupServiceMethodInfo a signature where
overloadedMethod = resolverLookupService
instance O.OverloadedMethodInfo ResolverLookupServiceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupService",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupService"
})
#endif
foreign import ccall "g_resolver_lookup_service_async" g_resolver_lookup_service_async ::
Ptr Resolver ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupServiceAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> T.Text
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupServiceAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsCancellable b) =>
a
-> Text
-> Text
-> Text
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
resolverLookupServiceAsync a
resolver Text
service Text
protocol Text
domain Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
service' <- textToCString service
protocol' <- textToCString protocol
domain' <- textToCString domain
maybeCancellable <- case cancellable 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
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
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
g_resolver_lookup_service_async resolver' service' protocol' domain' maybeCancellable maybeCallback userData
touchManagedPtr resolver
whenJust cancellable touchManagedPtr
freeMem service'
freeMem protocol'
freeMem domain'
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupServiceAsyncMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ResolverLookupServiceAsyncMethodInfo a signature where
overloadedMethod = resolverLookupServiceAsync
instance O.OverloadedMethodInfo ResolverLookupServiceAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupServiceAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupServiceAsync"
})
#endif
foreign import ccall "g_resolver_lookup_service_finish" g_resolver_lookup_service_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.SrvTarget.SrvTarget)))
resolverLookupServiceFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.SrvTarget.SrvTarget]
resolverLookupServiceFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsResolver a, IsAsyncResult b) =>
a -> b -> m [SrvTarget]
resolverLookupServiceFinish a
resolver b
result_ = IO [SrvTarget] -> m [SrvTarget]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SrvTarget] -> m [SrvTarget])
-> IO [SrvTarget] -> m [SrvTarget]
forall a b. (a -> b) -> a -> b
$ do
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_resolver_lookup_service_finish resolver' result_'
result' <- unpackGList result
result'' <- mapM (wrapBoxed Gio.SrvTarget.SrvTarget) result'
g_list_free result
touchManagedPtr resolver
touchManagedPtr result_
return result''
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupServiceFinishMethodInfo
instance (signature ~ (b -> m [Gio.SrvTarget.SrvTarget]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ResolverLookupServiceFinishMethodInfo a signature where
overloadedMethod = resolverLookupServiceFinish
instance O.OverloadedMethodInfo ResolverLookupServiceFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverLookupServiceFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverLookupServiceFinish"
})
#endif
foreign import ccall "g_resolver_set_default" g_resolver_set_default ::
Ptr Resolver ->
IO ()
resolverSetDefault ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a) =>
a
-> m ()
resolverSetDefault :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsResolver a) =>
a -> m ()
resolverSetDefault a
resolver = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
g_resolver_set_default resolver'
touchManagedPtr resolver
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverSetDefaultMethodInfo
instance (signature ~ (m ()), MonadIO m, IsResolver a) => O.OverloadedMethod ResolverSetDefaultMethodInfo a signature where
overloadedMethod = resolverSetDefault
instance O.OverloadedMethodInfo ResolverSetDefaultMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverSetDefault",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverSetDefault"
})
#endif
foreign import ccall "g_resolver_set_timeout" g_resolver_set_timeout ::
Ptr Resolver ->
Word32 ->
IO ()
resolverSetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a) =>
a
-> Word32
-> m ()
resolverSetTimeout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsResolver a) =>
a -> Word32 -> m ()
resolverSetTimeout a
resolver Word32
timeoutMs = 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
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
g_resolver_set_timeout resolver' timeoutMs
touchManagedPtr resolver
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverSetTimeoutMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsResolver a) => O.OverloadedMethod ResolverSetTimeoutMethodInfo a signature where
overloadedMethod = resolverSetTimeout
instance O.OverloadedMethodInfo ResolverSetTimeoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Resolver.resolverSetTimeout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Resolver.html#v:resolverSetTimeout"
})
#endif
foreign import ccall "g_resolver_get_default" g_resolver_get_default ::
IO (Ptr Resolver)
resolverGetDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Resolver
resolverGetDefault :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Resolver
resolverGetDefault = IO Resolver -> m Resolver
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Resolver -> m Resolver) -> IO Resolver -> m Resolver
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr Resolver)
g_resolver_get_default
checkUnexpectedReturnNULL "resolverGetDefault" result
result' <- (wrapObject Resolver) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif