{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.SocketClient
(
SocketClient(..) ,
IsSocketClient ,
toSocketClient ,
noSocketClient ,
#if defined(ENABLE_OVERLOADING)
ResolveSocketClientMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientAddApplicationProxyMethodInfo,
#endif
socketClientAddApplicationProxy ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectMethodInfo ,
#endif
socketClientConnect ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectAsyncMethodInfo ,
#endif
socketClientConnectAsync ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectFinishMethodInfo ,
#endif
socketClientConnectFinish ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToHostMethodInfo ,
#endif
socketClientConnectToHost ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToHostAsyncMethodInfo,
#endif
socketClientConnectToHostAsync ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToHostFinishMethodInfo,
#endif
socketClientConnectToHostFinish ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToServiceMethodInfo ,
#endif
socketClientConnectToService ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToServiceAsyncMethodInfo,
#endif
socketClientConnectToServiceAsync ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToServiceFinishMethodInfo,
#endif
socketClientConnectToServiceFinish ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToUriMethodInfo ,
#endif
socketClientConnectToUri ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToUriAsyncMethodInfo ,
#endif
socketClientConnectToUriAsync ,
#if defined(ENABLE_OVERLOADING)
SocketClientConnectToUriFinishMethodInfo,
#endif
socketClientConnectToUriFinish ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetEnableProxyMethodInfo ,
#endif
socketClientGetEnableProxy ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetFamilyMethodInfo ,
#endif
socketClientGetFamily ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetLocalAddressMethodInfo ,
#endif
socketClientGetLocalAddress ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetProtocolMethodInfo ,
#endif
socketClientGetProtocol ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetProxyResolverMethodInfo ,
#endif
socketClientGetProxyResolver ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetSocketTypeMethodInfo ,
#endif
socketClientGetSocketType ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetTimeoutMethodInfo ,
#endif
socketClientGetTimeout ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetTlsMethodInfo ,
#endif
socketClientGetTls ,
#if defined(ENABLE_OVERLOADING)
SocketClientGetTlsValidationFlagsMethodInfo,
#endif
socketClientGetTlsValidationFlags ,
socketClientNew ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetEnableProxyMethodInfo ,
#endif
socketClientSetEnableProxy ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetFamilyMethodInfo ,
#endif
socketClientSetFamily ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetLocalAddressMethodInfo ,
#endif
socketClientSetLocalAddress ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetProtocolMethodInfo ,
#endif
socketClientSetProtocol ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetProxyResolverMethodInfo ,
#endif
socketClientSetProxyResolver ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetSocketTypeMethodInfo ,
#endif
socketClientSetSocketType ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetTimeoutMethodInfo ,
#endif
socketClientSetTimeout ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetTlsMethodInfo ,
#endif
socketClientSetTls ,
#if defined(ENABLE_OVERLOADING)
SocketClientSetTlsValidationFlagsMethodInfo,
#endif
socketClientSetTlsValidationFlags ,
#if defined(ENABLE_OVERLOADING)
SocketClientEnableProxyPropertyInfo ,
#endif
constructSocketClientEnableProxy ,
getSocketClientEnableProxy ,
setSocketClientEnableProxy ,
#if defined(ENABLE_OVERLOADING)
socketClientEnableProxy ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientFamilyPropertyInfo ,
#endif
constructSocketClientFamily ,
getSocketClientFamily ,
setSocketClientFamily ,
#if defined(ENABLE_OVERLOADING)
socketClientFamily ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientLocalAddressPropertyInfo ,
#endif
clearSocketClientLocalAddress ,
constructSocketClientLocalAddress ,
getSocketClientLocalAddress ,
setSocketClientLocalAddress ,
#if defined(ENABLE_OVERLOADING)
socketClientLocalAddress ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientProtocolPropertyInfo ,
#endif
constructSocketClientProtocol ,
getSocketClientProtocol ,
setSocketClientProtocol ,
#if defined(ENABLE_OVERLOADING)
socketClientProtocol ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientProxyResolverPropertyInfo ,
#endif
clearSocketClientProxyResolver ,
constructSocketClientProxyResolver ,
getSocketClientProxyResolver ,
setSocketClientProxyResolver ,
#if defined(ENABLE_OVERLOADING)
socketClientProxyResolver ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientTimeoutPropertyInfo ,
#endif
constructSocketClientTimeout ,
getSocketClientTimeout ,
setSocketClientTimeout ,
#if defined(ENABLE_OVERLOADING)
socketClientTimeout ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientTlsPropertyInfo ,
#endif
constructSocketClientTls ,
getSocketClientTls ,
setSocketClientTls ,
#if defined(ENABLE_OVERLOADING)
socketClientTls ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientTlsValidationFlagsPropertyInfo,
#endif
constructSocketClientTlsValidationFlags ,
getSocketClientTlsValidationFlags ,
setSocketClientTlsValidationFlags ,
#if defined(ENABLE_OVERLOADING)
socketClientTlsValidationFlags ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketClientTypePropertyInfo ,
#endif
constructSocketClientType ,
getSocketClientType ,
setSocketClientType ,
#if defined(ENABLE_OVERLOADING)
socketClientType ,
#endif
C_SocketClientEventCallback ,
SocketClientEventCallback ,
#if defined(ENABLE_OVERLOADING)
SocketClientEventSignalInfo ,
#endif
afterSocketClientEvent ,
genClosure_SocketClientEvent ,
mk_SocketClientEventCallback ,
noSocketClientEventCallback ,
onSocketClientEvent ,
wrap_SocketClientEventCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
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.ProxyResolver as Gio.ProxyResolver
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.SocketAddress as Gio.SocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketConnection as Gio.SocketConnection
newtype SocketClient = SocketClient (ManagedPtr SocketClient)
deriving (SocketClient -> SocketClient -> Bool
(SocketClient -> SocketClient -> Bool)
-> (SocketClient -> SocketClient -> Bool) -> Eq SocketClient
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SocketClient -> SocketClient -> Bool
$c/= :: SocketClient -> SocketClient -> Bool
== :: SocketClient -> SocketClient -> Bool
$c== :: SocketClient -> SocketClient -> Bool
Eq)
foreign import ccall "g_socket_client_get_type"
c_g_socket_client_get_type :: IO GType
instance GObject SocketClient where
gobjectType :: IO GType
gobjectType = IO GType
c_g_socket_client_get_type
instance B.GValue.IsGValue SocketClient where
toGValue :: SocketClient -> IO GValue
toGValue o :: SocketClient
o = do
GType
gtype <- IO GType
c_g_socket_client_get_type
SocketClient -> (Ptr SocketClient -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SocketClient
o (GType
-> (GValue -> Ptr SocketClient -> IO ())
-> Ptr SocketClient
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr SocketClient -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO SocketClient
fromGValue gv :: GValue
gv = do
Ptr SocketClient
ptr <- GValue -> IO (Ptr SocketClient)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr SocketClient)
(ManagedPtr SocketClient -> SocketClient)
-> Ptr SocketClient -> IO SocketClient
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SocketClient -> SocketClient
SocketClient Ptr SocketClient
ptr
class (GObject o, O.IsDescendantOf SocketClient o) => IsSocketClient o
instance (GObject o, O.IsDescendantOf SocketClient o) => IsSocketClient o
instance O.HasParentTypes SocketClient
type instance O.ParentTypes SocketClient = '[GObject.Object.Object]
toSocketClient :: (MonadIO m, IsSocketClient o) => o -> m SocketClient
toSocketClient :: o -> m SocketClient
toSocketClient = IO SocketClient -> m SocketClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketClient -> m SocketClient)
-> (o -> IO SocketClient) -> o -> m SocketClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SocketClient -> SocketClient) -> o -> IO SocketClient
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr SocketClient -> SocketClient
SocketClient
noSocketClient :: Maybe SocketClient
noSocketClient :: Maybe SocketClient
noSocketClient = Maybe SocketClient
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSocketClientMethod (t :: Symbol) (o :: *) :: * where
ResolveSocketClientMethod "addApplicationProxy" o = SocketClientAddApplicationProxyMethodInfo
ResolveSocketClientMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSocketClientMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSocketClientMethod "connect" o = SocketClientConnectMethodInfo
ResolveSocketClientMethod "connectAsync" o = SocketClientConnectAsyncMethodInfo
ResolveSocketClientMethod "connectFinish" o = SocketClientConnectFinishMethodInfo
ResolveSocketClientMethod "connectToHost" o = SocketClientConnectToHostMethodInfo
ResolveSocketClientMethod "connectToHostAsync" o = SocketClientConnectToHostAsyncMethodInfo
ResolveSocketClientMethod "connectToHostFinish" o = SocketClientConnectToHostFinishMethodInfo
ResolveSocketClientMethod "connectToService" o = SocketClientConnectToServiceMethodInfo
ResolveSocketClientMethod "connectToServiceAsync" o = SocketClientConnectToServiceAsyncMethodInfo
ResolveSocketClientMethod "connectToServiceFinish" o = SocketClientConnectToServiceFinishMethodInfo
ResolveSocketClientMethod "connectToUri" o = SocketClientConnectToUriMethodInfo
ResolveSocketClientMethod "connectToUriAsync" o = SocketClientConnectToUriAsyncMethodInfo
ResolveSocketClientMethod "connectToUriFinish" o = SocketClientConnectToUriFinishMethodInfo
ResolveSocketClientMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSocketClientMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSocketClientMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSocketClientMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSocketClientMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSocketClientMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSocketClientMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSocketClientMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSocketClientMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSocketClientMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSocketClientMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSocketClientMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSocketClientMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSocketClientMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSocketClientMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSocketClientMethod "getEnableProxy" o = SocketClientGetEnableProxyMethodInfo
ResolveSocketClientMethod "getFamily" o = SocketClientGetFamilyMethodInfo
ResolveSocketClientMethod "getLocalAddress" o = SocketClientGetLocalAddressMethodInfo
ResolveSocketClientMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSocketClientMethod "getProtocol" o = SocketClientGetProtocolMethodInfo
ResolveSocketClientMethod "getProxyResolver" o = SocketClientGetProxyResolverMethodInfo
ResolveSocketClientMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSocketClientMethod "getSocketType" o = SocketClientGetSocketTypeMethodInfo
ResolveSocketClientMethod "getTimeout" o = SocketClientGetTimeoutMethodInfo
ResolveSocketClientMethod "getTls" o = SocketClientGetTlsMethodInfo
ResolveSocketClientMethod "getTlsValidationFlags" o = SocketClientGetTlsValidationFlagsMethodInfo
ResolveSocketClientMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSocketClientMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSocketClientMethod "setEnableProxy" o = SocketClientSetEnableProxyMethodInfo
ResolveSocketClientMethod "setFamily" o = SocketClientSetFamilyMethodInfo
ResolveSocketClientMethod "setLocalAddress" o = SocketClientSetLocalAddressMethodInfo
ResolveSocketClientMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSocketClientMethod "setProtocol" o = SocketClientSetProtocolMethodInfo
ResolveSocketClientMethod "setProxyResolver" o = SocketClientSetProxyResolverMethodInfo
ResolveSocketClientMethod "setSocketType" o = SocketClientSetSocketTypeMethodInfo
ResolveSocketClientMethod "setTimeout" o = SocketClientSetTimeoutMethodInfo
ResolveSocketClientMethod "setTls" o = SocketClientSetTlsMethodInfo
ResolveSocketClientMethod "setTlsValidationFlags" o = SocketClientSetTlsValidationFlagsMethodInfo
ResolveSocketClientMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSocketClientMethod t SocketClient, O.MethodInfo info SocketClient p) => OL.IsLabel t (SocketClient -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type SocketClientEventCallback =
Gio.Enums.SocketClientEvent
-> Gio.SocketConnectable.SocketConnectable
-> Maybe Gio.IOStream.IOStream
-> IO ()
noSocketClientEventCallback :: Maybe SocketClientEventCallback
noSocketClientEventCallback :: Maybe SocketClientEventCallback
noSocketClientEventCallback = Maybe SocketClientEventCallback
forall a. Maybe a
Nothing
type C_SocketClientEventCallback =
Ptr () ->
CUInt ->
Ptr Gio.SocketConnectable.SocketConnectable ->
Ptr Gio.IOStream.IOStream ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SocketClientEventCallback :: C_SocketClientEventCallback -> IO (FunPtr C_SocketClientEventCallback)
genClosure_SocketClientEvent :: MonadIO m => SocketClientEventCallback -> m (GClosure C_SocketClientEventCallback)
genClosure_SocketClientEvent :: SocketClientEventCallback
-> m (GClosure C_SocketClientEventCallback)
genClosure_SocketClientEvent cb :: SocketClientEventCallback
cb = IO (GClosure C_SocketClientEventCallback)
-> m (GClosure C_SocketClientEventCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SocketClientEventCallback)
-> m (GClosure C_SocketClientEventCallback))
-> IO (GClosure C_SocketClientEventCallback)
-> m (GClosure C_SocketClientEventCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SocketClientEventCallback
cb' = SocketClientEventCallback -> C_SocketClientEventCallback
wrap_SocketClientEventCallback SocketClientEventCallback
cb
C_SocketClientEventCallback
-> IO (FunPtr C_SocketClientEventCallback)
mk_SocketClientEventCallback C_SocketClientEventCallback
cb' IO (FunPtr C_SocketClientEventCallback)
-> (FunPtr C_SocketClientEventCallback
-> IO (GClosure C_SocketClientEventCallback))
-> IO (GClosure C_SocketClientEventCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SocketClientEventCallback
-> IO (GClosure C_SocketClientEventCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SocketClientEventCallback ::
SocketClientEventCallback ->
C_SocketClientEventCallback
wrap_SocketClientEventCallback :: SocketClientEventCallback -> C_SocketClientEventCallback
wrap_SocketClientEventCallback _cb :: SocketClientEventCallback
_cb _ event :: CUInt
event connectable :: Ptr SocketConnectable
connectable connection :: Ptr IOStream
connection _ = do
let event' :: SocketClientEvent
event' = (Int -> SocketClientEvent
forall a. Enum a => Int -> a
toEnum (Int -> SocketClientEvent)
-> (CUInt -> Int) -> CUInt -> SocketClientEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
event
SocketConnectable
connectable' <- ((ManagedPtr SocketConnectable -> SocketConnectable)
-> Ptr SocketConnectable -> IO SocketConnectable
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SocketConnectable -> SocketConnectable
Gio.SocketConnectable.SocketConnectable) Ptr SocketConnectable
connectable
Maybe IOStream
maybeConnection <-
if Ptr IOStream
connection Ptr IOStream -> Ptr IOStream -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr IOStream
forall a. Ptr a
nullPtr
then Maybe IOStream -> IO (Maybe IOStream)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOStream
forall a. Maybe a
Nothing
else do
IOStream
connection' <- ((ManagedPtr IOStream -> IOStream) -> Ptr IOStream -> IO IOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
connection
Maybe IOStream -> IO (Maybe IOStream)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe IOStream -> IO (Maybe IOStream))
-> Maybe IOStream -> IO (Maybe IOStream)
forall a b. (a -> b) -> a -> b
$ IOStream -> Maybe IOStream
forall a. a -> Maybe a
Just IOStream
connection'
SocketClientEventCallback
_cb SocketClientEvent
event' SocketConnectable
connectable' Maybe IOStream
maybeConnection
onSocketClientEvent :: (IsSocketClient a, MonadIO m) => a -> SocketClientEventCallback -> m SignalHandlerId
onSocketClientEvent :: a -> SocketClientEventCallback -> m SignalHandlerId
onSocketClientEvent obj :: a
obj cb :: SocketClientEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SocketClientEventCallback
cb' = SocketClientEventCallback -> C_SocketClientEventCallback
wrap_SocketClientEventCallback SocketClientEventCallback
cb
FunPtr C_SocketClientEventCallback
cb'' <- C_SocketClientEventCallback
-> IO (FunPtr C_SocketClientEventCallback)
mk_SocketClientEventCallback C_SocketClientEventCallback
cb'
a
-> Text
-> FunPtr C_SocketClientEventCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "event" FunPtr C_SocketClientEventCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSocketClientEvent :: (IsSocketClient a, MonadIO m) => a -> SocketClientEventCallback -> m SignalHandlerId
afterSocketClientEvent :: a -> SocketClientEventCallback -> m SignalHandlerId
afterSocketClientEvent obj :: a
obj cb :: SocketClientEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SocketClientEventCallback
cb' = SocketClientEventCallback -> C_SocketClientEventCallback
wrap_SocketClientEventCallback SocketClientEventCallback
cb
FunPtr C_SocketClientEventCallback
cb'' <- C_SocketClientEventCallback
-> IO (FunPtr C_SocketClientEventCallback)
mk_SocketClientEventCallback C_SocketClientEventCallback
cb'
a
-> Text
-> FunPtr C_SocketClientEventCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "event" FunPtr C_SocketClientEventCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SocketClientEventSignalInfo
instance SignalInfo SocketClientEventSignalInfo where
type HaskellCallbackType SocketClientEventSignalInfo = SocketClientEventCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SocketClientEventCallback cb
cb'' <- mk_SocketClientEventCallback cb'
connectSignalFunPtr obj "event" cb'' connectMode detail
#endif
getSocketClientEnableProxy :: (MonadIO m, IsSocketClient o) => o -> m Bool
getSocketClientEnableProxy :: o -> m Bool
getSocketClientEnableProxy obj :: o
obj = IO Bool -> m Bool
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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "enable-proxy"
setSocketClientEnableProxy :: (MonadIO m, IsSocketClient o) => o -> Bool -> m ()
setSocketClientEnableProxy :: o -> Bool -> m ()
setSocketClientEnableProxy obj :: o
obj val :: Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "enable-proxy" Bool
val
constructSocketClientEnableProxy :: (IsSocketClient o) => Bool -> IO (GValueConstruct o)
constructSocketClientEnableProxy :: Bool -> IO (GValueConstruct o)
constructSocketClientEnableProxy val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "enable-proxy" Bool
val
#if defined(ENABLE_OVERLOADING)
data SocketClientEnableProxyPropertyInfo
instance AttrInfo SocketClientEnableProxyPropertyInfo where
type AttrAllowedOps SocketClientEnableProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientEnableProxyPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientEnableProxyPropertyInfo = (~) Bool
type AttrTransferTypeConstraint SocketClientEnableProxyPropertyInfo = (~) Bool
type AttrTransferType SocketClientEnableProxyPropertyInfo = Bool
type AttrGetType SocketClientEnableProxyPropertyInfo = Bool
type AttrLabel SocketClientEnableProxyPropertyInfo = "enable-proxy"
type AttrOrigin SocketClientEnableProxyPropertyInfo = SocketClient
attrGet = getSocketClientEnableProxy
attrSet = setSocketClientEnableProxy
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientEnableProxy
attrClear = undefined
#endif
getSocketClientFamily :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketFamily
getSocketClientFamily :: o -> m SocketFamily
getSocketClientFamily obj :: o
obj = IO SocketFamily -> m SocketFamily
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketFamily -> m SocketFamily)
-> IO SocketFamily -> m SocketFamily
forall a b. (a -> b) -> a -> b
$ o -> String -> IO SocketFamily
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "family"
setSocketClientFamily :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketFamily -> m ()
setSocketClientFamily :: o -> SocketFamily -> m ()
setSocketClientFamily obj :: o
obj val :: SocketFamily
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> SocketFamily -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj "family" SocketFamily
val
constructSocketClientFamily :: (IsSocketClient o) => Gio.Enums.SocketFamily -> IO (GValueConstruct o)
constructSocketClientFamily :: SocketFamily -> IO (GValueConstruct o)
constructSocketClientFamily val :: SocketFamily
val = String -> SocketFamily -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum "family" SocketFamily
val
#if defined(ENABLE_OVERLOADING)
data SocketClientFamilyPropertyInfo
instance AttrInfo SocketClientFamilyPropertyInfo where
type AttrAllowedOps SocketClientFamilyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientFamilyPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientFamilyPropertyInfo = (~) Gio.Enums.SocketFamily
type AttrTransferTypeConstraint SocketClientFamilyPropertyInfo = (~) Gio.Enums.SocketFamily
type AttrTransferType SocketClientFamilyPropertyInfo = Gio.Enums.SocketFamily
type AttrGetType SocketClientFamilyPropertyInfo = Gio.Enums.SocketFamily
type AttrLabel SocketClientFamilyPropertyInfo = "family"
type AttrOrigin SocketClientFamilyPropertyInfo = SocketClient
attrGet = getSocketClientFamily
attrSet = setSocketClientFamily
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientFamily
attrClear = undefined
#endif
getSocketClientLocalAddress :: (MonadIO m, IsSocketClient o) => o -> m Gio.SocketAddress.SocketAddress
getSocketClientLocalAddress :: o -> m SocketAddress
getSocketClientLocalAddress obj :: o
obj = IO SocketAddress -> m SocketAddress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketAddress -> m SocketAddress)
-> IO SocketAddress -> m SocketAddress
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe SocketAddress) -> IO SocketAddress
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getSocketClientLocalAddress" (IO (Maybe SocketAddress) -> IO SocketAddress)
-> IO (Maybe SocketAddress) -> IO SocketAddress
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr SocketAddress -> SocketAddress)
-> IO (Maybe SocketAddress)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "local-address" ManagedPtr SocketAddress -> SocketAddress
Gio.SocketAddress.SocketAddress
setSocketClientLocalAddress :: (MonadIO m, IsSocketClient o, Gio.SocketAddress.IsSocketAddress a) => o -> a -> m ()
setSocketClientLocalAddress :: o -> a -> m ()
setSocketClientLocalAddress obj :: o
obj val :: a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "local-address" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructSocketClientLocalAddress :: (IsSocketClient o, Gio.SocketAddress.IsSocketAddress a) => a -> IO (GValueConstruct o)
constructSocketClientLocalAddress :: a -> IO (GValueConstruct o)
constructSocketClientLocalAddress val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "local-address" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
clearSocketClientLocalAddress :: (MonadIO m, IsSocketClient o) => o -> m ()
clearSocketClientLocalAddress :: o -> m ()
clearSocketClientLocalAddress obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe SocketAddress -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "local-address" (Maybe SocketAddress
forall a. Maybe a
Nothing :: Maybe Gio.SocketAddress.SocketAddress)
#if defined(ENABLE_OVERLOADING)
data SocketClientLocalAddressPropertyInfo
instance AttrInfo SocketClientLocalAddressPropertyInfo where
type AttrAllowedOps SocketClientLocalAddressPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SocketClientLocalAddressPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientLocalAddressPropertyInfo = Gio.SocketAddress.IsSocketAddress
type AttrTransferTypeConstraint SocketClientLocalAddressPropertyInfo = Gio.SocketAddress.IsSocketAddress
type AttrTransferType SocketClientLocalAddressPropertyInfo = Gio.SocketAddress.SocketAddress
type AttrGetType SocketClientLocalAddressPropertyInfo = Gio.SocketAddress.SocketAddress
type AttrLabel SocketClientLocalAddressPropertyInfo = "local-address"
type AttrOrigin SocketClientLocalAddressPropertyInfo = SocketClient
attrGet = getSocketClientLocalAddress
attrSet = setSocketClientLocalAddress
attrTransfer _ v = do
unsafeCastTo Gio.SocketAddress.SocketAddress v
attrConstruct = constructSocketClientLocalAddress
attrClear = clearSocketClientLocalAddress
#endif
getSocketClientProtocol :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketProtocol
getSocketClientProtocol :: o -> m SocketProtocol
getSocketClientProtocol obj :: o
obj = IO SocketProtocol -> m SocketProtocol
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketProtocol -> m SocketProtocol)
-> IO SocketProtocol -> m SocketProtocol
forall a b. (a -> b) -> a -> b
$ o -> String -> IO SocketProtocol
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "protocol"
setSocketClientProtocol :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketProtocol -> m ()
setSocketClientProtocol :: o -> SocketProtocol -> m ()
setSocketClientProtocol obj :: o
obj val :: SocketProtocol
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> SocketProtocol -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj "protocol" SocketProtocol
val
constructSocketClientProtocol :: (IsSocketClient o) => Gio.Enums.SocketProtocol -> IO (GValueConstruct o)
constructSocketClientProtocol :: SocketProtocol -> IO (GValueConstruct o)
constructSocketClientProtocol val :: SocketProtocol
val = String -> SocketProtocol -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum "protocol" SocketProtocol
val
#if defined(ENABLE_OVERLOADING)
data SocketClientProtocolPropertyInfo
instance AttrInfo SocketClientProtocolPropertyInfo where
type AttrAllowedOps SocketClientProtocolPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientProtocolPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientProtocolPropertyInfo = (~) Gio.Enums.SocketProtocol
type AttrTransferTypeConstraint SocketClientProtocolPropertyInfo = (~) Gio.Enums.SocketProtocol
type AttrTransferType SocketClientProtocolPropertyInfo = Gio.Enums.SocketProtocol
type AttrGetType SocketClientProtocolPropertyInfo = Gio.Enums.SocketProtocol
type AttrLabel SocketClientProtocolPropertyInfo = "protocol"
type AttrOrigin SocketClientProtocolPropertyInfo = SocketClient
attrGet = getSocketClientProtocol
attrSet = setSocketClientProtocol
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientProtocol
attrClear = undefined
#endif
getSocketClientProxyResolver :: (MonadIO m, IsSocketClient o) => o -> m Gio.ProxyResolver.ProxyResolver
getSocketClientProxyResolver :: o -> m ProxyResolver
getSocketClientProxyResolver obj :: o
obj = IO ProxyResolver -> m ProxyResolver
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ProxyResolver -> m ProxyResolver)
-> IO ProxyResolver -> m ProxyResolver
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe ProxyResolver) -> IO ProxyResolver
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getSocketClientProxyResolver" (IO (Maybe ProxyResolver) -> IO ProxyResolver)
-> IO (Maybe ProxyResolver) -> IO ProxyResolver
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ProxyResolver -> ProxyResolver)
-> IO (Maybe ProxyResolver)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "proxy-resolver" ManagedPtr ProxyResolver -> ProxyResolver
Gio.ProxyResolver.ProxyResolver
setSocketClientProxyResolver :: (MonadIO m, IsSocketClient o, Gio.ProxyResolver.IsProxyResolver a) => o -> a -> m ()
setSocketClientProxyResolver :: o -> a -> m ()
setSocketClientProxyResolver obj :: o
obj val :: a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "proxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructSocketClientProxyResolver :: (IsSocketClient o, Gio.ProxyResolver.IsProxyResolver a) => a -> IO (GValueConstruct o)
constructSocketClientProxyResolver :: a -> IO (GValueConstruct o)
constructSocketClientProxyResolver val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "proxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
clearSocketClientProxyResolver :: (MonadIO m, IsSocketClient o) => o -> m ()
clearSocketClientProxyResolver :: o -> m ()
clearSocketClientProxyResolver obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe ProxyResolver -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "proxy-resolver" (Maybe ProxyResolver
forall a. Maybe a
Nothing :: Maybe Gio.ProxyResolver.ProxyResolver)
#if defined(ENABLE_OVERLOADING)
data SocketClientProxyResolverPropertyInfo
instance AttrInfo SocketClientProxyResolverPropertyInfo where
type AttrAllowedOps SocketClientProxyResolverPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SocketClientProxyResolverPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientProxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
type AttrTransferTypeConstraint SocketClientProxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
type AttrTransferType SocketClientProxyResolverPropertyInfo = Gio.ProxyResolver.ProxyResolver
type AttrGetType SocketClientProxyResolverPropertyInfo = Gio.ProxyResolver.ProxyResolver
type AttrLabel SocketClientProxyResolverPropertyInfo = "proxy-resolver"
type AttrOrigin SocketClientProxyResolverPropertyInfo = SocketClient
attrGet = getSocketClientProxyResolver
attrSet = setSocketClientProxyResolver
attrTransfer _ v = do
unsafeCastTo Gio.ProxyResolver.ProxyResolver v
attrConstruct = constructSocketClientProxyResolver
attrClear = clearSocketClientProxyResolver
#endif
getSocketClientTimeout :: (MonadIO m, IsSocketClient o) => o -> m Word32
getSocketClientTimeout :: o -> m Word32
getSocketClientTimeout obj :: o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj "timeout"
setSocketClientTimeout :: (MonadIO m, IsSocketClient o) => o -> Word32 -> m ()
setSocketClientTimeout :: o -> Word32 -> m ()
setSocketClientTimeout obj :: o
obj val :: Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj "timeout" Word32
val
constructSocketClientTimeout :: (IsSocketClient o) => Word32 -> IO (GValueConstruct o)
constructSocketClientTimeout :: Word32 -> IO (GValueConstruct o)
constructSocketClientTimeout val :: Word32
val = String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 "timeout" Word32
val
#if defined(ENABLE_OVERLOADING)
data SocketClientTimeoutPropertyInfo
instance AttrInfo SocketClientTimeoutPropertyInfo where
type AttrAllowedOps SocketClientTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientTimeoutPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientTimeoutPropertyInfo = (~) Word32
type AttrTransferTypeConstraint SocketClientTimeoutPropertyInfo = (~) Word32
type AttrTransferType SocketClientTimeoutPropertyInfo = Word32
type AttrGetType SocketClientTimeoutPropertyInfo = Word32
type AttrLabel SocketClientTimeoutPropertyInfo = "timeout"
type AttrOrigin SocketClientTimeoutPropertyInfo = SocketClient
attrGet = getSocketClientTimeout
attrSet = setSocketClientTimeout
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientTimeout
attrClear = undefined
#endif
getSocketClientTls :: (MonadIO m, IsSocketClient o) => o -> m Bool
getSocketClientTls :: o -> m Bool
getSocketClientTls obj :: o
obj = IO Bool -> m Bool
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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "tls"
setSocketClientTls :: (MonadIO m, IsSocketClient o) => o -> Bool -> m ()
setSocketClientTls :: o -> Bool -> m ()
setSocketClientTls obj :: o
obj val :: Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "tls" Bool
val
constructSocketClientTls :: (IsSocketClient o) => Bool -> IO (GValueConstruct o)
constructSocketClientTls :: Bool -> IO (GValueConstruct o)
constructSocketClientTls val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "tls" Bool
val
#if defined(ENABLE_OVERLOADING)
data SocketClientTlsPropertyInfo
instance AttrInfo SocketClientTlsPropertyInfo where
type AttrAllowedOps SocketClientTlsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientTlsPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientTlsPropertyInfo = (~) Bool
type AttrTransferTypeConstraint SocketClientTlsPropertyInfo = (~) Bool
type AttrTransferType SocketClientTlsPropertyInfo = Bool
type AttrGetType SocketClientTlsPropertyInfo = Bool
type AttrLabel SocketClientTlsPropertyInfo = "tls"
type AttrOrigin SocketClientTlsPropertyInfo = SocketClient
attrGet = getSocketClientTls
attrSet = setSocketClientTls
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientTls
attrClear = undefined
#endif
getSocketClientTlsValidationFlags :: (MonadIO m, IsSocketClient o) => o -> m [Gio.Flags.TlsCertificateFlags]
getSocketClientTlsValidationFlags :: o -> m [TlsCertificateFlags]
getSocketClientTlsValidationFlags obj :: o
obj = IO [TlsCertificateFlags] -> m [TlsCertificateFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TlsCertificateFlags] -> m [TlsCertificateFlags])
-> IO [TlsCertificateFlags] -> m [TlsCertificateFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [TlsCertificateFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj "tls-validation-flags"
setSocketClientTlsValidationFlags :: (MonadIO m, IsSocketClient o) => o -> [Gio.Flags.TlsCertificateFlags] -> m ()
setSocketClientTlsValidationFlags :: o -> [TlsCertificateFlags] -> m ()
setSocketClientTlsValidationFlags obj :: o
obj val :: [TlsCertificateFlags]
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> [TlsCertificateFlags] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj "tls-validation-flags" [TlsCertificateFlags]
val
constructSocketClientTlsValidationFlags :: (IsSocketClient o) => [Gio.Flags.TlsCertificateFlags] -> IO (GValueConstruct o)
constructSocketClientTlsValidationFlags :: [TlsCertificateFlags] -> IO (GValueConstruct o)
constructSocketClientTlsValidationFlags val :: [TlsCertificateFlags]
val = String -> [TlsCertificateFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags "tls-validation-flags" [TlsCertificateFlags]
val
#if defined(ENABLE_OVERLOADING)
data SocketClientTlsValidationFlagsPropertyInfo
instance AttrInfo SocketClientTlsValidationFlagsPropertyInfo where
type AttrAllowedOps SocketClientTlsValidationFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientTlsValidationFlagsPropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientTlsValidationFlagsPropertyInfo = (~) [Gio.Flags.TlsCertificateFlags]
type AttrTransferTypeConstraint SocketClientTlsValidationFlagsPropertyInfo = (~) [Gio.Flags.TlsCertificateFlags]
type AttrTransferType SocketClientTlsValidationFlagsPropertyInfo = [Gio.Flags.TlsCertificateFlags]
type AttrGetType SocketClientTlsValidationFlagsPropertyInfo = [Gio.Flags.TlsCertificateFlags]
type AttrLabel SocketClientTlsValidationFlagsPropertyInfo = "tls-validation-flags"
type AttrOrigin SocketClientTlsValidationFlagsPropertyInfo = SocketClient
attrGet = getSocketClientTlsValidationFlags
attrSet = setSocketClientTlsValidationFlags
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientTlsValidationFlags
attrClear = undefined
#endif
getSocketClientType :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketType
getSocketClientType :: o -> m SocketType
getSocketClientType obj :: o
obj = IO SocketType -> m SocketType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketType -> m SocketType) -> IO SocketType -> m SocketType
forall a b. (a -> b) -> a -> b
$ o -> String -> IO SocketType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "type"
setSocketClientType :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketType -> m ()
setSocketClientType :: o -> SocketType -> m ()
setSocketClientType obj :: o
obj val :: SocketType
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> SocketType -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj "type" SocketType
val
constructSocketClientType :: (IsSocketClient o) => Gio.Enums.SocketType -> IO (GValueConstruct o)
constructSocketClientType :: SocketType -> IO (GValueConstruct o)
constructSocketClientType val :: SocketType
val = String -> SocketType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum "type" SocketType
val
#if defined(ENABLE_OVERLOADING)
data SocketClientTypePropertyInfo
instance AttrInfo SocketClientTypePropertyInfo where
type AttrAllowedOps SocketClientTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketClientTypePropertyInfo = IsSocketClient
type AttrSetTypeConstraint SocketClientTypePropertyInfo = (~) Gio.Enums.SocketType
type AttrTransferTypeConstraint SocketClientTypePropertyInfo = (~) Gio.Enums.SocketType
type AttrTransferType SocketClientTypePropertyInfo = Gio.Enums.SocketType
type AttrGetType SocketClientTypePropertyInfo = Gio.Enums.SocketType
type AttrLabel SocketClientTypePropertyInfo = "type"
type AttrOrigin SocketClientTypePropertyInfo = SocketClient
attrGet = getSocketClientType
attrSet = setSocketClientType
attrTransfer _ v = do
return v
attrConstruct = constructSocketClientType
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SocketClient
type instance O.AttributeList SocketClient = SocketClientAttributeList
type SocketClientAttributeList = ('[ '("enableProxy", SocketClientEnableProxyPropertyInfo), '("family", SocketClientFamilyPropertyInfo), '("localAddress", SocketClientLocalAddressPropertyInfo), '("protocol", SocketClientProtocolPropertyInfo), '("proxyResolver", SocketClientProxyResolverPropertyInfo), '("timeout", SocketClientTimeoutPropertyInfo), '("tls", SocketClientTlsPropertyInfo), '("tlsValidationFlags", SocketClientTlsValidationFlagsPropertyInfo), '("type", SocketClientTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
socketClientEnableProxy :: AttrLabelProxy "enableProxy"
socketClientEnableProxy = AttrLabelProxy
socketClientFamily :: AttrLabelProxy "family"
socketClientFamily = AttrLabelProxy
socketClientLocalAddress :: AttrLabelProxy "localAddress"
socketClientLocalAddress = AttrLabelProxy
socketClientProtocol :: AttrLabelProxy "protocol"
socketClientProtocol = AttrLabelProxy
socketClientProxyResolver :: AttrLabelProxy "proxyResolver"
socketClientProxyResolver = AttrLabelProxy
socketClientTimeout :: AttrLabelProxy "timeout"
socketClientTimeout = AttrLabelProxy
socketClientTls :: AttrLabelProxy "tls"
socketClientTls = AttrLabelProxy
socketClientTlsValidationFlags :: AttrLabelProxy "tlsValidationFlags"
socketClientTlsValidationFlags = AttrLabelProxy
socketClientType :: AttrLabelProxy "type"
socketClientType = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SocketClient = SocketClientSignalList
type SocketClientSignalList = ('[ '("event", SocketClientEventSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_socket_client_new" g_socket_client_new ::
IO (Ptr SocketClient)
socketClientNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SocketClient
socketClientNew :: m SocketClient
socketClientNew = IO SocketClient -> m SocketClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketClient -> m SocketClient)
-> IO SocketClient -> m SocketClient
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
result <- IO (Ptr SocketClient)
g_socket_client_new
Text -> Ptr SocketClient -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientNew" Ptr SocketClient
result
SocketClient
result' <- ((ManagedPtr SocketClient -> SocketClient)
-> Ptr SocketClient -> IO SocketClient
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketClient -> SocketClient
SocketClient) Ptr SocketClient
result
SocketClient -> IO SocketClient
forall (m :: * -> *) a. Monad m => a -> m a
return SocketClient
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_socket_client_add_application_proxy" g_socket_client_add_application_proxy ::
Ptr SocketClient ->
CString ->
IO ()
socketClientAddApplicationProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> T.Text
-> m ()
socketClientAddApplicationProxy :: a -> Text -> m ()
socketClientAddApplicationProxy client :: a
client protocol :: Text
protocol = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
protocol' <- Text -> IO CString
textToCString Text
protocol
Ptr SocketClient -> CString -> IO ()
g_socket_client_add_application_proxy Ptr SocketClient
client' CString
protocol'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
protocol'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientAddApplicationProxyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientAddApplicationProxyMethodInfo a signature where
overloadedMethod = socketClientAddApplicationProxy
#endif
foreign import ccall "g_socket_client_connect" g_socket_client_connect ::
Ptr SocketClient ->
Ptr Gio.SocketConnectable.SocketConnectable ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnect ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m Gio.SocketConnection.SocketConnection
socketClientConnect :: a -> b -> Maybe c -> m SocketConnection
socketClientConnect client :: a
client connectable :: b
connectable cancellable :: Maybe c
cancellable = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr SocketConnectable
connectable' <- b -> IO (Ptr SocketConnectable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connectable
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> Ptr SocketConnectable
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr SocketConnection)
g_socket_client_connect Ptr SocketClient
client' Ptr SocketConnectable
connectable' Ptr Cancellable
maybeCancellable
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnect" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connectable
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectMethodInfo
instance (signature ~ (b -> Maybe (c) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) => O.MethodInfo SocketClientConnectMethodInfo a signature where
overloadedMethod = socketClientConnect
#endif
foreign import ccall "g_socket_client_connect_async" g_socket_client_connect_async ::
Ptr SocketClient ->
Ptr Gio.SocketConnectable.SocketConnectable ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
socketClientConnectAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
socketClientConnectAsync :: a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
socketClientConnectAsync client :: a
client connectable :: b
connectable cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr SocketConnectable
connectable' <- b -> IO (Ptr SocketConnectable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connectable
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr SocketClient
-> Ptr SocketConnectable
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_socket_client_connect_async Ptr SocketClient
client' Ptr SocketConnectable
connectable' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connectable
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectAsyncMethodInfo
instance (signature ~ (b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) => O.MethodInfo SocketClientConnectAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectAsync
#endif
foreign import ccall "g_socket_client_connect_finish" g_socket_client_connect_finish ::
Ptr SocketClient ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.SocketConnection.SocketConnection
socketClientConnectFinish :: a -> b -> m SocketConnection
socketClientConnectFinish client :: a
client result_ :: b
result_ = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr SocketConnection)
g_socket_client_connect_finish Ptr SocketClient
client' Ptr AsyncResult
result_'
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectFinish" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectFinishMethodInfo a signature where
overloadedMethod = socketClientConnectFinish
#endif
foreign import ccall "g_socket_client_connect_to_host" g_socket_client_connect_to_host ::
Ptr SocketClient ->
CString ->
Word16 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectToHost ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Word16
-> Maybe (b)
-> m Gio.SocketConnection.SocketConnection
socketClientConnectToHost :: a -> Text -> Word16 -> Maybe b -> m SocketConnection
socketClientConnectToHost client :: a
client hostAndPort :: Text
hostAndPort defaultPort :: Word16
defaultPort cancellable :: Maybe b
cancellable = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
hostAndPort' <- Text -> IO CString
textToCString Text
hostAndPort
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> CString
-> Word16
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr SocketConnection)
g_socket_client_connect_to_host Ptr SocketClient
client' CString
hostAndPort' Word16
defaultPort Ptr Cancellable
maybeCancellable
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectToHost" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostAndPort'
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostAndPort'
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToHostMethodInfo
instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToHostMethodInfo a signature where
overloadedMethod = socketClientConnectToHost
#endif
foreign import ccall "g_socket_client_connect_to_host_async" g_socket_client_connect_to_host_async ::
Ptr SocketClient ->
CString ->
Word16 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
socketClientConnectToHostAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Word16
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
socketClientConnectToHostAsync :: a -> Text -> Word16 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
socketClientConnectToHostAsync client :: a
client hostAndPort :: Text
hostAndPort defaultPort :: Word16
defaultPort cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
hostAndPort' <- Text -> IO CString
textToCString Text
hostAndPort
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr SocketClient
-> CString
-> Word16
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_socket_client_connect_to_host_async Ptr SocketClient
client' CString
hostAndPort' Word16
defaultPort Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostAndPort'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToHostAsyncMethodInfo
instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToHostAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectToHostAsync
#endif
foreign import ccall "g_socket_client_connect_to_host_finish" g_socket_client_connect_to_host_finish ::
Ptr SocketClient ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectToHostFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.SocketConnection.SocketConnection
socketClientConnectToHostFinish :: a -> b -> m SocketConnection
socketClientConnectToHostFinish client :: a
client result_ :: b
result_ = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr SocketConnection)
g_socket_client_connect_to_host_finish Ptr SocketClient
client' Ptr AsyncResult
result_'
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectToHostFinish" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToHostFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectToHostFinishMethodInfo a signature where
overloadedMethod = socketClientConnectToHostFinish
#endif
foreign import ccall "g_socket_client_connect_to_service" g_socket_client_connect_to_service ::
Ptr SocketClient ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectToService ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> Maybe (b)
-> m Gio.SocketConnection.SocketConnection
socketClientConnectToService :: a -> Text -> Text -> Maybe b -> m SocketConnection
socketClientConnectToService client :: a
client domain :: Text
domain service :: Text
service cancellable :: Maybe b
cancellable = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
domain' <- Text -> IO CString
textToCString Text
domain
CString
service' <- Text -> IO CString
textToCString Text
service
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr SocketConnection)
g_socket_client_connect_to_service Ptr SocketClient
client' CString
domain' CString
service' Ptr Cancellable
maybeCancellable
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectToService" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
service'
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
service'
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToServiceMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (b) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToServiceMethodInfo a signature where
overloadedMethod = socketClientConnectToService
#endif
foreign import ccall "g_socket_client_connect_to_service_async" g_socket_client_connect_to_service_async ::
Ptr SocketClient ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
socketClientConnectToServiceAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
socketClientConnectToServiceAsync :: a -> Text -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
socketClientConnectToServiceAsync client :: a
client domain :: Text
domain service :: Text
service cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
domain' <- Text -> IO CString
textToCString Text
domain
CString
service' <- Text -> IO CString
textToCString Text
service
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr SocketClient
-> CString
-> CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_socket_client_connect_to_service_async Ptr SocketClient
client' CString
domain' CString
service' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
service'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToServiceAsyncMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToServiceAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectToServiceAsync
#endif
foreign import ccall "g_socket_client_connect_to_service_finish" g_socket_client_connect_to_service_finish ::
Ptr SocketClient ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectToServiceFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.SocketConnection.SocketConnection
socketClientConnectToServiceFinish :: a -> b -> m SocketConnection
socketClientConnectToServiceFinish client :: a
client result_ :: b
result_ = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr SocketConnection)
g_socket_client_connect_to_service_finish Ptr SocketClient
client' Ptr AsyncResult
result_'
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectToServiceFinish" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToServiceFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectToServiceFinishMethodInfo a signature where
overloadedMethod = socketClientConnectToServiceFinish
#endif
foreign import ccall "g_socket_client_connect_to_uri" g_socket_client_connect_to_uri ::
Ptr SocketClient ->
CString ->
Word16 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectToUri ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Word16
-> Maybe (b)
-> m Gio.SocketConnection.SocketConnection
socketClientConnectToUri :: a -> Text -> Word16 -> Maybe b -> m SocketConnection
socketClientConnectToUri client :: a
client uri :: Text
uri defaultPort :: Word16
defaultPort cancellable :: Maybe b
cancellable = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
uri' <- Text -> IO CString
textToCString Text
uri
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> CString
-> Word16
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr SocketConnection)
g_socket_client_connect_to_uri Ptr SocketClient
client' CString
uri' Word16
defaultPort Ptr Cancellable
maybeCancellable
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectToUri" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToUriMethodInfo
instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToUriMethodInfo a signature where
overloadedMethod = socketClientConnectToUri
#endif
foreign import ccall "g_socket_client_connect_to_uri_async" g_socket_client_connect_to_uri_async ::
Ptr SocketClient ->
CString ->
Word16 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
socketClientConnectToUriAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Word16
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
socketClientConnectToUriAsync :: a -> Text -> Word16 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
socketClientConnectToUriAsync client :: a
client uri :: Text
uri defaultPort :: Word16
defaultPort cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CString
uri' <- Text -> IO CString
textToCString Text
uri
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr SocketClient
-> CString
-> Word16
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_socket_client_connect_to_uri_async Ptr SocketClient
client' CString
uri' Word16
defaultPort Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToUriAsyncMethodInfo
instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToUriAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectToUriAsync
#endif
foreign import ccall "g_socket_client_connect_to_uri_finish" g_socket_client_connect_to_uri_finish ::
Ptr SocketClient ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketConnection.SocketConnection)
socketClientConnectToUriFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.SocketConnection.SocketConnection
socketClientConnectToUriFinish :: a -> b -> m SocketConnection
socketClientConnectToUriFinish client :: a
client result_ :: b
result_ = IO SocketConnection -> m SocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnection -> m SocketConnection)
-> IO SocketConnection -> m SocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO SocketConnection -> IO () -> IO SocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr SocketConnection))
-> IO (Ptr SocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr SocketClient
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr SocketConnection)
g_socket_client_connect_to_uri_finish Ptr SocketClient
client' Ptr AsyncResult
result_'
Text -> Ptr SocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientConnectToUriFinish" Ptr SocketConnection
result
SocketConnection
result' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
SocketConnection -> IO SocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return SocketConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToUriFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectToUriFinishMethodInfo a signature where
overloadedMethod = socketClientConnectToUriFinish
#endif
foreign import ccall "g_socket_client_get_enable_proxy" g_socket_client_get_enable_proxy ::
Ptr SocketClient ->
IO CInt
socketClientGetEnableProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Bool
socketClientGetEnableProxy :: a -> m Bool
socketClientGetEnableProxy client :: a
client = IO Bool -> m Bool
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
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CInt
result <- Ptr SocketClient -> IO CInt
g_socket_client_get_enable_proxy Ptr SocketClient
client'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetEnableProxyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetEnableProxyMethodInfo a signature where
overloadedMethod = socketClientGetEnableProxy
#endif
foreign import ccall "g_socket_client_get_family" g_socket_client_get_family ::
Ptr SocketClient ->
IO CUInt
socketClientGetFamily ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Gio.Enums.SocketFamily
socketClientGetFamily :: a -> m SocketFamily
socketClientGetFamily client :: a
client = IO SocketFamily -> m SocketFamily
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketFamily -> m SocketFamily)
-> IO SocketFamily -> m SocketFamily
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CUInt
result <- Ptr SocketClient -> IO CUInt
g_socket_client_get_family Ptr SocketClient
client'
let result' :: SocketFamily
result' = (Int -> SocketFamily
forall a. Enum a => Int -> a
toEnum (Int -> SocketFamily) -> (CUInt -> Int) -> CUInt -> SocketFamily
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
SocketFamily -> IO SocketFamily
forall (m :: * -> *) a. Monad m => a -> m a
return SocketFamily
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetFamilyMethodInfo
instance (signature ~ (m Gio.Enums.SocketFamily), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetFamilyMethodInfo a signature where
overloadedMethod = socketClientGetFamily
#endif
foreign import ccall "g_socket_client_get_local_address" g_socket_client_get_local_address ::
Ptr SocketClient ->
IO (Ptr Gio.SocketAddress.SocketAddress)
socketClientGetLocalAddress ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Gio.SocketAddress.SocketAddress
socketClientGetLocalAddress :: a -> m SocketAddress
socketClientGetLocalAddress client :: a
client = IO SocketAddress -> m SocketAddress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketAddress -> m SocketAddress)
-> IO SocketAddress -> m SocketAddress
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr SocketAddress
result <- Ptr SocketClient -> IO (Ptr SocketAddress)
g_socket_client_get_local_address Ptr SocketClient
client'
Text -> Ptr SocketAddress -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientGetLocalAddress" Ptr SocketAddress
result
SocketAddress
result' <- ((ManagedPtr SocketAddress -> SocketAddress)
-> Ptr SocketAddress -> IO SocketAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SocketAddress -> SocketAddress
Gio.SocketAddress.SocketAddress) Ptr SocketAddress
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
SocketAddress -> IO SocketAddress
forall (m :: * -> *) a. Monad m => a -> m a
return SocketAddress
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetLocalAddressMethodInfo
instance (signature ~ (m Gio.SocketAddress.SocketAddress), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetLocalAddressMethodInfo a signature where
overloadedMethod = socketClientGetLocalAddress
#endif
foreign import ccall "g_socket_client_get_protocol" g_socket_client_get_protocol ::
Ptr SocketClient ->
IO CInt
socketClientGetProtocol ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Gio.Enums.SocketProtocol
socketClientGetProtocol :: a -> m SocketProtocol
socketClientGetProtocol client :: a
client = IO SocketProtocol -> m SocketProtocol
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketProtocol -> m SocketProtocol)
-> IO SocketProtocol -> m SocketProtocol
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CInt
result <- Ptr SocketClient -> IO CInt
g_socket_client_get_protocol Ptr SocketClient
client'
let result' :: SocketProtocol
result' = (Int -> SocketProtocol
forall a. Enum a => Int -> a
toEnum (Int -> SocketProtocol) -> (CInt -> Int) -> CInt -> SocketProtocol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
SocketProtocol -> IO SocketProtocol
forall (m :: * -> *) a. Monad m => a -> m a
return SocketProtocol
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetProtocolMethodInfo
instance (signature ~ (m Gio.Enums.SocketProtocol), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetProtocolMethodInfo a signature where
overloadedMethod = socketClientGetProtocol
#endif
foreign import ccall "g_socket_client_get_proxy_resolver" g_socket_client_get_proxy_resolver ::
Ptr SocketClient ->
IO (Ptr Gio.ProxyResolver.ProxyResolver)
socketClientGetProxyResolver ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Gio.ProxyResolver.ProxyResolver
socketClientGetProxyResolver :: a -> m ProxyResolver
socketClientGetProxyResolver client :: a
client = IO ProxyResolver -> m ProxyResolver
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ProxyResolver -> m ProxyResolver)
-> IO ProxyResolver -> m ProxyResolver
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr ProxyResolver
result <- Ptr SocketClient -> IO (Ptr ProxyResolver)
g_socket_client_get_proxy_resolver Ptr SocketClient
client'
Text -> Ptr ProxyResolver -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketClientGetProxyResolver" Ptr ProxyResolver
result
ProxyResolver
result' <- ((ManagedPtr ProxyResolver -> ProxyResolver)
-> Ptr ProxyResolver -> IO ProxyResolver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ProxyResolver -> ProxyResolver
Gio.ProxyResolver.ProxyResolver) Ptr ProxyResolver
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
ProxyResolver -> IO ProxyResolver
forall (m :: * -> *) a. Monad m => a -> m a
return ProxyResolver
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetProxyResolverMethodInfo
instance (signature ~ (m Gio.ProxyResolver.ProxyResolver), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetProxyResolverMethodInfo a signature where
overloadedMethod = socketClientGetProxyResolver
#endif
foreign import ccall "g_socket_client_get_socket_type" g_socket_client_get_socket_type ::
Ptr SocketClient ->
IO CUInt
socketClientGetSocketType ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Gio.Enums.SocketType
socketClientGetSocketType :: a -> m SocketType
socketClientGetSocketType client :: a
client = IO SocketType -> m SocketType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketType -> m SocketType) -> IO SocketType -> m SocketType
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CUInt
result <- Ptr SocketClient -> IO CUInt
g_socket_client_get_socket_type Ptr SocketClient
client'
let result' :: SocketType
result' = (Int -> SocketType
forall a. Enum a => Int -> a
toEnum (Int -> SocketType) -> (CUInt -> Int) -> CUInt -> SocketType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
SocketType -> IO SocketType
forall (m :: * -> *) a. Monad m => a -> m a
return SocketType
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetSocketTypeMethodInfo
instance (signature ~ (m Gio.Enums.SocketType), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetSocketTypeMethodInfo a signature where
overloadedMethod = socketClientGetSocketType
#endif
foreign import ccall "g_socket_client_get_timeout" g_socket_client_get_timeout ::
Ptr SocketClient ->
IO Word32
socketClientGetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Word32
socketClientGetTimeout :: a -> m Word32
socketClientGetTimeout client :: a
client = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Word32
result <- Ptr SocketClient -> IO Word32
g_socket_client_get_timeout Ptr SocketClient
client'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data SocketClientGetTimeoutMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetTimeoutMethodInfo a signature where
overloadedMethod = socketClientGetTimeout
#endif
foreign import ccall "g_socket_client_get_tls" g_socket_client_get_tls ::
Ptr SocketClient ->
IO CInt
socketClientGetTls ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m Bool
socketClientGetTls :: a -> m Bool
socketClientGetTls client :: a
client = IO Bool -> m Bool
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
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CInt
result <- Ptr SocketClient -> IO CInt
g_socket_client_get_tls Ptr SocketClient
client'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetTlsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetTlsMethodInfo a signature where
overloadedMethod = socketClientGetTls
#endif
foreign import ccall "g_socket_client_get_tls_validation_flags" g_socket_client_get_tls_validation_flags ::
Ptr SocketClient ->
IO CUInt
socketClientGetTlsValidationFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m [Gio.Flags.TlsCertificateFlags]
socketClientGetTlsValidationFlags :: a -> m [TlsCertificateFlags]
socketClientGetTlsValidationFlags client :: a
client = IO [TlsCertificateFlags] -> m [TlsCertificateFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TlsCertificateFlags] -> m [TlsCertificateFlags])
-> IO [TlsCertificateFlags] -> m [TlsCertificateFlags]
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
CUInt
result <- Ptr SocketClient -> IO CUInt
g_socket_client_get_tls_validation_flags Ptr SocketClient
client'
let result' :: [TlsCertificateFlags]
result' = CUInt -> [TlsCertificateFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
[TlsCertificateFlags] -> IO [TlsCertificateFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [TlsCertificateFlags]
result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetTlsValidationFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.TlsCertificateFlags]), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetTlsValidationFlagsMethodInfo a signature where
overloadedMethod = socketClientGetTlsValidationFlags
#endif
foreign import ccall "g_socket_client_set_enable_proxy" g_socket_client_set_enable_proxy ::
Ptr SocketClient ->
CInt ->
IO ()
socketClientSetEnableProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> Bool
-> m ()
socketClientSetEnableProxy :: a -> Bool -> m ()
socketClientSetEnableProxy client :: a
client enable :: Bool
enable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let enable' :: CInt
enable' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
enable
Ptr SocketClient -> CInt -> IO ()
g_socket_client_set_enable_proxy Ptr SocketClient
client' CInt
enable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetEnableProxyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetEnableProxyMethodInfo a signature where
overloadedMethod = socketClientSetEnableProxy
#endif
foreign import ccall "g_socket_client_set_family" g_socket_client_set_family ::
Ptr SocketClient ->
CUInt ->
IO ()
socketClientSetFamily ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> Gio.Enums.SocketFamily
-> m ()
socketClientSetFamily :: a -> SocketFamily -> m ()
socketClientSetFamily client :: a
client family :: SocketFamily
family = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let family' :: CUInt
family' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (SocketFamily -> Int) -> SocketFamily -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SocketFamily -> Int
forall a. Enum a => a -> Int
fromEnum) SocketFamily
family
Ptr SocketClient -> CUInt -> IO ()
g_socket_client_set_family Ptr SocketClient
client' CUInt
family'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetFamilyMethodInfo
instance (signature ~ (Gio.Enums.SocketFamily -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetFamilyMethodInfo a signature where
overloadedMethod = socketClientSetFamily
#endif
foreign import ccall "g_socket_client_set_local_address" g_socket_client_set_local_address ::
Ptr SocketClient ->
Ptr Gio.SocketAddress.SocketAddress ->
IO ()
socketClientSetLocalAddress ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.SocketAddress.IsSocketAddress b) =>
a
-> Maybe (b)
-> m ()
socketClientSetLocalAddress :: a -> Maybe b -> m ()
socketClientSetLocalAddress client :: a
client address :: Maybe b
address = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr SocketAddress
maybeAddress <- case Maybe b
address of
Nothing -> Ptr SocketAddress -> IO (Ptr SocketAddress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr SocketAddress
forall a. Ptr a
nullPtr
Just jAddress :: b
jAddress -> do
Ptr SocketAddress
jAddress' <- b -> IO (Ptr SocketAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jAddress
Ptr SocketAddress -> IO (Ptr SocketAddress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr SocketAddress
jAddress'
Ptr SocketClient -> Ptr SocketAddress -> IO ()
g_socket_client_set_local_address Ptr SocketClient
client' Ptr SocketAddress
maybeAddress
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
address b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetLocalAddressMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSocketClient a, Gio.SocketAddress.IsSocketAddress b) => O.MethodInfo SocketClientSetLocalAddressMethodInfo a signature where
overloadedMethod = socketClientSetLocalAddress
#endif
foreign import ccall "g_socket_client_set_protocol" g_socket_client_set_protocol ::
Ptr SocketClient ->
CInt ->
IO ()
socketClientSetProtocol ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> Gio.Enums.SocketProtocol
-> m ()
socketClientSetProtocol :: a -> SocketProtocol -> m ()
socketClientSetProtocol client :: a
client protocol :: SocketProtocol
protocol = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let protocol' :: CInt
protocol' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (SocketProtocol -> Int) -> SocketProtocol -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SocketProtocol -> Int
forall a. Enum a => a -> Int
fromEnum) SocketProtocol
protocol
Ptr SocketClient -> CInt -> IO ()
g_socket_client_set_protocol Ptr SocketClient
client' CInt
protocol'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetProtocolMethodInfo
instance (signature ~ (Gio.Enums.SocketProtocol -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetProtocolMethodInfo a signature where
overloadedMethod = socketClientSetProtocol
#endif
foreign import ccall "g_socket_client_set_proxy_resolver" g_socket_client_set_proxy_resolver ::
Ptr SocketClient ->
Ptr Gio.ProxyResolver.ProxyResolver ->
IO ()
socketClientSetProxyResolver ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.ProxyResolver.IsProxyResolver b) =>
a
-> Maybe (b)
-> m ()
socketClientSetProxyResolver :: a -> Maybe b -> m ()
socketClientSetProxyResolver client :: a
client proxyResolver :: Maybe b
proxyResolver = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr ProxyResolver
maybeProxyResolver <- case Maybe b
proxyResolver of
Nothing -> Ptr ProxyResolver -> IO (Ptr ProxyResolver)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ProxyResolver
forall a. Ptr a
nullPtr
Just jProxyResolver :: b
jProxyResolver -> do
Ptr ProxyResolver
jProxyResolver' <- b -> IO (Ptr ProxyResolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProxyResolver
Ptr ProxyResolver -> IO (Ptr ProxyResolver)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ProxyResolver
jProxyResolver'
Ptr SocketClient -> Ptr ProxyResolver -> IO ()
g_socket_client_set_proxy_resolver Ptr SocketClient
client' Ptr ProxyResolver
maybeProxyResolver
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
proxyResolver b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetProxyResolverMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSocketClient a, Gio.ProxyResolver.IsProxyResolver b) => O.MethodInfo SocketClientSetProxyResolverMethodInfo a signature where
overloadedMethod = socketClientSetProxyResolver
#endif
foreign import ccall "g_socket_client_set_socket_type" g_socket_client_set_socket_type ::
Ptr SocketClient ->
CUInt ->
IO ()
socketClientSetSocketType ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> Gio.Enums.SocketType
-> m ()
socketClientSetSocketType :: a -> SocketType -> m ()
socketClientSetSocketType client :: a
client type_ :: SocketType
type_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (SocketType -> Int) -> SocketType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SocketType -> Int
forall a. Enum a => a -> Int
fromEnum) SocketType
type_
Ptr SocketClient -> CUInt -> IO ()
g_socket_client_set_socket_type Ptr SocketClient
client' CUInt
type_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetSocketTypeMethodInfo
instance (signature ~ (Gio.Enums.SocketType -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetSocketTypeMethodInfo a signature where
overloadedMethod = socketClientSetSocketType
#endif
foreign import ccall "g_socket_client_set_timeout" g_socket_client_set_timeout ::
Ptr SocketClient ->
Word32 ->
IO ()
socketClientSetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> Word32
-> m ()
socketClientSetTimeout :: a -> Word32 -> m ()
socketClientSetTimeout client :: a
client timeout :: Word32
timeout = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
Ptr SocketClient -> Word32 -> IO ()
g_socket_client_set_timeout Ptr SocketClient
client' Word32
timeout
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetTimeoutMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetTimeoutMethodInfo a signature where
overloadedMethod = socketClientSetTimeout
#endif
foreign import ccall "g_socket_client_set_tls" g_socket_client_set_tls ::
Ptr SocketClient ->
CInt ->
IO ()
socketClientSetTls ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> Bool
-> m ()
socketClientSetTls :: a -> Bool -> m ()
socketClientSetTls client :: a
client tls :: Bool
tls = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let tls' :: CInt
tls' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
tls
Ptr SocketClient -> CInt -> IO ()
g_socket_client_set_tls Ptr SocketClient
client' CInt
tls'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetTlsMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetTlsMethodInfo a signature where
overloadedMethod = socketClientSetTls
#endif
foreign import ccall "g_socket_client_set_tls_validation_flags" g_socket_client_set_tls_validation_flags ::
Ptr SocketClient ->
CUInt ->
IO ()
socketClientSetTlsValidationFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> [Gio.Flags.TlsCertificateFlags]
-> m ()
socketClientSetTlsValidationFlags :: a -> [TlsCertificateFlags] -> m ()
socketClientSetTlsValidationFlags client :: a
client flags :: [TlsCertificateFlags]
flags = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketClient
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let flags' :: CUInt
flags' = [TlsCertificateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [TlsCertificateFlags]
flags
Ptr SocketClient -> CUInt -> IO ()
g_socket_client_set_tls_validation_flags Ptr SocketClient
client' CUInt
flags'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
client
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetTlsValidationFlagsMethodInfo
instance (signature ~ ([Gio.Flags.TlsCertificateFlags] -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetTlsValidationFlagsMethodInfo a signature where
overloadedMethod = socketClientSetTlsValidationFlags
#endif