{-# LANGUAGE ImplicitParams, RankNTypes, 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 ,
#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
SocketClientEventCallback ,
#if defined(ENABLE_OVERLOADING)
SocketClientEventSignalInfo ,
#endif
afterSocketClientEvent ,
onSocketClientEvent ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Flags as GLib.Flags
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GObject.Structs.Parameter as GObject.Parameter
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.DatagramBased as Gio.DatagramBased
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
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.Credentials as Gio.Credentials
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.Socket as Gio.Socket
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddressEnumerator as Gio.SocketAddressEnumerator
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketConnection as Gio.SocketConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketControlMessage as Gio.SocketControlMessage
import {-# SOURCE #-} qualified GI.Gio.Structs.InputMessage as Gio.InputMessage
import {-# SOURCE #-} qualified GI.Gio.Structs.InputVector as Gio.InputVector
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputMessage as Gio.OutputMessage
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.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
#endif
newtype SocketClient = SocketClient (SP.ManagedPtr SocketClient)
deriving (SocketClient -> SocketClient -> Bool
(SocketClient -> SocketClient -> Bool)
-> (SocketClient -> SocketClient -> Bool) -> Eq SocketClient
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SocketClient -> SocketClient -> Bool
== :: SocketClient -> SocketClient -> Bool
$c/= :: SocketClient -> SocketClient -> Bool
/= :: SocketClient -> SocketClient -> Bool
Eq)
instance SP.ManagedPtrNewtype SocketClient where
toManagedPtr :: SocketClient -> ManagedPtr SocketClient
toManagedPtr (SocketClient ManagedPtr SocketClient
p) = ManagedPtr SocketClient
p
foreign import ccall "g_socket_client_get_type"
c_g_socket_client_get_type :: IO B.Types.GType
instance B.Types.TypedObject SocketClient where
glibType :: IO GType
glibType = IO GType
c_g_socket_client_get_type
instance B.Types.GObject SocketClient
class (SP.GObject o, O.IsDescendantOf SocketClient o) => IsSocketClient o
instance (SP.GObject o, O.IsDescendantOf SocketClient o) => IsSocketClient o
instance O.HasParentTypes SocketClient
type instance O.ParentTypes SocketClient = '[GObject.Object.Object]
toSocketClient :: (MIO.MonadIO m, IsSocketClient o) => o -> m SocketClient
toSocketClient :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m SocketClient
toSocketClient = IO SocketClient -> m SocketClient
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SocketClient -> SocketClient
SocketClient
instance B.GValue.IsGValue (Maybe SocketClient) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_socket_client_get_type
gvalueSet_ :: Ptr GValue -> Maybe SocketClient -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SocketClient
P.Nothing = Ptr GValue -> Ptr SocketClient -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SocketClient
forall a. Ptr a
FP.nullPtr :: FP.Ptr SocketClient)
gvalueSet_ Ptr GValue
gv (P.Just SocketClient
obj) = SocketClient -> (Ptr SocketClient -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SocketClient
obj (Ptr GValue -> Ptr SocketClient -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SocketClient)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr SocketClient)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SocketClient)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject SocketClient ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSocketClientMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSocketClientMethod t SocketClient, O.OverloadedMethod info SocketClient p, R.HasField t SocketClient p) => R.HasField t SocketClient p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSocketClientMethod t SocketClient, O.OverloadedMethodInfo info SocketClient) => OL.IsLabel t (O.MethodProxy info SocketClient) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type SocketClientEventCallback =
Gio.Enums.SocketClientEvent
-> Gio.SocketConnectable.SocketConnectable
-> Maybe Gio.IOStream.IOStream
-> IO ()
type C_SocketClientEventCallback =
Ptr SocketClient ->
CUInt ->
Ptr Gio.SocketConnectable.SocketConnectable ->
Ptr Gio.IOStream.IOStream ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SocketClientEventCallback :: C_SocketClientEventCallback -> IO (FunPtr C_SocketClientEventCallback)
wrap_SocketClientEventCallback ::
GObject a => (a -> SocketClientEventCallback) ->
C_SocketClientEventCallback
wrap_SocketClientEventCallback :: forall a.
GObject a =>
(a -> SocketClientEventCallback) -> C_SocketClientEventCallback
wrap_SocketClientEventCallback a -> SocketClientEventCallback
gi'cb Ptr SocketClient
gi'selfPtr CUInt
event Ptr SocketConnectable
connectable Ptr IOStream
connection Ptr ()
_ = 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
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
maybeConnection <-
if connection == FP.nullPtr
then return Nothing
else do
connection' <- (newObject Gio.IOStream.IOStream) connection
return $ Just connection'
B.ManagedPtr.withNewObject gi'selfPtr $ \SocketClient
gi'self -> a -> SocketClientEventCallback
gi'cb (SocketClient -> a
forall a b. Coercible a b => a -> b
Coerce.coerce SocketClient
gi'self) SocketClientEvent
event' SocketConnectable
connectable' Maybe IOStream
maybeConnection
onSocketClientEvent :: (IsSocketClient a, MonadIO m) => a -> ((?self :: a) => SocketClientEventCallback) -> m SignalHandlerId
onSocketClientEvent :: forall a (m :: * -> *).
(IsSocketClient a, MonadIO m) =>
a -> ((?self::a) => SocketClientEventCallback) -> m SignalHandlerId
onSocketClientEvent a
obj (?self::a) => SocketClientEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> SocketClientEventCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SocketClientEventCallback
SocketClientEventCallback
cb
let wrapped' :: C_SocketClientEventCallback
wrapped' = (a -> SocketClientEventCallback) -> C_SocketClientEventCallback
forall a.
GObject a =>
(a -> SocketClientEventCallback) -> C_SocketClientEventCallback
wrap_SocketClientEventCallback a -> SocketClientEventCallback
wrapped
wrapped'' <- C_SocketClientEventCallback
-> IO (FunPtr C_SocketClientEventCallback)
mk_SocketClientEventCallback C_SocketClientEventCallback
wrapped'
connectSignalFunPtr obj "event" wrapped'' SignalConnectBefore Nothing
afterSocketClientEvent :: (IsSocketClient a, MonadIO m) => a -> ((?self :: a) => SocketClientEventCallback) -> m SignalHandlerId
afterSocketClientEvent :: forall a (m :: * -> *).
(IsSocketClient a, MonadIO m) =>
a -> ((?self::a) => SocketClientEventCallback) -> m SignalHandlerId
afterSocketClientEvent a
obj (?self::a) => SocketClientEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> SocketClientEventCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SocketClientEventCallback
SocketClientEventCallback
cb
let wrapped' :: C_SocketClientEventCallback
wrapped' = (a -> SocketClientEventCallback) -> C_SocketClientEventCallback
forall a.
GObject a =>
(a -> SocketClientEventCallback) -> C_SocketClientEventCallback
wrap_SocketClientEventCallback a -> SocketClientEventCallback
wrapped
wrapped'' <- C_SocketClientEventCallback
-> IO (FunPtr C_SocketClientEventCallback)
mk_SocketClientEventCallback C_SocketClientEventCallback
wrapped'
connectSignalFunPtr obj "event" wrapped'' SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient::event"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:signal:event"})
#endif
getSocketClientEnableProxy :: (MonadIO m, IsSocketClient o) => o -> m Bool
getSocketClientEnableProxy :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m Bool
getSocketClientEnableProxy o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"enable-proxy"
setSocketClientEnableProxy :: (MonadIO m, IsSocketClient o) => o -> Bool -> m ()
setSocketClientEnableProxy :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> Bool -> m ()
setSocketClientEnableProxy o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"enable-proxy" Bool
val
constructSocketClientEnableProxy :: (IsSocketClient o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSocketClientEnableProxy :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSocketClientEnableProxy Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.enableProxy"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:enableProxy"
})
#endif
getSocketClientFamily :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketFamily
getSocketClientFamily :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m SocketFamily
getSocketClientFamily o
obj = IO SocketFamily -> m SocketFamily
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"family"
setSocketClientFamily :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketFamily -> m ()
setSocketClientFamily :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> SocketFamily -> m ()
setSocketClientFamily o
obj SocketFamily
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> SocketFamily -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"family" SocketFamily
val
constructSocketClientFamily :: (IsSocketClient o, MIO.MonadIO m) => Gio.Enums.SocketFamily -> m (GValueConstruct o)
constructSocketClientFamily :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
SocketFamily -> m (GValueConstruct o)
constructSocketClientFamily SocketFamily
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> SocketFamily -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.family"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:family"
})
#endif
getSocketClientLocalAddress :: (MonadIO m, IsSocketClient o) => o -> m (Maybe Gio.SocketAddress.SocketAddress)
getSocketClientLocalAddress :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m (Maybe SocketAddress)
getSocketClientLocalAddress o
obj = IO (Maybe SocketAddress) -> m (Maybe SocketAddress)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe SocketAddress) -> m (Maybe SocketAddress))
-> IO (Maybe SocketAddress) -> m (Maybe 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 String
"local-address" ManagedPtr SocketAddress -> SocketAddress
Gio.SocketAddress.SocketAddress
setSocketClientLocalAddress :: (MonadIO m, IsSocketClient o, Gio.SocketAddress.IsSocketAddress a) => o -> a -> m ()
setSocketClientLocalAddress :: forall (m :: * -> *) o a.
(MonadIO m, IsSocketClient o, IsSocketAddress a) =>
o -> a -> m ()
setSocketClientLocalAddress o
obj a
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"local-address" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructSocketClientLocalAddress :: (IsSocketClient o, MIO.MonadIO m, Gio.SocketAddress.IsSocketAddress a) => a -> m (GValueConstruct o)
constructSocketClientLocalAddress :: forall o (m :: * -> *) a.
(IsSocketClient o, MonadIO m, IsSocketAddress a) =>
a -> m (GValueConstruct o)
constructSocketClientLocalAddress a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"local-address" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearSocketClientLocalAddress :: (MonadIO m, IsSocketClient o) => o -> m ()
clearSocketClientLocalAddress :: forall (m :: * -> *) o. (MonadIO m, IsSocketClient o) => o -> m ()
clearSocketClientLocalAddress o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe SocketAddress -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"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 = (Maybe 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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.localAddress"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:localAddress"
})
#endif
getSocketClientProtocol :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketProtocol
getSocketClientProtocol :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m SocketProtocol
getSocketClientProtocol o
obj = IO SocketProtocol -> m SocketProtocol
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"protocol"
setSocketClientProtocol :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketProtocol -> m ()
setSocketClientProtocol :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> SocketProtocol -> m ()
setSocketClientProtocol o
obj SocketProtocol
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> SocketProtocol -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"protocol" SocketProtocol
val
constructSocketClientProtocol :: (IsSocketClient o, MIO.MonadIO m) => Gio.Enums.SocketProtocol -> m (GValueConstruct o)
constructSocketClientProtocol :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
SocketProtocol -> m (GValueConstruct o)
constructSocketClientProtocol SocketProtocol
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> SocketProtocol -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.protocol"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:protocol"
})
#endif
getSocketClientProxyResolver :: (MonadIO m, IsSocketClient o) => o -> m Gio.ProxyResolver.ProxyResolver
getSocketClientProxyResolver :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m ProxyResolver
getSocketClientProxyResolver o
obj = IO ProxyResolver -> m ProxyResolver
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 Text
"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 String
"proxy-resolver" ManagedPtr ProxyResolver -> ProxyResolver
Gio.ProxyResolver.ProxyResolver
setSocketClientProxyResolver :: (MonadIO m, IsSocketClient o, Gio.ProxyResolver.IsProxyResolver a) => o -> a -> m ()
setSocketClientProxyResolver :: forall (m :: * -> *) o a.
(MonadIO m, IsSocketClient o, IsProxyResolver a) =>
o -> a -> m ()
setSocketClientProxyResolver o
obj a
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"proxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructSocketClientProxyResolver :: (IsSocketClient o, MIO.MonadIO m, Gio.ProxyResolver.IsProxyResolver a) => a -> m (GValueConstruct o)
constructSocketClientProxyResolver :: forall o (m :: * -> *) a.
(IsSocketClient o, MonadIO m, IsProxyResolver a) =>
a -> m (GValueConstruct o)
constructSocketClientProxyResolver a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"proxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearSocketClientProxyResolver :: (MonadIO m, IsSocketClient o) => o -> m ()
clearSocketClientProxyResolver :: forall (m :: * -> *) o. (MonadIO m, IsSocketClient o) => o -> m ()
clearSocketClientProxyResolver o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe ProxyResolver -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.proxyResolver"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:proxyResolver"
})
#endif
getSocketClientTimeout :: (MonadIO m, IsSocketClient o) => o -> m Word32
getSocketClientTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m Word32
getSocketClientTimeout o
obj = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"timeout"
setSocketClientTimeout :: (MonadIO m, IsSocketClient o) => o -> Word32 -> m ()
setSocketClientTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> Word32 -> m ()
setSocketClientTimeout o
obj Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"timeout" Word32
val
constructSocketClientTimeout :: (IsSocketClient o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructSocketClientTimeout :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructSocketClientTimeout Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"timeout" Word32
val
#if defined(ENABLE_OVERLOADING)
data 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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.timeout"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:timeout"
})
#endif
getSocketClientTls :: (MonadIO m, IsSocketClient o) => o -> m Bool
getSocketClientTls :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m Bool
getSocketClientTls o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"tls"
setSocketClientTls :: (MonadIO m, IsSocketClient o) => o -> Bool -> m ()
setSocketClientTls :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> Bool -> m ()
setSocketClientTls o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"tls" Bool
val
constructSocketClientTls :: (IsSocketClient o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSocketClientTls :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSocketClientTls Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.tls"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:tls"
})
#endif
getSocketClientTlsValidationFlags :: (MonadIO m, IsSocketClient o) => o -> m [Gio.Flags.TlsCertificateFlags]
getSocketClientTlsValidationFlags :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m [TlsCertificateFlags]
getSocketClientTlsValidationFlags o
obj = IO [TlsCertificateFlags] -> m [TlsCertificateFlags]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"tls-validation-flags"
setSocketClientTlsValidationFlags :: (MonadIO m, IsSocketClient o) => o -> [Gio.Flags.TlsCertificateFlags] -> m ()
setSocketClientTlsValidationFlags :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> [TlsCertificateFlags] -> m ()
setSocketClientTlsValidationFlags o
obj [TlsCertificateFlags]
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> [TlsCertificateFlags] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj String
"tls-validation-flags" [TlsCertificateFlags]
val
constructSocketClientTlsValidationFlags :: (IsSocketClient o, MIO.MonadIO m) => [Gio.Flags.TlsCertificateFlags] -> m (GValueConstruct o)
constructSocketClientTlsValidationFlags :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
[TlsCertificateFlags] -> m (GValueConstruct o)
constructSocketClientTlsValidationFlags [TlsCertificateFlags]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [TlsCertificateFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.tlsValidationFlags"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:tlsValidationFlags"
})
#endif
getSocketClientType :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketType
getSocketClientType :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> m SocketType
getSocketClientType o
obj = IO SocketType -> m SocketType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"type"
setSocketClientType :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketType -> m ()
setSocketClientType :: forall (m :: * -> *) o.
(MonadIO m, IsSocketClient o) =>
o -> SocketType -> m ()
setSocketClientType o
obj SocketType
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> SocketType -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"type" SocketType
val
constructSocketClientType :: (IsSocketClient o, MIO.MonadIO m) => Gio.Enums.SocketType -> m (GValueConstruct o)
constructSocketClientType :: forall o (m :: * -> *).
(IsSocketClient o, MonadIO m) =>
SocketType -> m (GValueConstruct o)
constructSocketClientType SocketType
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> SocketType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.type"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#g:attr:type"
})
#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, DK.Type)])
#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, DK.Type)])
#endif
foreign import ccall "g_socket_client_new" g_socket_client_new ::
IO (Ptr SocketClient)
socketClientNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SocketClient
socketClientNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SocketClient
socketClientNew = IO SocketClient -> m SocketClient
forall a. IO a -> m a
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
result <- IO (Ptr SocketClient)
g_socket_client_new
checkUnexpectedReturnNULL "socketClientNew" result
result' <- (wrapObject SocketClient) result
return 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> Text -> m ()
socketClientAddApplicationProxy a
client Text
protocol = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
protocol' <- textToCString protocol
g_socket_client_add_application_proxy client' protocol'
touchManagedPtr client
freeMem protocol'
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientAddApplicationProxyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientAddApplicationProxyMethodInfo a signature where
overloadedMethod = socketClientAddApplicationProxy
instance O.OverloadedMethodInfo SocketClientAddApplicationProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientAddApplicationProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSocketClient a, IsSocketConnectable b,
IsCancellable c) =>
a -> b -> Maybe c -> m SocketConnection
socketClientConnect a
client b
connectable Maybe c
cancellable = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
connectable' <- unsafeManagedPtrCastPtr connectable
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_socket_client_connect client' connectable' maybeCancellable
checkUnexpectedReturnNULL "socketClientConnect" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
touchManagedPtr connectable
whenJust cancellable touchManagedPtr
return result'
) (do
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.OverloadedMethod SocketClientConnectMethodInfo a signature where
overloadedMethod = socketClientConnect
instance O.OverloadedMethodInfo SocketClientConnectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnect",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSocketClient a, IsSocketConnectable b,
IsCancellable c) =>
a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
socketClientConnectAsync a
client b
connectable Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
connectable' <- unsafeManagedPtrCastPtr connectable
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_socket_client_connect_async client' connectable' maybeCancellable maybeCallback userData
touchManagedPtr client
touchManagedPtr connectable
whenJust cancellable touchManagedPtr
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.OverloadedMethod SocketClientConnectAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectAsync
instance O.OverloadedMethodInfo SocketClientConnectAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsAsyncResult b) =>
a -> b -> m SocketConnection
socketClientConnectFinish a
client b
result_ = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_socket_client_connect_finish client' result_'
checkUnexpectedReturnNULL "socketClientConnectFinish" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SocketClientConnectFinishMethodInfo a signature where
overloadedMethod = socketClientConnectFinish
instance O.OverloadedMethodInfo SocketClientConnectFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsCancellable b) =>
a -> Text -> Word16 -> Maybe b -> m SocketConnection
socketClientConnectToHost a
client Text
hostAndPort Word16
defaultPort Maybe b
cancellable = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
hostAndPort' <- textToCString hostAndPort
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_socket_client_connect_to_host client' hostAndPort' defaultPort maybeCancellable
checkUnexpectedReturnNULL "socketClientConnectToHost" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
whenJust cancellable touchManagedPtr
freeMem hostAndPort'
return result'
) (do
freeMem 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.OverloadedMethod SocketClientConnectToHostMethodInfo a signature where
overloadedMethod = socketClientConnectToHost
instance O.OverloadedMethodInfo SocketClientConnectToHostMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToHost",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsCancellable b) =>
a -> Text -> Word16 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
socketClientConnectToHostAsync a
client Text
hostAndPort Word16
defaultPort Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
hostAndPort' <- textToCString hostAndPort
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_socket_client_connect_to_host_async client' hostAndPort' defaultPort maybeCancellable maybeCallback userData
touchManagedPtr client
whenJust cancellable touchManagedPtr
freeMem hostAndPort'
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.OverloadedMethod SocketClientConnectToHostAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectToHostAsync
instance O.OverloadedMethodInfo SocketClientConnectToHostAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToHostAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsAsyncResult b) =>
a -> b -> m SocketConnection
socketClientConnectToHostFinish a
client b
result_ = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_socket_client_connect_to_host_finish client' result_'
checkUnexpectedReturnNULL "socketClientConnectToHostFinish" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToHostFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SocketClientConnectToHostFinishMethodInfo a signature where
overloadedMethod = socketClientConnectToHostFinish
instance O.OverloadedMethodInfo SocketClientConnectToHostFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToHostFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsCancellable b) =>
a -> Text -> Text -> Maybe b -> m SocketConnection
socketClientConnectToService a
client Text
domain Text
service Maybe b
cancellable = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
domain' <- textToCString domain
service' <- textToCString service
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_socket_client_connect_to_service client' domain' service' maybeCancellable
checkUnexpectedReturnNULL "socketClientConnectToService" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
whenJust cancellable touchManagedPtr
freeMem domain'
freeMem service'
return result'
) (do
freeMem domain'
freeMem 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.OverloadedMethod SocketClientConnectToServiceMethodInfo a signature where
overloadedMethod = socketClientConnectToService
instance O.OverloadedMethodInfo SocketClientConnectToServiceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToService",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsCancellable b) =>
a -> Text -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
socketClientConnectToServiceAsync a
client Text
domain Text
service Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
domain' <- textToCString domain
service' <- textToCString service
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_socket_client_connect_to_service_async client' domain' service' maybeCancellable maybeCallback userData
touchManagedPtr client
whenJust cancellable touchManagedPtr
freeMem domain'
freeMem service'
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.OverloadedMethod SocketClientConnectToServiceAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectToServiceAsync
instance O.OverloadedMethodInfo SocketClientConnectToServiceAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToServiceAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsAsyncResult b) =>
a -> b -> m SocketConnection
socketClientConnectToServiceFinish a
client b
result_ = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_socket_client_connect_to_service_finish client' result_'
checkUnexpectedReturnNULL "socketClientConnectToServiceFinish" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToServiceFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SocketClientConnectToServiceFinishMethodInfo a signature where
overloadedMethod = socketClientConnectToServiceFinish
instance O.OverloadedMethodInfo SocketClientConnectToServiceFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToServiceFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsCancellable b) =>
a -> Text -> Word16 -> Maybe b -> m SocketConnection
socketClientConnectToUri a
client Text
uri Word16
defaultPort Maybe b
cancellable = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
uri' <- textToCString uri
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_socket_client_connect_to_uri client' uri' defaultPort maybeCancellable
checkUnexpectedReturnNULL "socketClientConnectToUri" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
whenJust cancellable touchManagedPtr
freeMem uri'
return result'
) (do
freeMem 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.OverloadedMethod SocketClientConnectToUriMethodInfo a signature where
overloadedMethod = socketClientConnectToUri
instance O.OverloadedMethodInfo SocketClientConnectToUriMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToUri",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsCancellable b) =>
a -> Text -> Word16 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
socketClientConnectToUriAsync a
client Text
uri Word16
defaultPort Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
uri' <- textToCString uri
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_socket_client_connect_to_uri_async client' uri' defaultPort maybeCancellable maybeCallback userData
touchManagedPtr client
whenJust cancellable touchManagedPtr
freeMem uri'
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.OverloadedMethod SocketClientConnectToUriAsyncMethodInfo a signature where
overloadedMethod = socketClientConnectToUriAsync
instance O.OverloadedMethodInfo SocketClientConnectToUriAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToUriAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsAsyncResult b) =>
a -> b -> m SocketConnection
socketClientConnectToUriFinish a
client b
result_ = IO SocketConnection -> m SocketConnection
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_socket_client_connect_to_uri_finish client' result_'
checkUnexpectedReturnNULL "socketClientConnectToUriFinish" result
result' <- (wrapObject Gio.SocketConnection.SocketConnection) result
touchManagedPtr client
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SocketClientConnectToUriFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SocketClientConnectToUriFinishMethodInfo a signature where
overloadedMethod = socketClientConnectToUriFinish
instance O.OverloadedMethodInfo SocketClientConnectToUriFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientConnectToUriFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m Bool
socketClientGetEnableProxy a
client = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_enable_proxy client'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetEnableProxyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetEnableProxyMethodInfo a signature where
overloadedMethod = socketClientGetEnableProxy
instance O.OverloadedMethodInfo SocketClientGetEnableProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetEnableProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m SocketFamily
socketClientGetFamily a
client = IO SocketFamily -> m SocketFamily
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_family client'
let 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
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetFamilyMethodInfo
instance (signature ~ (m Gio.Enums.SocketFamily), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetFamilyMethodInfo a signature where
overloadedMethod = socketClientGetFamily
instance O.OverloadedMethodInfo SocketClientGetFamilyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetFamily",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 (Maybe Gio.SocketAddress.SocketAddress)
socketClientGetLocalAddress :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m (Maybe SocketAddress)
socketClientGetLocalAddress a
client = IO (Maybe SocketAddress) -> m (Maybe SocketAddress)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SocketAddress) -> m (Maybe SocketAddress))
-> IO (Maybe SocketAddress) -> m (Maybe SocketAddress)
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_local_address client'
maybeResult <- convertIfNonNull result $ \Ptr SocketAddress
result' -> do
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'
return result''
touchManagedPtr client
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SocketClientGetLocalAddressMethodInfo
instance (signature ~ (m (Maybe Gio.SocketAddress.SocketAddress)), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetLocalAddressMethodInfo a signature where
overloadedMethod = socketClientGetLocalAddress
instance O.OverloadedMethodInfo SocketClientGetLocalAddressMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetLocalAddress",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m SocketProtocol
socketClientGetProtocol a
client = IO SocketProtocol -> m SocketProtocol
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_protocol client'
let 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
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetProtocolMethodInfo
instance (signature ~ (m Gio.Enums.SocketProtocol), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetProtocolMethodInfo a signature where
overloadedMethod = socketClientGetProtocol
instance O.OverloadedMethodInfo SocketClientGetProtocolMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetProtocol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m ProxyResolver
socketClientGetProxyResolver a
client = IO ProxyResolver -> m ProxyResolver
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_proxy_resolver client'
checkUnexpectedReturnNULL "socketClientGetProxyResolver" result
result' <- (newObject Gio.ProxyResolver.ProxyResolver) result
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetProxyResolverMethodInfo
instance (signature ~ (m Gio.ProxyResolver.ProxyResolver), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetProxyResolverMethodInfo a signature where
overloadedMethod = socketClientGetProxyResolver
instance O.OverloadedMethodInfo SocketClientGetProxyResolverMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetProxyResolver",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m SocketType
socketClientGetSocketType a
client = IO SocketType -> m SocketType
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_socket_type client'
let 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
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetSocketTypeMethodInfo
instance (signature ~ (m Gio.Enums.SocketType), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetSocketTypeMethodInfo a signature where
overloadedMethod = socketClientGetSocketType
instance O.OverloadedMethodInfo SocketClientGetSocketTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetSocketType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m Word32
socketClientGetTimeout a
client = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_timeout client'
touchManagedPtr client
return result
#if defined(ENABLE_OVERLOADING)
data SocketClientGetTimeoutMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetTimeoutMethodInfo a signature where
overloadedMethod = socketClientGetTimeout
instance O.OverloadedMethodInfo SocketClientGetTimeoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetTimeout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m Bool
socketClientGetTls a
client = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_tls client'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetTlsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetTlsMethodInfo a signature where
overloadedMethod = socketClientGetTls
instance O.OverloadedMethodInfo SocketClientGetTlsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetTls",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v:socketClientGetTls"
})
#endif
foreign import ccall "g_socket_client_get_tls_validation_flags" g_socket_client_get_tls_validation_flags ::
Ptr SocketClient ->
IO CUInt
{-# DEPRECATED socketClientGetTlsValidationFlags ["(Since version 2.72)","Do not attempt to ignore validation errors."] #-}
socketClientGetTlsValidationFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> m [Gio.Flags.TlsCertificateFlags]
socketClientGetTlsValidationFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> m [TlsCertificateFlags]
socketClientGetTlsValidationFlags a
client = IO [TlsCertificateFlags] -> m [TlsCertificateFlags]
forall a. IO a -> m a
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
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
result <- g_socket_client_get_tls_validation_flags client'
let result' = CUInt -> [TlsCertificateFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr client
return result'
#if defined(ENABLE_OVERLOADING)
data SocketClientGetTlsValidationFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.TlsCertificateFlags]), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientGetTlsValidationFlagsMethodInfo a signature where
overloadedMethod = socketClientGetTlsValidationFlags
instance O.OverloadedMethodInfo SocketClientGetTlsValidationFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientGetTlsValidationFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> Bool -> m ()
socketClientSetEnableProxy a
client Bool
enable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let enable' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
enable
g_socket_client_set_enable_proxy client' enable'
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetEnableProxyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetEnableProxyMethodInfo a signature where
overloadedMethod = socketClientSetEnableProxy
instance O.OverloadedMethodInfo SocketClientSetEnableProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetEnableProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> SocketFamily -> m ()
socketClientSetFamily a
client SocketFamily
family = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let 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
g_socket_client_set_family client' family'
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetFamilyMethodInfo
instance (signature ~ (Gio.Enums.SocketFamily -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetFamilyMethodInfo a signature where
overloadedMethod = socketClientSetFamily
instance O.OverloadedMethodInfo SocketClientSetFamilyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetFamily",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsSocketAddress b) =>
a -> Maybe b -> m ()
socketClientSetLocalAddress a
client Maybe b
address = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
maybeAddress <- case address of
Maybe b
Nothing -> Ptr SocketAddress -> IO (Ptr SocketAddress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr SocketAddress
forall a. Ptr a
FP.nullPtr
Just b
jAddress -> do
jAddress' <- b -> IO (Ptr SocketAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jAddress
return jAddress'
g_socket_client_set_local_address client' maybeAddress
touchManagedPtr client
whenJust address touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetLocalAddressMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSocketClient a, Gio.SocketAddress.IsSocketAddress b) => O.OverloadedMethod SocketClientSetLocalAddressMethodInfo a signature where
overloadedMethod = socketClientSetLocalAddress
instance O.OverloadedMethodInfo SocketClientSetLocalAddressMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetLocalAddress",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> SocketProtocol -> m ()
socketClientSetProtocol a
client SocketProtocol
protocol = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let 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
g_socket_client_set_protocol client' protocol'
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetProtocolMethodInfo
instance (signature ~ (Gio.Enums.SocketProtocol -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetProtocolMethodInfo a signature where
overloadedMethod = socketClientSetProtocol
instance O.OverloadedMethodInfo SocketClientSetProtocolMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetProtocol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSocketClient a, IsProxyResolver b) =>
a -> Maybe b -> m ()
socketClientSetProxyResolver a
client Maybe b
proxyResolver = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
maybeProxyResolver <- case proxyResolver of
Maybe b
Nothing -> Ptr ProxyResolver -> IO (Ptr ProxyResolver)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ProxyResolver
forall a. Ptr a
FP.nullPtr
Just b
jProxyResolver -> do
jProxyResolver' <- b -> IO (Ptr ProxyResolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProxyResolver
return jProxyResolver'
g_socket_client_set_proxy_resolver client' maybeProxyResolver
touchManagedPtr client
whenJust proxyResolver touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetProxyResolverMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSocketClient a, Gio.ProxyResolver.IsProxyResolver b) => O.OverloadedMethod SocketClientSetProxyResolverMethodInfo a signature where
overloadedMethod = socketClientSetProxyResolver
instance O.OverloadedMethodInfo SocketClientSetProxyResolverMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetProxyResolver",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> SocketType -> m ()
socketClientSetSocketType a
client SocketType
type_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let 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_
g_socket_client_set_socket_type client' type_'
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetSocketTypeMethodInfo
instance (signature ~ (Gio.Enums.SocketType -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetSocketTypeMethodInfo a signature where
overloadedMethod = socketClientSetSocketType
instance O.OverloadedMethodInfo SocketClientSetSocketTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetSocketType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> Word32 -> m ()
socketClientSetTimeout a
client Word32
timeout = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
g_socket_client_set_timeout client' timeout
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetTimeoutMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetTimeoutMethodInfo a signature where
overloadedMethod = socketClientSetTimeout
instance O.OverloadedMethodInfo SocketClientSetTimeoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetTimeout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> Bool -> m ()
socketClientSetTls a
client Bool
tls = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let tls' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
tls
g_socket_client_set_tls client' tls'
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetTlsMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetTlsMethodInfo a signature where
overloadedMethod = socketClientSetTls
instance O.OverloadedMethodInfo SocketClientSetTlsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetTls",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v:socketClientSetTls"
})
#endif
foreign import ccall "g_socket_client_set_tls_validation_flags" g_socket_client_set_tls_validation_flags ::
Ptr SocketClient ->
CUInt ->
IO ()
{-# DEPRECATED socketClientSetTlsValidationFlags ["(Since version 2.72)","Do not attempt to ignore validation errors."] #-}
socketClientSetTlsValidationFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) =>
a
-> [Gio.Flags.TlsCertificateFlags]
-> m ()
socketClientSetTlsValidationFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketClient a) =>
a -> [TlsCertificateFlags] -> m ()
socketClientSetTlsValidationFlags a
client [TlsCertificateFlags]
flags = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
client' <- a -> IO (Ptr SocketClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
client
let flags' = [TlsCertificateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [TlsCertificateFlags]
flags
g_socket_client_set_tls_validation_flags client' flags'
touchManagedPtr client
return ()
#if defined(ENABLE_OVERLOADING)
data SocketClientSetTlsValidationFlagsMethodInfo
instance (signature ~ ([Gio.Flags.TlsCertificateFlags] -> m ()), MonadIO m, IsSocketClient a) => O.OverloadedMethod SocketClientSetTlsValidationFlagsMethodInfo a signature where
overloadedMethod = socketClientSetTlsValidationFlags
instance O.OverloadedMethodInfo SocketClientSetTlsValidationFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketClient.socketClientSetTlsValidationFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketClient.html#v:socketClientSetTlsValidationFlags"
})
#endif