{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.Proxy
(
Proxy(..) ,
IsProxy ,
toProxy ,
#if defined(ENABLE_OVERLOADING)
ResolveProxyMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ProxyConnectMethodInfo ,
#endif
proxyConnect ,
#if defined(ENABLE_OVERLOADING)
ProxyConnectAsyncMethodInfo ,
#endif
proxyConnectAsync ,
#if defined(ENABLE_OVERLOADING)
ProxyConnectFinishMethodInfo ,
#endif
proxyConnectFinish ,
proxyGetDefaultForProtocol ,
#if defined(ENABLE_OVERLOADING)
ProxySupportsHostnameMethodInfo ,
#endif
proxySupportsHostname ,
) 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.Bytes as GLib.Bytes
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.Interfaces.SocketConnectable as Gio.SocketConnectable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.InetSocketAddress as Gio.InetSocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.ProxyAddress as Gio.ProxyAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddressEnumerator as Gio.SocketAddressEnumerator
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#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
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.ProxyAddress as Gio.ProxyAddress
#endif
newtype Proxy = Proxy (SP.ManagedPtr Proxy)
deriving (Proxy -> Proxy -> Bool
(Proxy -> Proxy -> Bool) -> (Proxy -> Proxy -> Bool) -> Eq Proxy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Proxy -> Proxy -> Bool
== :: Proxy -> Proxy -> Bool
$c/= :: Proxy -> Proxy -> Bool
/= :: Proxy -> Proxy -> Bool
Eq)
instance SP.ManagedPtrNewtype Proxy where
toManagedPtr :: Proxy -> ManagedPtr Proxy
toManagedPtr (Proxy ManagedPtr Proxy
p) = ManagedPtr Proxy
p
foreign import ccall "g_proxy_get_type"
c_g_proxy_get_type :: IO B.Types.GType
instance B.Types.TypedObject Proxy where
glibType :: IO GType
glibType = IO GType
c_g_proxy_get_type
instance B.Types.GObject Proxy
class (SP.GObject o, O.IsDescendantOf Proxy o) => IsProxy o
instance (SP.GObject o, O.IsDescendantOf Proxy o) => IsProxy o
instance O.HasParentTypes Proxy
type instance O.ParentTypes Proxy = '[GObject.Object.Object]
toProxy :: (MIO.MonadIO m, IsProxy o) => o -> m Proxy
toProxy :: forall (m :: * -> *) o. (MonadIO m, IsProxy o) => o -> m Proxy
toProxy = IO Proxy -> m Proxy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Proxy -> m Proxy) -> (o -> IO Proxy) -> o -> m Proxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Proxy -> Proxy) -> o -> IO Proxy
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Proxy -> Proxy
Proxy
instance B.GValue.IsGValue (Maybe Proxy) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_proxy_get_type
gvalueSet_ :: Ptr GValue -> Maybe Proxy -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Proxy
P.Nothing = Ptr GValue -> Ptr Proxy -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Proxy
forall a. Ptr a
FP.nullPtr :: FP.Ptr Proxy)
gvalueSet_ Ptr GValue
gv (P.Just Proxy
obj) = Proxy -> (Ptr Proxy -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Proxy
obj (Ptr GValue -> Ptr Proxy -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Proxy)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Proxy)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Proxy)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Proxy ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Proxy
type instance O.AttributeList Proxy = ProxyAttributeList
type ProxyAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveProxyMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveProxyMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveProxyMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveProxyMethod "connect" o = ProxyConnectMethodInfo
ResolveProxyMethod "connectAsync" o = ProxyConnectAsyncMethodInfo
ResolveProxyMethod "connectFinish" o = ProxyConnectFinishMethodInfo
ResolveProxyMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveProxyMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveProxyMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveProxyMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveProxyMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveProxyMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveProxyMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveProxyMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveProxyMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveProxyMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveProxyMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveProxyMethod "supportsHostname" o = ProxySupportsHostnameMethodInfo
ResolveProxyMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveProxyMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveProxyMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveProxyMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveProxyMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveProxyMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveProxyMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveProxyMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveProxyMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveProxyMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveProxyMethod t Proxy, O.OverloadedMethod info Proxy p) => OL.IsLabel t (Proxy -> 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 ~ ResolveProxyMethod t Proxy, O.OverloadedMethod info Proxy p, R.HasField t Proxy p) => R.HasField t Proxy p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveProxyMethod t Proxy, O.OverloadedMethodInfo info Proxy) => OL.IsLabel t (O.MethodProxy info Proxy) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "g_proxy_connect" g_proxy_connect ::
Ptr Proxy ->
Ptr Gio.IOStream.IOStream ->
Ptr Gio.ProxyAddress.ProxyAddress ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.IOStream.IOStream)
proxyConnect ::
(B.CallStack.HasCallStack, MonadIO m, IsProxy a, Gio.IOStream.IsIOStream b, Gio.ProxyAddress.IsProxyAddress c, Gio.Cancellable.IsCancellable d) =>
a
-> b
-> c
-> Maybe (d)
-> m Gio.IOStream.IOStream
proxyConnect :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsProxy a, IsIOStream b,
IsProxyAddress c, IsCancellable d) =>
a -> b -> c -> Maybe d -> m IOStream
proxyConnect a
proxy b
connection c
proxyAddress Maybe d
cancellable = IO IOStream -> m IOStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ do
proxy' <- a -> IO (Ptr Proxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
connection' <- unsafeManagedPtrCastPtr connection
proxyAddress' <- unsafeManagedPtrCastPtr proxyAddress
maybeCancellable <- case cancellable of
Maybe d
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 d
jCancellable -> do
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_proxy_connect proxy' connection' proxyAddress' maybeCancellable
checkUnexpectedReturnNULL "proxyConnect" result
result' <- (wrapObject Gio.IOStream.IOStream) result
touchManagedPtr proxy
touchManagedPtr connection
touchManagedPtr proxyAddress
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ProxyConnectMethodInfo
instance (signature ~ (b -> c -> Maybe (d) -> m Gio.IOStream.IOStream), MonadIO m, IsProxy a, Gio.IOStream.IsIOStream b, Gio.ProxyAddress.IsProxyAddress c, Gio.Cancellable.IsCancellable d) => O.OverloadedMethod ProxyConnectMethodInfo a signature where
overloadedMethod = proxyConnect
instance O.OverloadedMethodInfo ProxyConnectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Proxy.proxyConnect",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Proxy.html#v:proxyConnect"
})
#endif
foreign import ccall "g_proxy_connect_async" g_proxy_connect_async ::
Ptr Proxy ->
Ptr Gio.IOStream.IOStream ->
Ptr Gio.ProxyAddress.ProxyAddress ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
proxyConnectAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsProxy a, Gio.IOStream.IsIOStream b, Gio.ProxyAddress.IsProxyAddress c, Gio.Cancellable.IsCancellable d) =>
a
-> b
-> c
-> Maybe (d)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
proxyConnectAsync :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsProxy a, IsIOStream b,
IsProxyAddress c, IsCancellable d) =>
a -> b -> c -> Maybe d -> Maybe AsyncReadyCallback -> m ()
proxyConnectAsync a
proxy b
connection c
proxyAddress Maybe d
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
proxy' <- a -> IO (Ptr Proxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
connection' <- unsafeManagedPtrCastPtr connection
proxyAddress' <- unsafeManagedPtrCastPtr proxyAddress
maybeCancellable <- case cancellable of
Maybe d
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 d
jCancellable -> do
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
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_proxy_connect_async proxy' connection' proxyAddress' maybeCancellable maybeCallback userData
touchManagedPtr proxy
touchManagedPtr connection
touchManagedPtr proxyAddress
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ProxyConnectAsyncMethodInfo
instance (signature ~ (b -> c -> Maybe (d) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsProxy a, Gio.IOStream.IsIOStream b, Gio.ProxyAddress.IsProxyAddress c, Gio.Cancellable.IsCancellable d) => O.OverloadedMethod ProxyConnectAsyncMethodInfo a signature where
overloadedMethod = proxyConnectAsync
instance O.OverloadedMethodInfo ProxyConnectAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Proxy.proxyConnectAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Proxy.html#v:proxyConnectAsync"
})
#endif
foreign import ccall "g_proxy_connect_finish" g_proxy_connect_finish ::
Ptr Proxy ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.IOStream.IOStream)
proxyConnectFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsProxy a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.IOStream.IOStream
proxyConnectFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsProxy a, IsAsyncResult b) =>
a -> b -> m IOStream
proxyConnectFinish a
proxy b
result_ = IO IOStream -> m IOStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ do
proxy' <- a -> IO (Ptr Proxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_proxy_connect_finish proxy' result_'
checkUnexpectedReturnNULL "proxyConnectFinish" result
result' <- (wrapObject Gio.IOStream.IOStream) result
touchManagedPtr proxy
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data ProxyConnectFinishMethodInfo
instance (signature ~ (b -> m Gio.IOStream.IOStream), MonadIO m, IsProxy a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ProxyConnectFinishMethodInfo a signature where
overloadedMethod = proxyConnectFinish
instance O.OverloadedMethodInfo ProxyConnectFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Proxy.proxyConnectFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Proxy.html#v:proxyConnectFinish"
})
#endif
foreign import ccall "g_proxy_supports_hostname" g_proxy_supports_hostname ::
Ptr Proxy ->
IO CInt
proxySupportsHostname ::
(B.CallStack.HasCallStack, MonadIO m, IsProxy a) =>
a
-> m Bool
proxySupportsHostname :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsProxy a) =>
a -> m Bool
proxySupportsHostname a
proxy = 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
proxy' <- a -> IO (Ptr Proxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
result <- g_proxy_supports_hostname proxy'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr proxy
return result'
#if defined(ENABLE_OVERLOADING)
data ProxySupportsHostnameMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsProxy a) => O.OverloadedMethod ProxySupportsHostnameMethodInfo a signature where
overloadedMethod = proxySupportsHostname
instance O.OverloadedMethodInfo ProxySupportsHostnameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Proxy.proxySupportsHostname",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Proxy.html#v:proxySupportsHostname"
})
#endif
foreign import ccall "g_proxy_get_default_for_protocol" g_proxy_get_default_for_protocol ::
CString ->
IO (Ptr Proxy)
proxyGetDefaultForProtocol ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe Proxy)
proxyGetDefaultForProtocol :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe Proxy)
proxyGetDefaultForProtocol Text
protocol = IO (Maybe Proxy) -> m (Maybe Proxy)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Proxy) -> m (Maybe Proxy))
-> IO (Maybe Proxy) -> m (Maybe Proxy)
forall a b. (a -> b) -> a -> b
$ do
protocol' <- Text -> IO CString
textToCString Text
protocol
result <- g_proxy_get_default_for_protocol protocol'
maybeResult <- convertIfNonNull result $ \Ptr Proxy
result' -> do
result'' <- ((ManagedPtr Proxy -> Proxy) -> Ptr Proxy -> IO Proxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Proxy -> Proxy
Proxy) Ptr Proxy
result'
return result''
freeMem protocol'
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Proxy = ProxySignalList
type ProxySignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif