{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.WebsocketConnection
(
WebsocketConnection(..) ,
IsWebsocketConnection ,
toWebsocketConnection ,
#if defined(ENABLE_OVERLOADING)
ResolveWebsocketConnectionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionCloseMethodInfo ,
#endif
websocketConnectionClose ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetCloseCodeMethodInfo,
#endif
websocketConnectionGetCloseCode ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetCloseDataMethodInfo,
#endif
websocketConnectionGetCloseData ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetConnectionTypeMethodInfo,
#endif
websocketConnectionGetConnectionType ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetExtensionsMethodInfo,
#endif
websocketConnectionGetExtensions ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetIoStreamMethodInfo,
#endif
websocketConnectionGetIoStream ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetKeepaliveIntervalMethodInfo,
#endif
websocketConnectionGetKeepaliveInterval ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo,
#endif
websocketConnectionGetMaxIncomingPayloadSize,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetOriginMethodInfo ,
#endif
websocketConnectionGetOrigin ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetProtocolMethodInfo,
#endif
websocketConnectionGetProtocol ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetStateMethodInfo ,
#endif
websocketConnectionGetState ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionGetUriMethodInfo ,
#endif
websocketConnectionGetUri ,
websocketConnectionNew ,
websocketConnectionNewWithExtensions ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionSendBinaryMethodInfo ,
#endif
websocketConnectionSendBinary ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionSendMessageMethodInfo,
#endif
websocketConnectionSendMessage ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionSendTextMethodInfo ,
#endif
websocketConnectionSendText ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionSetKeepaliveIntervalMethodInfo,
#endif
websocketConnectionSetKeepaliveInterval ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo,
#endif
websocketConnectionSetMaxIncomingPayloadSize,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionConnectionTypePropertyInfo,
#endif
constructWebsocketConnectionConnectionType,
getWebsocketConnectionConnectionType ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionConnectionType ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionExtensionsPropertyInfo,
#endif
constructWebsocketConnectionExtensions ,
getWebsocketConnectionExtensions ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionExtensions ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionIoStreamPropertyInfo ,
#endif
constructWebsocketConnectionIoStream ,
getWebsocketConnectionIoStream ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionIoStream ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionKeepaliveIntervalPropertyInfo,
#endif
constructWebsocketConnectionKeepaliveInterval,
getWebsocketConnectionKeepaliveInterval ,
setWebsocketConnectionKeepaliveInterval ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionKeepaliveInterval ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionMaxIncomingPayloadSizePropertyInfo,
#endif
constructWebsocketConnectionMaxIncomingPayloadSize,
getWebsocketConnectionMaxIncomingPayloadSize,
setWebsocketConnectionMaxIncomingPayloadSize,
#if defined(ENABLE_OVERLOADING)
websocketConnectionMaxIncomingPayloadSize,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionOriginPropertyInfo ,
#endif
constructWebsocketConnectionOrigin ,
getWebsocketConnectionOrigin ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionOrigin ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionProtocolPropertyInfo ,
#endif
constructWebsocketConnectionProtocol ,
getWebsocketConnectionProtocol ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionProtocol ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionStatePropertyInfo ,
#endif
getWebsocketConnectionState ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionState ,
#endif
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionUriPropertyInfo ,
#endif
constructWebsocketConnectionUri ,
getWebsocketConnectionUri ,
#if defined(ENABLE_OVERLOADING)
websocketConnectionUri ,
#endif
C_WebsocketConnectionClosedCallback ,
WebsocketConnectionClosedCallback ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionClosedSignalInfo ,
#endif
afterWebsocketConnectionClosed ,
genClosure_WebsocketConnectionClosed ,
mk_WebsocketConnectionClosedCallback ,
noWebsocketConnectionClosedCallback ,
onWebsocketConnectionClosed ,
wrap_WebsocketConnectionClosedCallback ,
C_WebsocketConnectionClosingCallback ,
WebsocketConnectionClosingCallback ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionClosingSignalInfo ,
#endif
afterWebsocketConnectionClosing ,
genClosure_WebsocketConnectionClosing ,
mk_WebsocketConnectionClosingCallback ,
noWebsocketConnectionClosingCallback ,
onWebsocketConnectionClosing ,
wrap_WebsocketConnectionClosingCallback ,
C_WebsocketConnectionErrorCallback ,
WebsocketConnectionErrorCallback ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionErrorSignalInfo ,
#endif
afterWebsocketConnectionError ,
genClosure_WebsocketConnectionError ,
mk_WebsocketConnectionErrorCallback ,
noWebsocketConnectionErrorCallback ,
onWebsocketConnectionError ,
wrap_WebsocketConnectionErrorCallback ,
C_WebsocketConnectionMessageCallback ,
WebsocketConnectionMessageCallback ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionMessageSignalInfo ,
#endif
afterWebsocketConnectionMessage ,
genClosure_WebsocketConnectionMessage ,
mk_WebsocketConnectionMessageCallback ,
noWebsocketConnectionMessageCallback ,
onWebsocketConnectionMessage ,
wrap_WebsocketConnectionMessageCallback ,
C_WebsocketConnectionPongCallback ,
WebsocketConnectionPongCallback ,
#if defined(ENABLE_OVERLOADING)
WebsocketConnectionPongSignalInfo ,
#endif
afterWebsocketConnectionPong ,
genClosure_WebsocketConnectionPong ,
mk_WebsocketConnectionPongCallback ,
noWebsocketConnectionPongCallback ,
onWebsocketConnectionPong ,
wrap_WebsocketConnectionPongCallback ,
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketExtension as Soup.WebsocketExtension
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI
newtype WebsocketConnection = WebsocketConnection (SP.ManagedPtr WebsocketConnection)
deriving (WebsocketConnection -> WebsocketConnection -> Bool
(WebsocketConnection -> WebsocketConnection -> Bool)
-> (WebsocketConnection -> WebsocketConnection -> Bool)
-> Eq WebsocketConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebsocketConnection -> WebsocketConnection -> Bool
$c/= :: WebsocketConnection -> WebsocketConnection -> Bool
== :: WebsocketConnection -> WebsocketConnection -> Bool
$c== :: WebsocketConnection -> WebsocketConnection -> Bool
Eq)
instance SP.ManagedPtrNewtype WebsocketConnection where
toManagedPtr :: WebsocketConnection -> ManagedPtr WebsocketConnection
toManagedPtr (WebsocketConnection ManagedPtr WebsocketConnection
p) = ManagedPtr WebsocketConnection
p
foreign import ccall "soup_websocket_connection_get_type"
c_soup_websocket_connection_get_type :: IO B.Types.GType
instance B.Types.TypedObject WebsocketConnection where
glibType :: IO GType
glibType = IO GType
c_soup_websocket_connection_get_type
instance B.Types.GObject WebsocketConnection
instance B.GValue.IsGValue WebsocketConnection where
toGValue :: WebsocketConnection -> IO GValue
toGValue WebsocketConnection
o = do
GType
gtype <- IO GType
c_soup_websocket_connection_get_type
WebsocketConnection
-> (Ptr WebsocketConnection -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr WebsocketConnection
o (GType
-> (GValue -> Ptr WebsocketConnection -> IO ())
-> Ptr WebsocketConnection
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr WebsocketConnection -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO WebsocketConnection
fromGValue GValue
gv = do
Ptr WebsocketConnection
ptr <- GValue -> IO (Ptr WebsocketConnection)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr WebsocketConnection)
(ManagedPtr WebsocketConnection -> WebsocketConnection)
-> Ptr WebsocketConnection -> IO WebsocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr WebsocketConnection -> WebsocketConnection
WebsocketConnection Ptr WebsocketConnection
ptr
class (SP.GObject o, O.IsDescendantOf WebsocketConnection o) => IsWebsocketConnection o
instance (SP.GObject o, O.IsDescendantOf WebsocketConnection o) => IsWebsocketConnection o
instance O.HasParentTypes WebsocketConnection
type instance O.ParentTypes WebsocketConnection = '[GObject.Object.Object]
toWebsocketConnection :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketConnection
toWebsocketConnection :: o -> m WebsocketConnection
toWebsocketConnection = IO WebsocketConnection -> m WebsocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketConnection -> m WebsocketConnection)
-> (o -> IO WebsocketConnection) -> o -> m WebsocketConnection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr WebsocketConnection -> WebsocketConnection)
-> o -> IO WebsocketConnection
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr WebsocketConnection -> WebsocketConnection
WebsocketConnection
#if defined(ENABLE_OVERLOADING)
type family ResolveWebsocketConnectionMethod (t :: Symbol) (o :: *) :: * where
ResolveWebsocketConnectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveWebsocketConnectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveWebsocketConnectionMethod "close" o = WebsocketConnectionCloseMethodInfo
ResolveWebsocketConnectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveWebsocketConnectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveWebsocketConnectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveWebsocketConnectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveWebsocketConnectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveWebsocketConnectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveWebsocketConnectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveWebsocketConnectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveWebsocketConnectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveWebsocketConnectionMethod "sendBinary" o = WebsocketConnectionSendBinaryMethodInfo
ResolveWebsocketConnectionMethod "sendMessage" o = WebsocketConnectionSendMessageMethodInfo
ResolveWebsocketConnectionMethod "sendText" o = WebsocketConnectionSendTextMethodInfo
ResolveWebsocketConnectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveWebsocketConnectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveWebsocketConnectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveWebsocketConnectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveWebsocketConnectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveWebsocketConnectionMethod "getCloseCode" o = WebsocketConnectionGetCloseCodeMethodInfo
ResolveWebsocketConnectionMethod "getCloseData" o = WebsocketConnectionGetCloseDataMethodInfo
ResolveWebsocketConnectionMethod "getConnectionType" o = WebsocketConnectionGetConnectionTypeMethodInfo
ResolveWebsocketConnectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveWebsocketConnectionMethod "getExtensions" o = WebsocketConnectionGetExtensionsMethodInfo
ResolveWebsocketConnectionMethod "getIoStream" o = WebsocketConnectionGetIoStreamMethodInfo
ResolveWebsocketConnectionMethod "getKeepaliveInterval" o = WebsocketConnectionGetKeepaliveIntervalMethodInfo
ResolveWebsocketConnectionMethod "getMaxIncomingPayloadSize" o = WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo
ResolveWebsocketConnectionMethod "getOrigin" o = WebsocketConnectionGetOriginMethodInfo
ResolveWebsocketConnectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveWebsocketConnectionMethod "getProtocol" o = WebsocketConnectionGetProtocolMethodInfo
ResolveWebsocketConnectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveWebsocketConnectionMethod "getState" o = WebsocketConnectionGetStateMethodInfo
ResolveWebsocketConnectionMethod "getUri" o = WebsocketConnectionGetUriMethodInfo
ResolveWebsocketConnectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveWebsocketConnectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveWebsocketConnectionMethod "setKeepaliveInterval" o = WebsocketConnectionSetKeepaliveIntervalMethodInfo
ResolveWebsocketConnectionMethod "setMaxIncomingPayloadSize" o = WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo
ResolveWebsocketConnectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveWebsocketConnectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveWebsocketConnectionMethod t WebsocketConnection, O.MethodInfo info WebsocketConnection p) => OL.IsLabel t (WebsocketConnection -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type WebsocketConnectionClosedCallback =
IO ()
noWebsocketConnectionClosedCallback :: Maybe WebsocketConnectionClosedCallback
noWebsocketConnectionClosedCallback :: Maybe (IO ())
noWebsocketConnectionClosedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_WebsocketConnectionClosedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionClosedCallback :: C_WebsocketConnectionClosedCallback -> IO (FunPtr C_WebsocketConnectionClosedCallback)
genClosure_WebsocketConnectionClosed :: MonadIO m => WebsocketConnectionClosedCallback -> m (GClosure C_WebsocketConnectionClosedCallback)
genClosure_WebsocketConnectionClosed :: IO () -> m (GClosure C_WebsocketConnectionClosedCallback)
genClosure_WebsocketConnectionClosed IO ()
cb = IO (GClosure C_WebsocketConnectionClosedCallback)
-> m (GClosure C_WebsocketConnectionClosedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebsocketConnectionClosedCallback)
-> m (GClosure C_WebsocketConnectionClosedCallback))
-> IO (GClosure C_WebsocketConnectionClosedCallback)
-> m (GClosure C_WebsocketConnectionClosedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionClosedCallback
cb' = IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosedCallback IO ()
cb
C_WebsocketConnectionClosedCallback
-> IO (FunPtr C_WebsocketConnectionClosedCallback)
mk_WebsocketConnectionClosedCallback C_WebsocketConnectionClosedCallback
cb' IO (FunPtr C_WebsocketConnectionClosedCallback)
-> (FunPtr C_WebsocketConnectionClosedCallback
-> IO (GClosure C_WebsocketConnectionClosedCallback))
-> IO (GClosure C_WebsocketConnectionClosedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebsocketConnectionClosedCallback
-> IO (GClosure C_WebsocketConnectionClosedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebsocketConnectionClosedCallback ::
WebsocketConnectionClosedCallback ->
C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosedCallback :: IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onWebsocketConnectionClosed :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId
onWebsocketConnectionClosed :: a -> IO () -> m SignalHandlerId
onWebsocketConnectionClosed a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionClosedCallback
cb' = IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosedCallback IO ()
cb
FunPtr C_WebsocketConnectionClosedCallback
cb'' <- C_WebsocketConnectionClosedCallback
-> IO (FunPtr C_WebsocketConnectionClosedCallback)
mk_WebsocketConnectionClosedCallback C_WebsocketConnectionClosedCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_WebsocketConnectionClosedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebsocketConnectionClosed :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId
afterWebsocketConnectionClosed :: a -> IO () -> m SignalHandlerId
afterWebsocketConnectionClosed a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionClosedCallback
cb' = IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosedCallback IO ()
cb
FunPtr C_WebsocketConnectionClosedCallback
cb'' <- C_WebsocketConnectionClosedCallback
-> IO (FunPtr C_WebsocketConnectionClosedCallback)
mk_WebsocketConnectionClosedCallback C_WebsocketConnectionClosedCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_WebsocketConnectionClosedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionClosedSignalInfo
instance SignalInfo WebsocketConnectionClosedSignalInfo where
type HaskellCallbackType WebsocketConnectionClosedSignalInfo = WebsocketConnectionClosedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebsocketConnectionClosedCallback cb
cb'' <- mk_WebsocketConnectionClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' connectMode detail
#endif
type WebsocketConnectionClosingCallback =
IO ()
noWebsocketConnectionClosingCallback :: Maybe WebsocketConnectionClosingCallback
noWebsocketConnectionClosingCallback :: Maybe (IO ())
noWebsocketConnectionClosingCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_WebsocketConnectionClosingCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionClosingCallback :: C_WebsocketConnectionClosingCallback -> IO (FunPtr C_WebsocketConnectionClosingCallback)
genClosure_WebsocketConnectionClosing :: MonadIO m => WebsocketConnectionClosingCallback -> m (GClosure C_WebsocketConnectionClosingCallback)
genClosure_WebsocketConnectionClosing :: IO () -> m (GClosure C_WebsocketConnectionClosedCallback)
genClosure_WebsocketConnectionClosing IO ()
cb = IO (GClosure C_WebsocketConnectionClosedCallback)
-> m (GClosure C_WebsocketConnectionClosedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebsocketConnectionClosedCallback)
-> m (GClosure C_WebsocketConnectionClosedCallback))
-> IO (GClosure C_WebsocketConnectionClosedCallback)
-> m (GClosure C_WebsocketConnectionClosedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionClosedCallback
cb' = IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosingCallback IO ()
cb
C_WebsocketConnectionClosedCallback
-> IO (FunPtr C_WebsocketConnectionClosedCallback)
mk_WebsocketConnectionClosingCallback C_WebsocketConnectionClosedCallback
cb' IO (FunPtr C_WebsocketConnectionClosedCallback)
-> (FunPtr C_WebsocketConnectionClosedCallback
-> IO (GClosure C_WebsocketConnectionClosedCallback))
-> IO (GClosure C_WebsocketConnectionClosedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebsocketConnectionClosedCallback
-> IO (GClosure C_WebsocketConnectionClosedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebsocketConnectionClosingCallback ::
WebsocketConnectionClosingCallback ->
C_WebsocketConnectionClosingCallback
wrap_WebsocketConnectionClosingCallback :: IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosingCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onWebsocketConnectionClosing :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId
onWebsocketConnectionClosing :: a -> IO () -> m SignalHandlerId
onWebsocketConnectionClosing a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionClosedCallback
cb' = IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosingCallback IO ()
cb
FunPtr C_WebsocketConnectionClosedCallback
cb'' <- C_WebsocketConnectionClosedCallback
-> IO (FunPtr C_WebsocketConnectionClosedCallback)
mk_WebsocketConnectionClosingCallback C_WebsocketConnectionClosedCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closing" FunPtr C_WebsocketConnectionClosedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebsocketConnectionClosing :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId
afterWebsocketConnectionClosing :: a -> IO () -> m SignalHandlerId
afterWebsocketConnectionClosing a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionClosedCallback
cb' = IO () -> C_WebsocketConnectionClosedCallback
wrap_WebsocketConnectionClosingCallback IO ()
cb
FunPtr C_WebsocketConnectionClosedCallback
cb'' <- C_WebsocketConnectionClosedCallback
-> IO (FunPtr C_WebsocketConnectionClosedCallback)
mk_WebsocketConnectionClosingCallback C_WebsocketConnectionClosedCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closing" FunPtr C_WebsocketConnectionClosedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionClosingSignalInfo
instance SignalInfo WebsocketConnectionClosingSignalInfo where
type HaskellCallbackType WebsocketConnectionClosingSignalInfo = WebsocketConnectionClosingCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebsocketConnectionClosingCallback cb
cb'' <- mk_WebsocketConnectionClosingCallback cb'
connectSignalFunPtr obj "closing" cb'' connectMode detail
#endif
type WebsocketConnectionErrorCallback =
GError
-> IO ()
noWebsocketConnectionErrorCallback :: Maybe WebsocketConnectionErrorCallback
noWebsocketConnectionErrorCallback :: Maybe WebsocketConnectionErrorCallback
noWebsocketConnectionErrorCallback = Maybe WebsocketConnectionErrorCallback
forall a. Maybe a
Nothing
type C_WebsocketConnectionErrorCallback =
Ptr () ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionErrorCallback :: C_WebsocketConnectionErrorCallback -> IO (FunPtr C_WebsocketConnectionErrorCallback)
genClosure_WebsocketConnectionError :: MonadIO m => WebsocketConnectionErrorCallback -> m (GClosure C_WebsocketConnectionErrorCallback)
genClosure_WebsocketConnectionError :: WebsocketConnectionErrorCallback
-> m (GClosure C_WebsocketConnectionErrorCallback)
genClosure_WebsocketConnectionError WebsocketConnectionErrorCallback
cb = IO (GClosure C_WebsocketConnectionErrorCallback)
-> m (GClosure C_WebsocketConnectionErrorCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebsocketConnectionErrorCallback)
-> m (GClosure C_WebsocketConnectionErrorCallback))
-> IO (GClosure C_WebsocketConnectionErrorCallback)
-> m (GClosure C_WebsocketConnectionErrorCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionErrorCallback
cb' = WebsocketConnectionErrorCallback
-> C_WebsocketConnectionErrorCallback
wrap_WebsocketConnectionErrorCallback WebsocketConnectionErrorCallback
cb
C_WebsocketConnectionErrorCallback
-> IO (FunPtr C_WebsocketConnectionErrorCallback)
mk_WebsocketConnectionErrorCallback C_WebsocketConnectionErrorCallback
cb' IO (FunPtr C_WebsocketConnectionErrorCallback)
-> (FunPtr C_WebsocketConnectionErrorCallback
-> IO (GClosure C_WebsocketConnectionErrorCallback))
-> IO (GClosure C_WebsocketConnectionErrorCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebsocketConnectionErrorCallback
-> IO (GClosure C_WebsocketConnectionErrorCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebsocketConnectionErrorCallback ::
WebsocketConnectionErrorCallback ->
C_WebsocketConnectionErrorCallback
wrap_WebsocketConnectionErrorCallback :: WebsocketConnectionErrorCallback
-> C_WebsocketConnectionErrorCallback
wrap_WebsocketConnectionErrorCallback WebsocketConnectionErrorCallback
_cb Ptr ()
_ Ptr GError
error_ Ptr ()
_ = do
GError
error_' <- ((ManagedPtr GError -> GError) -> Ptr GError -> IO GError
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GError -> GError
GError) Ptr GError
error_
WebsocketConnectionErrorCallback
_cb GError
error_'
onWebsocketConnectionError :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
onWebsocketConnectionError :: a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
onWebsocketConnectionError a
obj WebsocketConnectionErrorCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionErrorCallback
cb' = WebsocketConnectionErrorCallback
-> C_WebsocketConnectionErrorCallback
wrap_WebsocketConnectionErrorCallback WebsocketConnectionErrorCallback
cb
FunPtr C_WebsocketConnectionErrorCallback
cb'' <- C_WebsocketConnectionErrorCallback
-> IO (FunPtr C_WebsocketConnectionErrorCallback)
mk_WebsocketConnectionErrorCallback C_WebsocketConnectionErrorCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionErrorCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"error" FunPtr C_WebsocketConnectionErrorCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebsocketConnectionError :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
afterWebsocketConnectionError :: a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
afterWebsocketConnectionError a
obj WebsocketConnectionErrorCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionErrorCallback
cb' = WebsocketConnectionErrorCallback
-> C_WebsocketConnectionErrorCallback
wrap_WebsocketConnectionErrorCallback WebsocketConnectionErrorCallback
cb
FunPtr C_WebsocketConnectionErrorCallback
cb'' <- C_WebsocketConnectionErrorCallback
-> IO (FunPtr C_WebsocketConnectionErrorCallback)
mk_WebsocketConnectionErrorCallback C_WebsocketConnectionErrorCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionErrorCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"error" FunPtr C_WebsocketConnectionErrorCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionErrorSignalInfo
instance SignalInfo WebsocketConnectionErrorSignalInfo where
type HaskellCallbackType WebsocketConnectionErrorSignalInfo = WebsocketConnectionErrorCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebsocketConnectionErrorCallback cb
cb'' <- mk_WebsocketConnectionErrorCallback cb'
connectSignalFunPtr obj "error" cb'' connectMode detail
#endif
type WebsocketConnectionMessageCallback =
Int32
-> GLib.Bytes.Bytes
-> IO ()
noWebsocketConnectionMessageCallback :: Maybe WebsocketConnectionMessageCallback
noWebsocketConnectionMessageCallback :: Maybe WebsocketConnectionMessageCallback
noWebsocketConnectionMessageCallback = Maybe WebsocketConnectionMessageCallback
forall a. Maybe a
Nothing
type C_WebsocketConnectionMessageCallback =
Ptr () ->
Int32 ->
Ptr GLib.Bytes.Bytes ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionMessageCallback :: C_WebsocketConnectionMessageCallback -> IO (FunPtr C_WebsocketConnectionMessageCallback)
genClosure_WebsocketConnectionMessage :: MonadIO m => WebsocketConnectionMessageCallback -> m (GClosure C_WebsocketConnectionMessageCallback)
genClosure_WebsocketConnectionMessage :: WebsocketConnectionMessageCallback
-> m (GClosure C_WebsocketConnectionMessageCallback)
genClosure_WebsocketConnectionMessage WebsocketConnectionMessageCallback
cb = IO (GClosure C_WebsocketConnectionMessageCallback)
-> m (GClosure C_WebsocketConnectionMessageCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebsocketConnectionMessageCallback)
-> m (GClosure C_WebsocketConnectionMessageCallback))
-> IO (GClosure C_WebsocketConnectionMessageCallback)
-> m (GClosure C_WebsocketConnectionMessageCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionMessageCallback
cb' = WebsocketConnectionMessageCallback
-> C_WebsocketConnectionMessageCallback
wrap_WebsocketConnectionMessageCallback WebsocketConnectionMessageCallback
cb
C_WebsocketConnectionMessageCallback
-> IO (FunPtr C_WebsocketConnectionMessageCallback)
mk_WebsocketConnectionMessageCallback C_WebsocketConnectionMessageCallback
cb' IO (FunPtr C_WebsocketConnectionMessageCallback)
-> (FunPtr C_WebsocketConnectionMessageCallback
-> IO (GClosure C_WebsocketConnectionMessageCallback))
-> IO (GClosure C_WebsocketConnectionMessageCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebsocketConnectionMessageCallback
-> IO (GClosure C_WebsocketConnectionMessageCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebsocketConnectionMessageCallback ::
WebsocketConnectionMessageCallback ->
C_WebsocketConnectionMessageCallback
wrap_WebsocketConnectionMessageCallback :: WebsocketConnectionMessageCallback
-> C_WebsocketConnectionMessageCallback
wrap_WebsocketConnectionMessageCallback WebsocketConnectionMessageCallback
_cb Ptr ()
_ Int32
type_ Ptr Bytes
message Ptr ()
_ = do
(ManagedPtr Bytes -> Bytes)
-> Ptr Bytes -> (Bytes -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes Ptr Bytes
message ((Bytes -> IO ()) -> IO ()) -> (Bytes -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Bytes
message' -> do
WebsocketConnectionMessageCallback
_cb Int32
type_ Bytes
message'
onWebsocketConnectionMessage :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
onWebsocketConnectionMessage :: a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
onWebsocketConnectionMessage a
obj WebsocketConnectionMessageCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionMessageCallback
cb' = WebsocketConnectionMessageCallback
-> C_WebsocketConnectionMessageCallback
wrap_WebsocketConnectionMessageCallback WebsocketConnectionMessageCallback
cb
FunPtr C_WebsocketConnectionMessageCallback
cb'' <- C_WebsocketConnectionMessageCallback
-> IO (FunPtr C_WebsocketConnectionMessageCallback)
mk_WebsocketConnectionMessageCallback C_WebsocketConnectionMessageCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionMessageCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"message" FunPtr C_WebsocketConnectionMessageCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebsocketConnectionMessage :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
afterWebsocketConnectionMessage :: a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
afterWebsocketConnectionMessage a
obj WebsocketConnectionMessageCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionMessageCallback
cb' = WebsocketConnectionMessageCallback
-> C_WebsocketConnectionMessageCallback
wrap_WebsocketConnectionMessageCallback WebsocketConnectionMessageCallback
cb
FunPtr C_WebsocketConnectionMessageCallback
cb'' <- C_WebsocketConnectionMessageCallback
-> IO (FunPtr C_WebsocketConnectionMessageCallback)
mk_WebsocketConnectionMessageCallback C_WebsocketConnectionMessageCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionMessageCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"message" FunPtr C_WebsocketConnectionMessageCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionMessageSignalInfo
instance SignalInfo WebsocketConnectionMessageSignalInfo where
type HaskellCallbackType WebsocketConnectionMessageSignalInfo = WebsocketConnectionMessageCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebsocketConnectionMessageCallback cb
cb'' <- mk_WebsocketConnectionMessageCallback cb'
connectSignalFunPtr obj "message" cb'' connectMode detail
#endif
type WebsocketConnectionPongCallback =
GLib.Bytes.Bytes
-> IO ()
noWebsocketConnectionPongCallback :: Maybe WebsocketConnectionPongCallback
noWebsocketConnectionPongCallback :: Maybe (Bytes -> IO ())
noWebsocketConnectionPongCallback = Maybe (Bytes -> IO ())
forall a. Maybe a
Nothing
type C_WebsocketConnectionPongCallback =
Ptr () ->
Ptr GLib.Bytes.Bytes ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionPongCallback :: C_WebsocketConnectionPongCallback -> IO (FunPtr C_WebsocketConnectionPongCallback)
genClosure_WebsocketConnectionPong :: MonadIO m => WebsocketConnectionPongCallback -> m (GClosure C_WebsocketConnectionPongCallback)
genClosure_WebsocketConnectionPong :: (Bytes -> IO ()) -> m (GClosure C_WebsocketConnectionPongCallback)
genClosure_WebsocketConnectionPong Bytes -> IO ()
cb = IO (GClosure C_WebsocketConnectionPongCallback)
-> m (GClosure C_WebsocketConnectionPongCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebsocketConnectionPongCallback)
-> m (GClosure C_WebsocketConnectionPongCallback))
-> IO (GClosure C_WebsocketConnectionPongCallback)
-> m (GClosure C_WebsocketConnectionPongCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionPongCallback
cb' = (Bytes -> IO ()) -> C_WebsocketConnectionPongCallback
wrap_WebsocketConnectionPongCallback Bytes -> IO ()
cb
C_WebsocketConnectionPongCallback
-> IO (FunPtr C_WebsocketConnectionPongCallback)
mk_WebsocketConnectionPongCallback C_WebsocketConnectionPongCallback
cb' IO (FunPtr C_WebsocketConnectionPongCallback)
-> (FunPtr C_WebsocketConnectionPongCallback
-> IO (GClosure C_WebsocketConnectionPongCallback))
-> IO (GClosure C_WebsocketConnectionPongCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebsocketConnectionPongCallback
-> IO (GClosure C_WebsocketConnectionPongCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebsocketConnectionPongCallback ::
WebsocketConnectionPongCallback ->
C_WebsocketConnectionPongCallback
wrap_WebsocketConnectionPongCallback :: (Bytes -> IO ()) -> C_WebsocketConnectionPongCallback
wrap_WebsocketConnectionPongCallback Bytes -> IO ()
_cb Ptr ()
_ Ptr Bytes
message Ptr ()
_ = do
(ManagedPtr Bytes -> Bytes)
-> Ptr Bytes -> (Bytes -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes Ptr Bytes
message ((Bytes -> IO ()) -> IO ()) -> (Bytes -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Bytes
message' -> do
Bytes -> IO ()
_cb Bytes
message'
onWebsocketConnectionPong :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionPongCallback -> m SignalHandlerId
onWebsocketConnectionPong :: a -> (Bytes -> IO ()) -> m SignalHandlerId
onWebsocketConnectionPong a
obj Bytes -> IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionPongCallback
cb' = (Bytes -> IO ()) -> C_WebsocketConnectionPongCallback
wrap_WebsocketConnectionPongCallback Bytes -> IO ()
cb
FunPtr C_WebsocketConnectionPongCallback
cb'' <- C_WebsocketConnectionPongCallback
-> IO (FunPtr C_WebsocketConnectionPongCallback)
mk_WebsocketConnectionPongCallback C_WebsocketConnectionPongCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionPongCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pong" FunPtr C_WebsocketConnectionPongCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebsocketConnectionPong :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionPongCallback -> m SignalHandlerId
afterWebsocketConnectionPong :: a -> (Bytes -> IO ()) -> m SignalHandlerId
afterWebsocketConnectionPong a
obj Bytes -> IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebsocketConnectionPongCallback
cb' = (Bytes -> IO ()) -> C_WebsocketConnectionPongCallback
wrap_WebsocketConnectionPongCallback Bytes -> IO ()
cb
FunPtr C_WebsocketConnectionPongCallback
cb'' <- C_WebsocketConnectionPongCallback
-> IO (FunPtr C_WebsocketConnectionPongCallback)
mk_WebsocketConnectionPongCallback C_WebsocketConnectionPongCallback
cb'
a
-> Text
-> FunPtr C_WebsocketConnectionPongCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pong" FunPtr C_WebsocketConnectionPongCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionPongSignalInfo
instance SignalInfo WebsocketConnectionPongSignalInfo where
type HaskellCallbackType WebsocketConnectionPongSignalInfo = WebsocketConnectionPongCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebsocketConnectionPongCallback cb
cb'' <- mk_WebsocketConnectionPongCallback cb'
connectSignalFunPtr obj "pong" cb'' connectMode detail
#endif
getWebsocketConnectionConnectionType :: (MonadIO m, IsWebsocketConnection o) => o -> m Soup.Enums.WebsocketConnectionType
getWebsocketConnectionConnectionType :: o -> m WebsocketConnectionType
getWebsocketConnectionConnectionType o
obj = IO WebsocketConnectionType -> m WebsocketConnectionType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketConnectionType -> m WebsocketConnectionType)
-> IO WebsocketConnectionType -> m WebsocketConnectionType
forall a b. (a -> b) -> a -> b
$ o -> String -> IO WebsocketConnectionType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"connection-type"
constructWebsocketConnectionConnectionType :: (IsWebsocketConnection o, MIO.MonadIO m) => Soup.Enums.WebsocketConnectionType -> m (GValueConstruct o)
constructWebsocketConnectionConnectionType :: WebsocketConnectionType -> m (GValueConstruct o)
constructWebsocketConnectionConnectionType WebsocketConnectionType
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> WebsocketConnectionType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"connection-type" WebsocketConnectionType
val
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionConnectionTypePropertyInfo
instance AttrInfo WebsocketConnectionConnectionTypePropertyInfo where
type AttrAllowedOps WebsocketConnectionConnectionTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint WebsocketConnectionConnectionTypePropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionConnectionTypePropertyInfo = (~) Soup.Enums.WebsocketConnectionType
type AttrTransferTypeConstraint WebsocketConnectionConnectionTypePropertyInfo = (~) Soup.Enums.WebsocketConnectionType
type AttrTransferType WebsocketConnectionConnectionTypePropertyInfo = Soup.Enums.WebsocketConnectionType
type AttrGetType WebsocketConnectionConnectionTypePropertyInfo = Soup.Enums.WebsocketConnectionType
type AttrLabel WebsocketConnectionConnectionTypePropertyInfo = "connection-type"
type AttrOrigin WebsocketConnectionConnectionTypePropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionConnectionType
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionConnectionType
attrClear = undefined
#endif
getWebsocketConnectionExtensions :: (MonadIO m, IsWebsocketConnection o) => o -> m (Ptr ())
getWebsocketConnectionExtensions :: o -> m (Ptr ())
getWebsocketConnectionExtensions o
obj = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Ptr ())
forall a b. GObject a => a -> String -> IO (Ptr b)
B.Properties.getObjectPropertyPtr o
obj String
"extensions"
constructWebsocketConnectionExtensions :: (IsWebsocketConnection o, MIO.MonadIO m) => Ptr () -> m (GValueConstruct o)
constructWebsocketConnectionExtensions :: Ptr () -> m (GValueConstruct o)
constructWebsocketConnectionExtensions Ptr ()
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Ptr () -> IO (GValueConstruct o)
forall b o. String -> Ptr b -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyPtr String
"extensions" Ptr ()
val
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionExtensionsPropertyInfo
instance AttrInfo WebsocketConnectionExtensionsPropertyInfo where
type AttrAllowedOps WebsocketConnectionExtensionsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint WebsocketConnectionExtensionsPropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionExtensionsPropertyInfo = (~) (Ptr ())
type AttrTransferTypeConstraint WebsocketConnectionExtensionsPropertyInfo = (~) (Ptr ())
type AttrTransferType WebsocketConnectionExtensionsPropertyInfo = Ptr ()
type AttrGetType WebsocketConnectionExtensionsPropertyInfo = (Ptr ())
type AttrLabel WebsocketConnectionExtensionsPropertyInfo = "extensions"
type AttrOrigin WebsocketConnectionExtensionsPropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionExtensions
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionExtensions
attrClear = undefined
#endif
getWebsocketConnectionIoStream :: (MonadIO m, IsWebsocketConnection o) => o -> m Gio.IOStream.IOStream
getWebsocketConnectionIoStream :: o -> m IOStream
getWebsocketConnectionIoStream o
obj = IO IOStream -> m IOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe IOStream) -> IO IOStream
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getWebsocketConnectionIoStream" (IO (Maybe IOStream) -> IO IOStream)
-> IO (Maybe IOStream) -> IO IOStream
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr IOStream -> IOStream)
-> IO (Maybe IOStream)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"io-stream" ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream
constructWebsocketConnectionIoStream :: (IsWebsocketConnection o, MIO.MonadIO m, Gio.IOStream.IsIOStream a) => a -> m (GValueConstruct o)
constructWebsocketConnectionIoStream :: a -> m (GValueConstruct o)
constructWebsocketConnectionIoStream a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"io-stream" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionIoStreamPropertyInfo
instance AttrInfo WebsocketConnectionIoStreamPropertyInfo where
type AttrAllowedOps WebsocketConnectionIoStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint WebsocketConnectionIoStreamPropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionIoStreamPropertyInfo = Gio.IOStream.IsIOStream
type AttrTransferTypeConstraint WebsocketConnectionIoStreamPropertyInfo = Gio.IOStream.IsIOStream
type AttrTransferType WebsocketConnectionIoStreamPropertyInfo = Gio.IOStream.IOStream
type AttrGetType WebsocketConnectionIoStreamPropertyInfo = Gio.IOStream.IOStream
type AttrLabel WebsocketConnectionIoStreamPropertyInfo = "io-stream"
type AttrOrigin WebsocketConnectionIoStreamPropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionIoStream
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.IOStream.IOStream v
attrConstruct = constructWebsocketConnectionIoStream
attrClear = undefined
#endif
getWebsocketConnectionKeepaliveInterval :: (MonadIO m, IsWebsocketConnection o) => o -> m Word32
getWebsocketConnectionKeepaliveInterval :: o -> m Word32
getWebsocketConnectionKeepaliveInterval o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"keepalive-interval"
setWebsocketConnectionKeepaliveInterval :: (MonadIO m, IsWebsocketConnection o) => o -> Word32 -> m ()
setWebsocketConnectionKeepaliveInterval :: o -> Word32 -> m ()
setWebsocketConnectionKeepaliveInterval o
obj Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"keepalive-interval" Word32
val
constructWebsocketConnectionKeepaliveInterval :: (IsWebsocketConnection o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructWebsocketConnectionKeepaliveInterval :: Word32 -> m (GValueConstruct o)
constructWebsocketConnectionKeepaliveInterval Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"keepalive-interval" Word32
val
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionKeepaliveIntervalPropertyInfo
instance AttrInfo WebsocketConnectionKeepaliveIntervalPropertyInfo where
type AttrAllowedOps WebsocketConnectionKeepaliveIntervalPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint WebsocketConnectionKeepaliveIntervalPropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionKeepaliveIntervalPropertyInfo = (~) Word32
type AttrTransferTypeConstraint WebsocketConnectionKeepaliveIntervalPropertyInfo = (~) Word32
type AttrTransferType WebsocketConnectionKeepaliveIntervalPropertyInfo = Word32
type AttrGetType WebsocketConnectionKeepaliveIntervalPropertyInfo = Word32
type AttrLabel WebsocketConnectionKeepaliveIntervalPropertyInfo = "keepalive-interval"
type AttrOrigin WebsocketConnectionKeepaliveIntervalPropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionKeepaliveInterval
attrSet = setWebsocketConnectionKeepaliveInterval
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionKeepaliveInterval
attrClear = undefined
#endif
getWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> m Word64
getWebsocketConnectionMaxIncomingPayloadSize :: o -> m Word64
getWebsocketConnectionMaxIncomingPayloadSize o
obj = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word64
forall a. GObject a => a -> String -> IO Word64
B.Properties.getObjectPropertyUInt64 o
obj String
"max-incoming-payload-size"
setWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> Word64 -> m ()
setWebsocketConnectionMaxIncomingPayloadSize :: o -> Word64 -> m ()
setWebsocketConnectionMaxIncomingPayloadSize o
obj Word64
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Word64 -> IO ()
forall a. GObject a => a -> String -> Word64 -> IO ()
B.Properties.setObjectPropertyUInt64 o
obj String
"max-incoming-payload-size" Word64
val
constructWebsocketConnectionMaxIncomingPayloadSize :: (IsWebsocketConnection o, MIO.MonadIO m) => Word64 -> m (GValueConstruct o)
constructWebsocketConnectionMaxIncomingPayloadSize :: Word64 -> m (GValueConstruct o)
constructWebsocketConnectionMaxIncomingPayloadSize Word64
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Word64 -> IO (GValueConstruct o)
forall o. String -> Word64 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt64 String
"max-incoming-payload-size" Word64
val
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionMaxIncomingPayloadSizePropertyInfo
instance AttrInfo WebsocketConnectionMaxIncomingPayloadSizePropertyInfo where
type AttrAllowedOps WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = (~) Word64
type AttrTransferTypeConstraint WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = (~) Word64
type AttrTransferType WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = Word64
type AttrGetType WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = Word64
type AttrLabel WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = "max-incoming-payload-size"
type AttrOrigin WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionMaxIncomingPayloadSize
attrSet = setWebsocketConnectionMaxIncomingPayloadSize
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionMaxIncomingPayloadSize
attrClear = undefined
#endif
getWebsocketConnectionOrigin :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe T.Text)
getWebsocketConnectionOrigin :: o -> m (Maybe Text)
getWebsocketConnectionOrigin o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"origin"
constructWebsocketConnectionOrigin :: (IsWebsocketConnection o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructWebsocketConnectionOrigin :: Text -> m (GValueConstruct o)
constructWebsocketConnectionOrigin Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"origin" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionOriginPropertyInfo
instance AttrInfo WebsocketConnectionOriginPropertyInfo where
type AttrAllowedOps WebsocketConnectionOriginPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint WebsocketConnectionOriginPropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionOriginPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint WebsocketConnectionOriginPropertyInfo = (~) T.Text
type AttrTransferType WebsocketConnectionOriginPropertyInfo = T.Text
type AttrGetType WebsocketConnectionOriginPropertyInfo = (Maybe T.Text)
type AttrLabel WebsocketConnectionOriginPropertyInfo = "origin"
type AttrOrigin WebsocketConnectionOriginPropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionOrigin
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionOrigin
attrClear = undefined
#endif
getWebsocketConnectionProtocol :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe T.Text)
getWebsocketConnectionProtocol :: o -> m (Maybe Text)
getWebsocketConnectionProtocol o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"protocol"
constructWebsocketConnectionProtocol :: (IsWebsocketConnection o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructWebsocketConnectionProtocol :: Text -> m (GValueConstruct o)
constructWebsocketConnectionProtocol Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"protocol" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionProtocolPropertyInfo
instance AttrInfo WebsocketConnectionProtocolPropertyInfo where
type AttrAllowedOps WebsocketConnectionProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint WebsocketConnectionProtocolPropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionProtocolPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint WebsocketConnectionProtocolPropertyInfo = (~) T.Text
type AttrTransferType WebsocketConnectionProtocolPropertyInfo = T.Text
type AttrGetType WebsocketConnectionProtocolPropertyInfo = (Maybe T.Text)
type AttrLabel WebsocketConnectionProtocolPropertyInfo = "protocol"
type AttrOrigin WebsocketConnectionProtocolPropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionProtocol
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionProtocol
attrClear = undefined
#endif
getWebsocketConnectionState :: (MonadIO m, IsWebsocketConnection o) => o -> m Soup.Enums.WebsocketState
getWebsocketConnectionState :: o -> m WebsocketState
getWebsocketConnectionState o
obj = IO WebsocketState -> m WebsocketState
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketState -> m WebsocketState)
-> IO WebsocketState -> m WebsocketState
forall a b. (a -> b) -> a -> b
$ o -> String -> IO WebsocketState
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"state"
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionStatePropertyInfo
instance AttrInfo WebsocketConnectionStatePropertyInfo where
type AttrAllowedOps WebsocketConnectionStatePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint WebsocketConnectionStatePropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint WebsocketConnectionStatePropertyInfo = (~) ()
type AttrTransferType WebsocketConnectionStatePropertyInfo = ()
type AttrGetType WebsocketConnectionStatePropertyInfo = Soup.Enums.WebsocketState
type AttrLabel WebsocketConnectionStatePropertyInfo = "state"
type AttrOrigin WebsocketConnectionStatePropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionState
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getWebsocketConnectionUri :: (MonadIO m, IsWebsocketConnection o) => o -> m Soup.URI.URI
getWebsocketConnectionUri :: o -> m URI
getWebsocketConnectionUri o
obj = IO URI -> m URI
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO URI -> m URI) -> IO URI -> m URI
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe URI) -> IO URI
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getWebsocketConnectionUri" (IO (Maybe URI) -> IO URI) -> IO (Maybe URI) -> IO URI
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr URI -> URI) -> IO (Maybe URI)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"uri" ManagedPtr URI -> URI
Soup.URI.URI
constructWebsocketConnectionUri :: (IsWebsocketConnection o, MIO.MonadIO m) => Soup.URI.URI -> m (GValueConstruct o)
constructWebsocketConnectionUri :: URI -> m (GValueConstruct o)
constructWebsocketConnectionUri URI
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe URI -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"uri" (URI -> Maybe URI
forall a. a -> Maybe a
P.Just URI
val)
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionUriPropertyInfo
instance AttrInfo WebsocketConnectionUriPropertyInfo where
type AttrAllowedOps WebsocketConnectionUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint WebsocketConnectionUriPropertyInfo = IsWebsocketConnection
type AttrSetTypeConstraint WebsocketConnectionUriPropertyInfo = (~) Soup.URI.URI
type AttrTransferTypeConstraint WebsocketConnectionUriPropertyInfo = (~) Soup.URI.URI
type AttrTransferType WebsocketConnectionUriPropertyInfo = Soup.URI.URI
type AttrGetType WebsocketConnectionUriPropertyInfo = Soup.URI.URI
type AttrLabel WebsocketConnectionUriPropertyInfo = "uri"
type AttrOrigin WebsocketConnectionUriPropertyInfo = WebsocketConnection
attrGet = getWebsocketConnectionUri
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructWebsocketConnectionUri
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList WebsocketConnection
type instance O.AttributeList WebsocketConnection = WebsocketConnectionAttributeList
type WebsocketConnectionAttributeList = ('[ '("connectionType", WebsocketConnectionConnectionTypePropertyInfo), '("extensions", WebsocketConnectionExtensionsPropertyInfo), '("ioStream", WebsocketConnectionIoStreamPropertyInfo), '("keepaliveInterval", WebsocketConnectionKeepaliveIntervalPropertyInfo), '("maxIncomingPayloadSize", WebsocketConnectionMaxIncomingPayloadSizePropertyInfo), '("origin", WebsocketConnectionOriginPropertyInfo), '("protocol", WebsocketConnectionProtocolPropertyInfo), '("state", WebsocketConnectionStatePropertyInfo), '("uri", WebsocketConnectionUriPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
websocketConnectionConnectionType :: AttrLabelProxy "connectionType"
websocketConnectionConnectionType = AttrLabelProxy
websocketConnectionExtensions :: AttrLabelProxy "extensions"
websocketConnectionExtensions = AttrLabelProxy
websocketConnectionIoStream :: AttrLabelProxy "ioStream"
websocketConnectionIoStream = AttrLabelProxy
websocketConnectionKeepaliveInterval :: AttrLabelProxy "keepaliveInterval"
websocketConnectionKeepaliveInterval = AttrLabelProxy
websocketConnectionMaxIncomingPayloadSize :: AttrLabelProxy "maxIncomingPayloadSize"
websocketConnectionMaxIncomingPayloadSize = AttrLabelProxy
websocketConnectionOrigin :: AttrLabelProxy "origin"
websocketConnectionOrigin = AttrLabelProxy
websocketConnectionProtocol :: AttrLabelProxy "protocol"
websocketConnectionProtocol = AttrLabelProxy
websocketConnectionState :: AttrLabelProxy "state"
websocketConnectionState = AttrLabelProxy
websocketConnectionUri :: AttrLabelProxy "uri"
websocketConnectionUri = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList WebsocketConnection = WebsocketConnectionSignalList
type WebsocketConnectionSignalList = ('[ '("closed", WebsocketConnectionClosedSignalInfo), '("closing", WebsocketConnectionClosingSignalInfo), '("error", WebsocketConnectionErrorSignalInfo), '("message", WebsocketConnectionMessageSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("pong", WebsocketConnectionPongSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "soup_websocket_connection_new" soup_websocket_connection_new ::
Ptr Gio.IOStream.IOStream ->
Ptr Soup.URI.URI ->
CUInt ->
CString ->
CString ->
IO (Ptr WebsocketConnection)
websocketConnectionNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.IOStream.IsIOStream a) =>
a
-> Soup.URI.URI
-> Soup.Enums.WebsocketConnectionType
-> Maybe (T.Text)
-> Maybe (T.Text)
-> m WebsocketConnection
websocketConnectionNew :: a
-> URI
-> WebsocketConnectionType
-> Maybe Text
-> Maybe Text
-> m WebsocketConnection
websocketConnectionNew a
stream URI
uri WebsocketConnectionType
type_ Maybe Text
origin Maybe Text
protocol = IO WebsocketConnection -> m WebsocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketConnection -> m WebsocketConnection)
-> IO WebsocketConnection -> m WebsocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr IOStream
stream' <- a -> IO (Ptr IOStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (WebsocketConnectionType -> Int)
-> WebsocketConnectionType
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WebsocketConnectionType -> Int
forall a. Enum a => a -> Int
fromEnum) WebsocketConnectionType
type_
Ptr CChar
maybeOrigin <- case Maybe Text
origin of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jOrigin -> do
Ptr CChar
jOrigin' <- Text -> IO (Ptr CChar)
textToCString Text
jOrigin
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jOrigin'
Ptr CChar
maybeProtocol <- case Maybe Text
protocol of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jProtocol -> do
Ptr CChar
jProtocol' <- Text -> IO (Ptr CChar)
textToCString Text
jProtocol
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jProtocol'
Ptr WebsocketConnection
result <- Ptr IOStream
-> Ptr URI
-> CUInt
-> Ptr CChar
-> Ptr CChar
-> IO (Ptr WebsocketConnection)
soup_websocket_connection_new Ptr IOStream
stream' Ptr URI
uri' CUInt
type_' Ptr CChar
maybeOrigin Ptr CChar
maybeProtocol
Text -> Ptr WebsocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketConnectionNew" Ptr WebsocketConnection
result
WebsocketConnection
result' <- ((ManagedPtr WebsocketConnection -> WebsocketConnection)
-> Ptr WebsocketConnection -> IO WebsocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr WebsocketConnection -> WebsocketConnection
WebsocketConnection) Ptr WebsocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeOrigin
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeProtocol
WebsocketConnection -> IO WebsocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return WebsocketConnection
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_websocket_connection_new_with_extensions" soup_websocket_connection_new_with_extensions ::
Ptr Gio.IOStream.IOStream ->
Ptr Soup.URI.URI ->
CUInt ->
CString ->
CString ->
Ptr (GList (Ptr Soup.WebsocketExtension.WebsocketExtension)) ->
IO (Ptr WebsocketConnection)
websocketConnectionNewWithExtensions ::
(B.CallStack.HasCallStack, MonadIO m, Gio.IOStream.IsIOStream a, Soup.WebsocketExtension.IsWebsocketExtension b) =>
a
-> Soup.URI.URI
-> Soup.Enums.WebsocketConnectionType
-> Maybe (T.Text)
-> Maybe (T.Text)
-> [b]
-> m WebsocketConnection
websocketConnectionNewWithExtensions :: a
-> URI
-> WebsocketConnectionType
-> Maybe Text
-> Maybe Text
-> [b]
-> m WebsocketConnection
websocketConnectionNewWithExtensions a
stream URI
uri WebsocketConnectionType
type_ Maybe Text
origin Maybe Text
protocol [b]
extensions = IO WebsocketConnection -> m WebsocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketConnection -> m WebsocketConnection)
-> IO WebsocketConnection -> m WebsocketConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr IOStream
stream' <- a -> IO (Ptr IOStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (WebsocketConnectionType -> Int)
-> WebsocketConnectionType
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WebsocketConnectionType -> Int
forall a. Enum a => a -> Int
fromEnum) WebsocketConnectionType
type_
Ptr CChar
maybeOrigin <- case Maybe Text
origin of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jOrigin -> do
Ptr CChar
jOrigin' <- Text -> IO (Ptr CChar)
textToCString Text
jOrigin
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jOrigin'
Ptr CChar
maybeProtocol <- case Maybe Text
protocol of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jProtocol -> do
Ptr CChar
jProtocol' <- Text -> IO (Ptr CChar)
textToCString Text
jProtocol
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jProtocol'
[Ptr WebsocketExtension]
extensions' <- (b -> IO (Ptr WebsocketExtension))
-> [b] -> IO [Ptr WebsocketExtension]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM b -> IO (Ptr WebsocketExtension)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject [b]
extensions
Ptr (GList (Ptr WebsocketExtension))
extensions'' <- [Ptr WebsocketExtension]
-> IO (Ptr (GList (Ptr WebsocketExtension)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr WebsocketExtension]
extensions'
Ptr WebsocketConnection
result <- Ptr IOStream
-> Ptr URI
-> CUInt
-> Ptr CChar
-> Ptr CChar
-> Ptr (GList (Ptr WebsocketExtension))
-> IO (Ptr WebsocketConnection)
soup_websocket_connection_new_with_extensions Ptr IOStream
stream' Ptr URI
uri' CUInt
type_' Ptr CChar
maybeOrigin Ptr CChar
maybeProtocol Ptr (GList (Ptr WebsocketExtension))
extensions''
Text -> Ptr WebsocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketConnectionNewWithExtensions" Ptr WebsocketConnection
result
WebsocketConnection
result' <- ((ManagedPtr WebsocketConnection -> WebsocketConnection)
-> Ptr WebsocketConnection -> IO WebsocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr WebsocketConnection -> WebsocketConnection
WebsocketConnection) Ptr WebsocketConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
(b -> IO ()) -> [b] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [b]
extensions
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeOrigin
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeProtocol
WebsocketConnection -> IO WebsocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return WebsocketConnection
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_websocket_connection_close" soup_websocket_connection_close ::
Ptr WebsocketConnection ->
Word16 ->
CString ->
IO ()
websocketConnectionClose ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> Word16
-> Maybe (T.Text)
-> m ()
websocketConnectionClose :: a -> Word16 -> Maybe Text -> m ()
websocketConnectionClose a
self Word16
code Maybe Text
data_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
maybeData_ <- case Maybe Text
data_ of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jData_ -> do
Ptr CChar
jData_' <- Text -> IO (Ptr CChar)
textToCString Text
jData_
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jData_'
Ptr WebsocketConnection -> Word16 -> Ptr CChar -> IO ()
soup_websocket_connection_close Ptr WebsocketConnection
self' Word16
code Ptr CChar
maybeData_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeData_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionCloseMethodInfo
instance (signature ~ (Word16 -> Maybe (T.Text) -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionCloseMethodInfo a signature where
overloadedMethod = websocketConnectionClose
#endif
foreign import ccall "soup_websocket_connection_get_close_code" soup_websocket_connection_get_close_code ::
Ptr WebsocketConnection ->
IO Word16
websocketConnectionGetCloseCode ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Word16
websocketConnectionGetCloseCode :: a -> m Word16
websocketConnectionGetCloseCode a
self = IO Word16 -> m Word16
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word16 -> m Word16) -> IO Word16 -> m Word16
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Word16
result <- Ptr WebsocketConnection -> IO Word16
soup_websocket_connection_get_close_code Ptr WebsocketConnection
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Word16 -> IO Word16
forall (m :: * -> *) a. Monad m => a -> m a
return Word16
result
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetCloseCodeMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetCloseCodeMethodInfo a signature where
overloadedMethod = websocketConnectionGetCloseCode
#endif
foreign import ccall "soup_websocket_connection_get_close_data" soup_websocket_connection_get_close_data ::
Ptr WebsocketConnection ->
IO CString
websocketConnectionGetCloseData ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m T.Text
websocketConnectionGetCloseData :: a -> m Text
websocketConnectionGetCloseData a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
result <- Ptr WebsocketConnection -> IO (Ptr CChar)
soup_websocket_connection_get_close_data Ptr WebsocketConnection
self'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketConnectionGetCloseData" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetCloseDataMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetCloseDataMethodInfo a signature where
overloadedMethod = websocketConnectionGetCloseData
#endif
foreign import ccall "soup_websocket_connection_get_connection_type" soup_websocket_connection_get_connection_type ::
Ptr WebsocketConnection ->
IO CUInt
websocketConnectionGetConnectionType ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Soup.Enums.WebsocketConnectionType
websocketConnectionGetConnectionType :: a -> m WebsocketConnectionType
websocketConnectionGetConnectionType a
self = IO WebsocketConnectionType -> m WebsocketConnectionType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketConnectionType -> m WebsocketConnectionType)
-> IO WebsocketConnectionType -> m WebsocketConnectionType
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CUInt
result <- Ptr WebsocketConnection -> IO CUInt
soup_websocket_connection_get_connection_type Ptr WebsocketConnection
self'
let result' :: WebsocketConnectionType
result' = (Int -> WebsocketConnectionType
forall a. Enum a => Int -> a
toEnum (Int -> WebsocketConnectionType)
-> (CUInt -> Int) -> CUInt -> WebsocketConnectionType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
WebsocketConnectionType -> IO WebsocketConnectionType
forall (m :: * -> *) a. Monad m => a -> m a
return WebsocketConnectionType
result'
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetConnectionTypeMethodInfo
instance (signature ~ (m Soup.Enums.WebsocketConnectionType), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetConnectionTypeMethodInfo a signature where
overloadedMethod = websocketConnectionGetConnectionType
#endif
foreign import ccall "soup_websocket_connection_get_extensions" soup_websocket_connection_get_extensions ::
Ptr WebsocketConnection ->
IO (Ptr (GList (Ptr Soup.WebsocketExtension.WebsocketExtension)))
websocketConnectionGetExtensions ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m [Soup.WebsocketExtension.WebsocketExtension]
websocketConnectionGetExtensions :: a -> m [WebsocketExtension]
websocketConnectionGetExtensions a
self = IO [WebsocketExtension] -> m [WebsocketExtension]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [WebsocketExtension] -> m [WebsocketExtension])
-> IO [WebsocketExtension] -> m [WebsocketExtension]
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr (GList (Ptr WebsocketExtension))
result <- Ptr WebsocketConnection
-> IO (Ptr (GList (Ptr WebsocketExtension)))
soup_websocket_connection_get_extensions Ptr WebsocketConnection
self'
[Ptr WebsocketExtension]
result' <- Ptr (GList (Ptr WebsocketExtension)) -> IO [Ptr WebsocketExtension]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr WebsocketExtension))
result
[WebsocketExtension]
result'' <- (Ptr WebsocketExtension -> IO WebsocketExtension)
-> [Ptr WebsocketExtension] -> IO [WebsocketExtension]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr WebsocketExtension -> WebsocketExtension)
-> Ptr WebsocketExtension -> IO WebsocketExtension
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr WebsocketExtension -> WebsocketExtension
Soup.WebsocketExtension.WebsocketExtension) [Ptr WebsocketExtension]
result'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
[WebsocketExtension] -> IO [WebsocketExtension]
forall (m :: * -> *) a. Monad m => a -> m a
return [WebsocketExtension]
result''
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetExtensionsMethodInfo
instance (signature ~ (m [Soup.WebsocketExtension.WebsocketExtension]), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetExtensionsMethodInfo a signature where
overloadedMethod = websocketConnectionGetExtensions
#endif
foreign import ccall "soup_websocket_connection_get_io_stream" soup_websocket_connection_get_io_stream ::
Ptr WebsocketConnection ->
IO (Ptr Gio.IOStream.IOStream)
websocketConnectionGetIoStream ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Gio.IOStream.IOStream
websocketConnectionGetIoStream :: a -> m IOStream
websocketConnectionGetIoStream a
self = IO IOStream -> m IOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr IOStream
result <- Ptr WebsocketConnection -> IO (Ptr IOStream)
soup_websocket_connection_get_io_stream Ptr WebsocketConnection
self'
Text -> Ptr IOStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketConnectionGetIoStream" Ptr IOStream
result
IOStream
result' <- ((ManagedPtr IOStream -> IOStream) -> Ptr IOStream -> IO IOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
IOStream -> IO IOStream
forall (m :: * -> *) a. Monad m => a -> m a
return IOStream
result'
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetIoStreamMethodInfo
instance (signature ~ (m Gio.IOStream.IOStream), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetIoStreamMethodInfo a signature where
overloadedMethod = websocketConnectionGetIoStream
#endif
foreign import ccall "soup_websocket_connection_get_keepalive_interval" soup_websocket_connection_get_keepalive_interval ::
Ptr WebsocketConnection ->
IO Word32
websocketConnectionGetKeepaliveInterval ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Word32
websocketConnectionGetKeepaliveInterval :: a -> m Word32
websocketConnectionGetKeepaliveInterval a
self = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Word32
result <- Ptr WebsocketConnection -> IO Word32
soup_websocket_connection_get_keepalive_interval Ptr WebsocketConnection
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetKeepaliveIntervalMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetKeepaliveIntervalMethodInfo a signature where
overloadedMethod = websocketConnectionGetKeepaliveInterval
#endif
foreign import ccall "soup_websocket_connection_get_max_incoming_payload_size" soup_websocket_connection_get_max_incoming_payload_size ::
Ptr WebsocketConnection ->
IO Word64
websocketConnectionGetMaxIncomingPayloadSize ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Word64
websocketConnectionGetMaxIncomingPayloadSize :: a -> m Word64
websocketConnectionGetMaxIncomingPayloadSize a
self = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Word64
result <- Ptr WebsocketConnection -> IO Word64
soup_websocket_connection_get_max_incoming_payload_size Ptr WebsocketConnection
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo a signature where
overloadedMethod = websocketConnectionGetMaxIncomingPayloadSize
#endif
foreign import ccall "soup_websocket_connection_get_origin" soup_websocket_connection_get_origin ::
Ptr WebsocketConnection ->
IO CString
websocketConnectionGetOrigin ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m (Maybe T.Text)
websocketConnectionGetOrigin :: a -> m (Maybe Text)
websocketConnectionGetOrigin a
self = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
result <- Ptr WebsocketConnection -> IO (Ptr CChar)
soup_websocket_connection_get_origin Ptr WebsocketConnection
self'
Maybe Text
maybeResult <- Ptr CChar -> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CChar
result ((Ptr CChar -> IO Text) -> IO (Maybe Text))
-> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr CChar
result' -> do
Text
result'' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetOriginMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetOriginMethodInfo a signature where
overloadedMethod = websocketConnectionGetOrigin
#endif
foreign import ccall "soup_websocket_connection_get_protocol" soup_websocket_connection_get_protocol ::
Ptr WebsocketConnection ->
IO CString
websocketConnectionGetProtocol ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m (Maybe T.Text)
websocketConnectionGetProtocol :: a -> m (Maybe Text)
websocketConnectionGetProtocol a
self = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
result <- Ptr WebsocketConnection -> IO (Ptr CChar)
soup_websocket_connection_get_protocol Ptr WebsocketConnection
self'
Maybe Text
maybeResult <- Ptr CChar -> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CChar
result ((Ptr CChar -> IO Text) -> IO (Maybe Text))
-> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr CChar
result' -> do
Text
result'' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetProtocolMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetProtocolMethodInfo a signature where
overloadedMethod = websocketConnectionGetProtocol
#endif
foreign import ccall "soup_websocket_connection_get_state" soup_websocket_connection_get_state ::
Ptr WebsocketConnection ->
IO CUInt
websocketConnectionGetState ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Soup.Enums.WebsocketState
websocketConnectionGetState :: a -> m WebsocketState
websocketConnectionGetState a
self = IO WebsocketState -> m WebsocketState
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketState -> m WebsocketState)
-> IO WebsocketState -> m WebsocketState
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CUInt
result <- Ptr WebsocketConnection -> IO CUInt
soup_websocket_connection_get_state Ptr WebsocketConnection
self'
let result' :: WebsocketState
result' = (Int -> WebsocketState
forall a. Enum a => Int -> a
toEnum (Int -> WebsocketState)
-> (CUInt -> Int) -> CUInt -> WebsocketState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
WebsocketState -> IO WebsocketState
forall (m :: * -> *) a. Monad m => a -> m a
return WebsocketState
result'
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetStateMethodInfo
instance (signature ~ (m Soup.Enums.WebsocketState), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetStateMethodInfo a signature where
overloadedMethod = websocketConnectionGetState
#endif
foreign import ccall "soup_websocket_connection_get_uri" soup_websocket_connection_get_uri ::
Ptr WebsocketConnection ->
IO (Ptr Soup.URI.URI)
websocketConnectionGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> m Soup.URI.URI
websocketConnectionGetUri :: a -> m URI
websocketConnectionGetUri a
self = IO URI -> m URI
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO URI -> m URI) -> IO URI -> m URI
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr URI
result <- Ptr WebsocketConnection -> IO (Ptr URI)
soup_websocket_connection_get_uri Ptr WebsocketConnection
self'
Text -> Ptr URI -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketConnectionGetUri" Ptr URI
result
URI
result' <- ((ManagedPtr URI -> URI) -> Ptr URI -> IO URI
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr URI -> URI
Soup.URI.URI) Ptr URI
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
URI -> IO URI
forall (m :: * -> *) a. Monad m => a -> m a
return URI
result'
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionGetUriMethodInfo
instance (signature ~ (m Soup.URI.URI), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetUriMethodInfo a signature where
overloadedMethod = websocketConnectionGetUri
#endif
foreign import ccall "soup_websocket_connection_send_binary" soup_websocket_connection_send_binary ::
Ptr WebsocketConnection ->
Ptr Word8 ->
Word64 ->
IO ()
websocketConnectionSendBinary ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> Maybe (ByteString)
-> m ()
websocketConnectionSendBinary :: a -> Maybe ByteString -> m ()
websocketConnectionSendBinary a
self Maybe ByteString
data_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let length_ :: Word64
length_ = case Maybe ByteString
data_ of
Maybe ByteString
Nothing -> Word64
0
Just ByteString
jData_ -> Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
jData_
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Word8
maybeData_ <- case Maybe ByteString
data_ of
Maybe ByteString
Nothing -> Ptr Word8 -> IO (Ptr Word8)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Word8
forall a. Ptr a
nullPtr
Just ByteString
jData_ -> do
Ptr Word8
jData_' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
jData_
Ptr Word8 -> IO (Ptr Word8)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Word8
jData_'
Ptr WebsocketConnection -> Ptr Word8 -> Word64 -> IO ()
soup_websocket_connection_send_binary Ptr WebsocketConnection
self' Ptr Word8
maybeData_ Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
maybeData_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionSendBinaryMethodInfo
instance (signature ~ (Maybe (ByteString) -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSendBinaryMethodInfo a signature where
overloadedMethod = websocketConnectionSendBinary
#endif
foreign import ccall "soup_websocket_connection_send_message" soup_websocket_connection_send_message ::
Ptr WebsocketConnection ->
CUInt ->
Ptr GLib.Bytes.Bytes ->
IO ()
websocketConnectionSendMessage ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> Soup.Enums.WebsocketDataType
-> GLib.Bytes.Bytes
-> m ()
websocketConnectionSendMessage :: a -> WebsocketDataType -> Bytes -> m ()
websocketConnectionSendMessage a
self WebsocketDataType
type_ Bytes
message = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (WebsocketDataType -> Int) -> WebsocketDataType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WebsocketDataType -> Int
forall a. Enum a => a -> Int
fromEnum) WebsocketDataType
type_
Ptr Bytes
message' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
message
Ptr WebsocketConnection -> CUInt -> Ptr Bytes -> IO ()
soup_websocket_connection_send_message Ptr WebsocketConnection
self' CUInt
type_' Ptr Bytes
message'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
message
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionSendMessageMethodInfo
instance (signature ~ (Soup.Enums.WebsocketDataType -> GLib.Bytes.Bytes -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSendMessageMethodInfo a signature where
overloadedMethod = websocketConnectionSendMessage
#endif
foreign import ccall "soup_websocket_connection_send_text" soup_websocket_connection_send_text ::
Ptr WebsocketConnection ->
CString ->
IO ()
websocketConnectionSendText ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> T.Text
-> m ()
websocketConnectionSendText :: a -> Text -> m ()
websocketConnectionSendText a
self Text
text = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
text' <- Text -> IO (Ptr CChar)
textToCString Text
text
Ptr WebsocketConnection -> Ptr CChar -> IO ()
soup_websocket_connection_send_text Ptr WebsocketConnection
self' Ptr CChar
text'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
text'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionSendTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSendTextMethodInfo a signature where
overloadedMethod = websocketConnectionSendText
#endif
foreign import ccall "soup_websocket_connection_set_keepalive_interval" soup_websocket_connection_set_keepalive_interval ::
Ptr WebsocketConnection ->
Word32 ->
IO ()
websocketConnectionSetKeepaliveInterval ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> Word32
-> m ()
websocketConnectionSetKeepaliveInterval :: a -> Word32 -> m ()
websocketConnectionSetKeepaliveInterval a
self Word32
interval = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr WebsocketConnection -> Word32 -> IO ()
soup_websocket_connection_set_keepalive_interval Ptr WebsocketConnection
self' Word32
interval
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionSetKeepaliveIntervalMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSetKeepaliveIntervalMethodInfo a signature where
overloadedMethod = websocketConnectionSetKeepaliveInterval
#endif
foreign import ccall "soup_websocket_connection_set_max_incoming_payload_size" soup_websocket_connection_set_max_incoming_payload_size ::
Ptr WebsocketConnection ->
Word64 ->
IO ()
websocketConnectionSetMaxIncomingPayloadSize ::
(B.CallStack.HasCallStack, MonadIO m, IsWebsocketConnection a) =>
a
-> Word64
-> m ()
websocketConnectionSetMaxIncomingPayloadSize :: a -> Word64 -> m ()
websocketConnectionSetMaxIncomingPayloadSize a
self Word64
maxIncomingPayloadSize = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr WebsocketConnection
self' <- a -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr WebsocketConnection -> Word64 -> IO ()
soup_websocket_connection_set_max_incoming_payload_size Ptr WebsocketConnection
self' Word64
maxIncomingPayloadSize
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo a signature where
overloadedMethod = websocketConnectionSetMaxIncomingPayloadSize
#endif