module GI.Soup.Objects.WebsocketConnection
(
WebsocketConnection(..) ,
IsWebsocketConnection ,
toWebsocketConnection ,
noWebsocketConnection ,
WebsocketConnectionCloseMethodInfo ,
websocketConnectionClose ,
WebsocketConnectionGetCloseCodeMethodInfo,
websocketConnectionGetCloseCode ,
WebsocketConnectionGetCloseDataMethodInfo,
websocketConnectionGetCloseData ,
WebsocketConnectionGetConnectionTypeMethodInfo,
websocketConnectionGetConnectionType ,
WebsocketConnectionGetIoStreamMethodInfo,
websocketConnectionGetIoStream ,
WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo,
websocketConnectionGetMaxIncomingPayloadSize,
WebsocketConnectionGetOriginMethodInfo ,
websocketConnectionGetOrigin ,
WebsocketConnectionGetProtocolMethodInfo,
websocketConnectionGetProtocol ,
WebsocketConnectionGetStateMethodInfo ,
websocketConnectionGetState ,
WebsocketConnectionGetUriMethodInfo ,
websocketConnectionGetUri ,
websocketConnectionNew ,
WebsocketConnectionSendBinaryMethodInfo ,
websocketConnectionSendBinary ,
WebsocketConnectionSendTextMethodInfo ,
websocketConnectionSendText ,
WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo,
websocketConnectionSetMaxIncomingPayloadSize,
WebsocketConnectionConnectionTypePropertyInfo,
constructWebsocketConnectionConnectionType,
getWebsocketConnectionConnectionType ,
websocketConnectionConnectionType ,
WebsocketConnectionIoStreamPropertyInfo ,
constructWebsocketConnectionIoStream ,
getWebsocketConnectionIoStream ,
websocketConnectionIoStream ,
WebsocketConnectionMaxIncomingPayloadSizePropertyInfo,
constructWebsocketConnectionMaxIncomingPayloadSize,
getWebsocketConnectionMaxIncomingPayloadSize,
setWebsocketConnectionMaxIncomingPayloadSize,
websocketConnectionMaxIncomingPayloadSize,
WebsocketConnectionOriginPropertyInfo ,
constructWebsocketConnectionOrigin ,
getWebsocketConnectionOrigin ,
websocketConnectionOrigin ,
WebsocketConnectionProtocolPropertyInfo ,
constructWebsocketConnectionProtocol ,
getWebsocketConnectionProtocol ,
websocketConnectionProtocol ,
WebsocketConnectionStatePropertyInfo ,
getWebsocketConnectionState ,
websocketConnectionState ,
WebsocketConnectionUriPropertyInfo ,
constructWebsocketConnectionUri ,
getWebsocketConnectionUri ,
websocketConnectionUri ,
C_WebsocketConnectionClosedCallback ,
WebsocketConnectionClosedCallback ,
WebsocketConnectionClosedSignalInfo ,
afterWebsocketConnectionClosed ,
genClosure_WebsocketConnectionClosed ,
mk_WebsocketConnectionClosedCallback ,
noWebsocketConnectionClosedCallback ,
onWebsocketConnectionClosed ,
wrap_WebsocketConnectionClosedCallback ,
C_WebsocketConnectionClosingCallback ,
WebsocketConnectionClosingCallback ,
WebsocketConnectionClosingSignalInfo ,
afterWebsocketConnectionClosing ,
genClosure_WebsocketConnectionClosing ,
mk_WebsocketConnectionClosingCallback ,
noWebsocketConnectionClosingCallback ,
onWebsocketConnectionClosing ,
wrap_WebsocketConnectionClosingCallback ,
C_WebsocketConnectionErrorCallback ,
WebsocketConnectionErrorCallback ,
WebsocketConnectionErrorSignalInfo ,
afterWebsocketConnectionError ,
genClosure_WebsocketConnectionError ,
mk_WebsocketConnectionErrorCallback ,
noWebsocketConnectionErrorCallback ,
onWebsocketConnectionError ,
wrap_WebsocketConnectionErrorCallback ,
C_WebsocketConnectionMessageCallback ,
WebsocketConnectionMessageCallback ,
WebsocketConnectionMessageSignalInfo ,
afterWebsocketConnectionMessage ,
genClosure_WebsocketConnectionMessage ,
mk_WebsocketConnectionMessageCallback ,
noWebsocketConnectionMessageCallback ,
onWebsocketConnectionMessage ,
wrap_WebsocketConnectionMessageCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 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 qualified GI.Soup.Enums as Soup.Enums
import qualified GI.Soup.Structs.URI as Soup.URI
newtype WebsocketConnection = WebsocketConnection (ManagedPtr WebsocketConnection)
foreign import ccall "soup_websocket_connection_get_type"
c_soup_websocket_connection_get_type :: IO GType
instance GObject WebsocketConnection where
gobjectType _ = c_soup_websocket_connection_get_type
class GObject o => IsWebsocketConnection o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError WebsocketConnection a) =>
IsWebsocketConnection a
#endif
instance IsWebsocketConnection WebsocketConnection
instance GObject.Object.IsObject WebsocketConnection
toWebsocketConnection :: IsWebsocketConnection o => o -> IO WebsocketConnection
toWebsocketConnection = unsafeCastTo WebsocketConnection
noWebsocketConnection :: Maybe WebsocketConnection
noWebsocketConnection = Nothing
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveWebsocketConnectionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveWebsocketConnectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveWebsocketConnectionMethod "sendBinary" o = WebsocketConnectionSendBinaryMethodInfo
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 "getIoStream" o = WebsocketConnectionGetIoStreamMethodInfo
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 "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) => O.IsLabelProxy t (WebsocketConnection -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveWebsocketConnectionMethod t WebsocketConnection, O.MethodInfo info WebsocketConnection p) => O.IsLabel t (WebsocketConnection -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
type WebsocketConnectionClosedCallback =
IO ()
noWebsocketConnectionClosedCallback :: Maybe WebsocketConnectionClosedCallback
noWebsocketConnectionClosedCallback = Nothing
type C_WebsocketConnectionClosedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionClosedCallback :: C_WebsocketConnectionClosedCallback -> IO (FunPtr C_WebsocketConnectionClosedCallback)
genClosure_WebsocketConnectionClosed :: WebsocketConnectionClosedCallback -> IO Closure
genClosure_WebsocketConnectionClosed cb = do
let cb' = wrap_WebsocketConnectionClosedCallback cb
mk_WebsocketConnectionClosedCallback cb' >>= newCClosure
wrap_WebsocketConnectionClosedCallback ::
WebsocketConnectionClosedCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_WebsocketConnectionClosedCallback _cb _ _ = do
_cb
onWebsocketConnectionClosed :: (GObject a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId
onWebsocketConnectionClosed obj cb = liftIO $ connectWebsocketConnectionClosed obj cb SignalConnectBefore
afterWebsocketConnectionClosed :: (GObject a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId
afterWebsocketConnectionClosed obj cb = connectWebsocketConnectionClosed obj cb SignalConnectAfter
connectWebsocketConnectionClosed :: (GObject a, MonadIO m) =>
a -> WebsocketConnectionClosedCallback -> SignalConnectMode -> m SignalHandlerId
connectWebsocketConnectionClosed obj cb after = liftIO $ do
let cb' = wrap_WebsocketConnectionClosedCallback cb
cb'' <- mk_WebsocketConnectionClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' after
type WebsocketConnectionClosingCallback =
IO ()
noWebsocketConnectionClosingCallback :: Maybe WebsocketConnectionClosingCallback
noWebsocketConnectionClosingCallback = Nothing
type C_WebsocketConnectionClosingCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionClosingCallback :: C_WebsocketConnectionClosingCallback -> IO (FunPtr C_WebsocketConnectionClosingCallback)
genClosure_WebsocketConnectionClosing :: WebsocketConnectionClosingCallback -> IO Closure
genClosure_WebsocketConnectionClosing cb = do
let cb' = wrap_WebsocketConnectionClosingCallback cb
mk_WebsocketConnectionClosingCallback cb' >>= newCClosure
wrap_WebsocketConnectionClosingCallback ::
WebsocketConnectionClosingCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_WebsocketConnectionClosingCallback _cb _ _ = do
_cb
onWebsocketConnectionClosing :: (GObject a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId
onWebsocketConnectionClosing obj cb = liftIO $ connectWebsocketConnectionClosing obj cb SignalConnectBefore
afterWebsocketConnectionClosing :: (GObject a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId
afterWebsocketConnectionClosing obj cb = connectWebsocketConnectionClosing obj cb SignalConnectAfter
connectWebsocketConnectionClosing :: (GObject a, MonadIO m) =>
a -> WebsocketConnectionClosingCallback -> SignalConnectMode -> m SignalHandlerId
connectWebsocketConnectionClosing obj cb after = liftIO $ do
let cb' = wrap_WebsocketConnectionClosingCallback cb
cb'' <- mk_WebsocketConnectionClosingCallback cb'
connectSignalFunPtr obj "closing" cb'' after
type WebsocketConnectionErrorCallback =
GError ->
IO ()
noWebsocketConnectionErrorCallback :: Maybe WebsocketConnectionErrorCallback
noWebsocketConnectionErrorCallback = Nothing
type C_WebsocketConnectionErrorCallback =
Ptr () ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebsocketConnectionErrorCallback :: C_WebsocketConnectionErrorCallback -> IO (FunPtr C_WebsocketConnectionErrorCallback)
genClosure_WebsocketConnectionError :: WebsocketConnectionErrorCallback -> IO Closure
genClosure_WebsocketConnectionError cb = do
let cb' = wrap_WebsocketConnectionErrorCallback cb
mk_WebsocketConnectionErrorCallback cb' >>= newCClosure
wrap_WebsocketConnectionErrorCallback ::
WebsocketConnectionErrorCallback ->
Ptr () ->
Ptr GError ->
Ptr () ->
IO ()
wrap_WebsocketConnectionErrorCallback _cb _ error_ _ = do
error_' <- (newBoxed GError) error_
_cb error_'
onWebsocketConnectionError :: (GObject a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
onWebsocketConnectionError obj cb = liftIO $ connectWebsocketConnectionError obj cb SignalConnectBefore
afterWebsocketConnectionError :: (GObject a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
afterWebsocketConnectionError obj cb = connectWebsocketConnectionError obj cb SignalConnectAfter
connectWebsocketConnectionError :: (GObject a, MonadIO m) =>
a -> WebsocketConnectionErrorCallback -> SignalConnectMode -> m SignalHandlerId
connectWebsocketConnectionError obj cb after = liftIO $ do
let cb' = wrap_WebsocketConnectionErrorCallback cb
cb'' <- mk_WebsocketConnectionErrorCallback cb'
connectSignalFunPtr obj "error" cb'' after
type WebsocketConnectionMessageCallback =
Int32 ->
GLib.Bytes.Bytes ->
IO ()
noWebsocketConnectionMessageCallback :: Maybe WebsocketConnectionMessageCallback
noWebsocketConnectionMessageCallback = 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 :: WebsocketConnectionMessageCallback -> IO Closure
genClosure_WebsocketConnectionMessage cb = do
let cb' = wrap_WebsocketConnectionMessageCallback cb
mk_WebsocketConnectionMessageCallback cb' >>= newCClosure
wrap_WebsocketConnectionMessageCallback ::
WebsocketConnectionMessageCallback ->
Ptr () ->
Int32 ->
Ptr GLib.Bytes.Bytes ->
Ptr () ->
IO ()
wrap_WebsocketConnectionMessageCallback _cb _ type_ message _ = do
message' <- (newBoxed GLib.Bytes.Bytes) message
_cb type_ message'
onWebsocketConnectionMessage :: (GObject a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
onWebsocketConnectionMessage obj cb = liftIO $ connectWebsocketConnectionMessage obj cb SignalConnectBefore
afterWebsocketConnectionMessage :: (GObject a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
afterWebsocketConnectionMessage obj cb = connectWebsocketConnectionMessage obj cb SignalConnectAfter
connectWebsocketConnectionMessage :: (GObject a, MonadIO m) =>
a -> WebsocketConnectionMessageCallback -> SignalConnectMode -> m SignalHandlerId
connectWebsocketConnectionMessage obj cb after = liftIO $ do
let cb' = wrap_WebsocketConnectionMessageCallback cb
cb'' <- mk_WebsocketConnectionMessageCallback cb'
connectSignalFunPtr obj "message" cb'' after
getWebsocketConnectionConnectionType :: (MonadIO m, IsWebsocketConnection o) => o -> m Soup.Enums.WebsocketConnectionType
getWebsocketConnectionConnectionType obj = liftIO $ getObjectPropertyEnum obj "connection-type"
constructWebsocketConnectionConnectionType :: (IsWebsocketConnection o) => Soup.Enums.WebsocketConnectionType -> IO (GValueConstruct o)
constructWebsocketConnectionConnectionType val = constructObjectPropertyEnum "connection-type" val
data WebsocketConnectionConnectionTypePropertyInfo
instance AttrInfo WebsocketConnectionConnectionTypePropertyInfo where
type AttrAllowedOps WebsocketConnectionConnectionTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint WebsocketConnectionConnectionTypePropertyInfo = (~) Soup.Enums.WebsocketConnectionType
type AttrBaseTypeConstraint WebsocketConnectionConnectionTypePropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionConnectionTypePropertyInfo = Soup.Enums.WebsocketConnectionType
type AttrLabel WebsocketConnectionConnectionTypePropertyInfo = "connection-type"
type AttrOrigin WebsocketConnectionConnectionTypePropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionConnectionType
attrSet _ = undefined
attrConstruct _ = constructWebsocketConnectionConnectionType
attrClear _ = undefined
getWebsocketConnectionIoStream :: (MonadIO m, IsWebsocketConnection o) => o -> m Gio.IOStream.IOStream
getWebsocketConnectionIoStream obj = liftIO $ checkUnexpectedNothing "getWebsocketConnectionIoStream" $ getObjectPropertyObject obj "io-stream" Gio.IOStream.IOStream
constructWebsocketConnectionIoStream :: (IsWebsocketConnection o, Gio.IOStream.IsIOStream a) => a -> IO (GValueConstruct o)
constructWebsocketConnectionIoStream val = constructObjectPropertyObject "io-stream" (Just val)
data WebsocketConnectionIoStreamPropertyInfo
instance AttrInfo WebsocketConnectionIoStreamPropertyInfo where
type AttrAllowedOps WebsocketConnectionIoStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint WebsocketConnectionIoStreamPropertyInfo = Gio.IOStream.IsIOStream
type AttrBaseTypeConstraint WebsocketConnectionIoStreamPropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionIoStreamPropertyInfo = Gio.IOStream.IOStream
type AttrLabel WebsocketConnectionIoStreamPropertyInfo = "io-stream"
type AttrOrigin WebsocketConnectionIoStreamPropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionIoStream
attrSet _ = undefined
attrConstruct _ = constructWebsocketConnectionIoStream
attrClear _ = undefined
getWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> m Word64
getWebsocketConnectionMaxIncomingPayloadSize obj = liftIO $ getObjectPropertyUInt64 obj "max-incoming-payload-size"
setWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> Word64 -> m ()
setWebsocketConnectionMaxIncomingPayloadSize obj val = liftIO $ setObjectPropertyUInt64 obj "max-incoming-payload-size" val
constructWebsocketConnectionMaxIncomingPayloadSize :: (IsWebsocketConnection o) => Word64 -> IO (GValueConstruct o)
constructWebsocketConnectionMaxIncomingPayloadSize val = constructObjectPropertyUInt64 "max-incoming-payload-size" val
data WebsocketConnectionMaxIncomingPayloadSizePropertyInfo
instance AttrInfo WebsocketConnectionMaxIncomingPayloadSizePropertyInfo where
type AttrAllowedOps WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = (~) Word64
type AttrBaseTypeConstraint WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = Word64
type AttrLabel WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = "max-incoming-payload-size"
type AttrOrigin WebsocketConnectionMaxIncomingPayloadSizePropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionMaxIncomingPayloadSize
attrSet _ = setWebsocketConnectionMaxIncomingPayloadSize
attrConstruct _ = constructWebsocketConnectionMaxIncomingPayloadSize
attrClear _ = undefined
getWebsocketConnectionOrigin :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe T.Text)
getWebsocketConnectionOrigin obj = liftIO $ getObjectPropertyString obj "origin"
constructWebsocketConnectionOrigin :: (IsWebsocketConnection o) => T.Text -> IO (GValueConstruct o)
constructWebsocketConnectionOrigin val = constructObjectPropertyString "origin" (Just val)
data WebsocketConnectionOriginPropertyInfo
instance AttrInfo WebsocketConnectionOriginPropertyInfo where
type AttrAllowedOps WebsocketConnectionOriginPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint WebsocketConnectionOriginPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint WebsocketConnectionOriginPropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionOriginPropertyInfo = (Maybe T.Text)
type AttrLabel WebsocketConnectionOriginPropertyInfo = "origin"
type AttrOrigin WebsocketConnectionOriginPropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionOrigin
attrSet _ = undefined
attrConstruct _ = constructWebsocketConnectionOrigin
attrClear _ = undefined
getWebsocketConnectionProtocol :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe T.Text)
getWebsocketConnectionProtocol obj = liftIO $ getObjectPropertyString obj "protocol"
constructWebsocketConnectionProtocol :: (IsWebsocketConnection o) => T.Text -> IO (GValueConstruct o)
constructWebsocketConnectionProtocol val = constructObjectPropertyString "protocol" (Just val)
data WebsocketConnectionProtocolPropertyInfo
instance AttrInfo WebsocketConnectionProtocolPropertyInfo where
type AttrAllowedOps WebsocketConnectionProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint WebsocketConnectionProtocolPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint WebsocketConnectionProtocolPropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionProtocolPropertyInfo = (Maybe T.Text)
type AttrLabel WebsocketConnectionProtocolPropertyInfo = "protocol"
type AttrOrigin WebsocketConnectionProtocolPropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionProtocol
attrSet _ = undefined
attrConstruct _ = constructWebsocketConnectionProtocol
attrClear _ = undefined
getWebsocketConnectionState :: (MonadIO m, IsWebsocketConnection o) => o -> m Soup.Enums.WebsocketState
getWebsocketConnectionState obj = liftIO $ getObjectPropertyEnum obj "state"
data WebsocketConnectionStatePropertyInfo
instance AttrInfo WebsocketConnectionStatePropertyInfo where
type AttrAllowedOps WebsocketConnectionStatePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint WebsocketConnectionStatePropertyInfo = (~) ()
type AttrBaseTypeConstraint WebsocketConnectionStatePropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionStatePropertyInfo = Soup.Enums.WebsocketState
type AttrLabel WebsocketConnectionStatePropertyInfo = "state"
type AttrOrigin WebsocketConnectionStatePropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionState
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
getWebsocketConnectionUri :: (MonadIO m, IsWebsocketConnection o) => o -> m Soup.URI.URI
getWebsocketConnectionUri obj = liftIO $ checkUnexpectedNothing "getWebsocketConnectionUri" $ getObjectPropertyBoxed obj "uri" Soup.URI.URI
constructWebsocketConnectionUri :: (IsWebsocketConnection o) => Soup.URI.URI -> IO (GValueConstruct o)
constructWebsocketConnectionUri val = constructObjectPropertyBoxed "uri" (Just val)
data WebsocketConnectionUriPropertyInfo
instance AttrInfo WebsocketConnectionUriPropertyInfo where
type AttrAllowedOps WebsocketConnectionUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint WebsocketConnectionUriPropertyInfo = (~) Soup.URI.URI
type AttrBaseTypeConstraint WebsocketConnectionUriPropertyInfo = IsWebsocketConnection
type AttrGetType WebsocketConnectionUriPropertyInfo = Soup.URI.URI
type AttrLabel WebsocketConnectionUriPropertyInfo = "uri"
type AttrOrigin WebsocketConnectionUriPropertyInfo = WebsocketConnection
attrGet _ = getWebsocketConnectionUri
attrSet _ = undefined
attrConstruct _ = constructWebsocketConnectionUri
attrClear _ = undefined
instance O.HasAttributeList WebsocketConnection
type instance O.AttributeList WebsocketConnection = WebsocketConnectionAttributeList
type WebsocketConnectionAttributeList = ('[ '("connectionType", WebsocketConnectionConnectionTypePropertyInfo), '("ioStream", WebsocketConnectionIoStreamPropertyInfo), '("maxIncomingPayloadSize", WebsocketConnectionMaxIncomingPayloadSizePropertyInfo), '("origin", WebsocketConnectionOriginPropertyInfo), '("protocol", WebsocketConnectionProtocolPropertyInfo), '("state", WebsocketConnectionStatePropertyInfo), '("uri", WebsocketConnectionUriPropertyInfo)] :: [(Symbol, *)])
websocketConnectionConnectionType :: AttrLabelProxy "connectionType"
websocketConnectionConnectionType = AttrLabelProxy
websocketConnectionIoStream :: AttrLabelProxy "ioStream"
websocketConnectionIoStream = 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
data WebsocketConnectionClosedSignalInfo
instance SignalInfo WebsocketConnectionClosedSignalInfo where
type HaskellCallbackType WebsocketConnectionClosedSignalInfo = WebsocketConnectionClosedCallback
connectSignal _ = connectWebsocketConnectionClosed
data WebsocketConnectionClosingSignalInfo
instance SignalInfo WebsocketConnectionClosingSignalInfo where
type HaskellCallbackType WebsocketConnectionClosingSignalInfo = WebsocketConnectionClosingCallback
connectSignal _ = connectWebsocketConnectionClosing
data WebsocketConnectionErrorSignalInfo
instance SignalInfo WebsocketConnectionErrorSignalInfo where
type HaskellCallbackType WebsocketConnectionErrorSignalInfo = WebsocketConnectionErrorCallback
connectSignal _ = connectWebsocketConnectionError
data WebsocketConnectionMessageSignalInfo
instance SignalInfo WebsocketConnectionMessageSignalInfo where
type HaskellCallbackType WebsocketConnectionMessageSignalInfo = WebsocketConnectionMessageCallback
connectSignal _ = connectWebsocketConnectionMessage
type instance O.SignalList WebsocketConnection = WebsocketConnectionSignalList
type WebsocketConnectionSignalList = ('[ '("closed", WebsocketConnectionClosedSignalInfo), '("closing", WebsocketConnectionClosingSignalInfo), '("error", WebsocketConnectionErrorSignalInfo), '("message", WebsocketConnectionMessageSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
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 stream uri type_ origin protocol = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
uri' <- unsafeManagedPtrGetPtr uri
let type_' = (fromIntegral . fromEnum) type_
maybeOrigin <- case origin of
Nothing -> return nullPtr
Just jOrigin -> do
jOrigin' <- textToCString jOrigin
return jOrigin'
maybeProtocol <- case protocol of
Nothing -> return nullPtr
Just jProtocol -> do
jProtocol' <- textToCString jProtocol
return jProtocol'
result <- soup_websocket_connection_new stream' uri' type_' maybeOrigin maybeProtocol
checkUnexpectedReturnNULL "websocketConnectionNew" result
result' <- (wrapObject WebsocketConnection) result
touchManagedPtr stream
touchManagedPtr uri
freeMem maybeOrigin
freeMem maybeProtocol
return result'
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 self code data_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeData_ <- case data_ of
Nothing -> return nullPtr
Just jData_ -> do
jData_' <- textToCString jData_
return jData_'
soup_websocket_connection_close self' code maybeData_
touchManagedPtr self
freeMem maybeData_
return ()
data WebsocketConnectionCloseMethodInfo
instance (signature ~ (Word16 -> Maybe (T.Text) -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionCloseMethodInfo a signature where
overloadedMethod _ = websocketConnectionClose
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_close_code self'
touchManagedPtr self
return result
data WebsocketConnectionGetCloseCodeMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetCloseCodeMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetCloseCode
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_close_data self'
checkUnexpectedReturnNULL "websocketConnectionGetCloseData" result
result' <- cstringToText result
touchManagedPtr self
return result'
data WebsocketConnectionGetCloseDataMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetCloseDataMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetCloseData
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_connection_type self'
let result' = (toEnum . fromIntegral) result
touchManagedPtr self
return result'
data WebsocketConnectionGetConnectionTypeMethodInfo
instance (signature ~ (m Soup.Enums.WebsocketConnectionType), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetConnectionTypeMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetConnectionType
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_io_stream self'
checkUnexpectedReturnNULL "websocketConnectionGetIoStream" result
result' <- (newObject Gio.IOStream.IOStream) result
touchManagedPtr self
return result'
data WebsocketConnectionGetIoStreamMethodInfo
instance (signature ~ (m Gio.IOStream.IOStream), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetIoStreamMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetIoStream
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_max_incoming_payload_size self'
touchManagedPtr self
return result
data WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetMaxIncomingPayloadSizeMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetMaxIncomingPayloadSize
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_origin self'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr self
return maybeResult
data WebsocketConnectionGetOriginMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetOriginMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetOrigin
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_protocol self'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr self
return maybeResult
data WebsocketConnectionGetProtocolMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetProtocolMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetProtocol
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_state self'
let result' = (toEnum . fromIntegral) result
touchManagedPtr self
return result'
data WebsocketConnectionGetStateMethodInfo
instance (signature ~ (m Soup.Enums.WebsocketState), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetStateMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetState
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 self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- soup_websocket_connection_get_uri self'
checkUnexpectedReturnNULL "websocketConnectionGetUri" result
result' <- (newBoxed Soup.URI.URI) result
touchManagedPtr self
return result'
data WebsocketConnectionGetUriMethodInfo
instance (signature ~ (m Soup.URI.URI), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionGetUriMethodInfo a signature where
overloadedMethod _ = websocketConnectionGetUri
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
-> ByteString
-> m ()
websocketConnectionSendBinary self data_ = liftIO $ do
let length_ = fromIntegral $ B.length data_
self' <- unsafeManagedPtrCastPtr self
data_' <- packByteString data_
soup_websocket_connection_send_binary self' data_' length_
touchManagedPtr self
freeMem data_'
return ()
data WebsocketConnectionSendBinaryMethodInfo
instance (signature ~ (ByteString -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSendBinaryMethodInfo a signature where
overloadedMethod _ = websocketConnectionSendBinary
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 self text = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
text' <- textToCString text
soup_websocket_connection_send_text self' text'
touchManagedPtr self
freeMem text'
return ()
data WebsocketConnectionSendTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSendTextMethodInfo a signature where
overloadedMethod _ = websocketConnectionSendText
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 self maxIncomingPayloadSize = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
soup_websocket_connection_set_max_incoming_payload_size self' maxIncomingPayloadSize
touchManagedPtr self
return ()
data WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsWebsocketConnection a) => O.MethodInfo WebsocketConnectionSetMaxIncomingPayloadSizeMethodInfo a signature where
overloadedMethod _ = websocketConnectionSetMaxIncomingPayloadSize