module GI.Gio.Objects.TcpWrapperConnection
(
TcpWrapperConnection(..) ,
TcpWrapperConnectionK ,
toTcpWrapperConnection ,
noTcpWrapperConnection ,
tcpWrapperConnectionGetBaseIoStream ,
tcpWrapperConnectionNew ,
TcpWrapperConnectionBaseIoStreamPropertyInfo,
constructTcpWrapperConnectionBaseIoStream,
getTcpWrapperConnectionBaseIoStream ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gio.Types
import GI.Gio.Callbacks
import qualified GI.GObject as GObject
newtype TcpWrapperConnection = TcpWrapperConnection (ForeignPtr TcpWrapperConnection)
foreign import ccall "g_tcp_wrapper_connection_get_type"
c_g_tcp_wrapper_connection_get_type :: IO GType
type instance ParentTypes TcpWrapperConnection = TcpWrapperConnectionParentTypes
type TcpWrapperConnectionParentTypes = '[TcpConnection, SocketConnection, IOStream, GObject.Object]
instance GObject TcpWrapperConnection where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_g_tcp_wrapper_connection_get_type
class GObject o => TcpWrapperConnectionK o
instance (GObject o, IsDescendantOf TcpWrapperConnection o) => TcpWrapperConnectionK o
toTcpWrapperConnection :: TcpWrapperConnectionK o => o -> IO TcpWrapperConnection
toTcpWrapperConnection = unsafeCastTo TcpWrapperConnection
noTcpWrapperConnection :: Maybe TcpWrapperConnection
noTcpWrapperConnection = Nothing
getTcpWrapperConnectionBaseIoStream :: (MonadIO m, TcpWrapperConnectionK o) => o -> m IOStream
getTcpWrapperConnectionBaseIoStream obj = liftIO $ getObjectPropertyObject obj "base-io-stream" IOStream
constructTcpWrapperConnectionBaseIoStream :: (IOStreamK a) => a -> IO ([Char], GValue)
constructTcpWrapperConnectionBaseIoStream val = constructObjectPropertyObject "base-io-stream" val
data TcpWrapperConnectionBaseIoStreamPropertyInfo
instance AttrInfo TcpWrapperConnectionBaseIoStreamPropertyInfo where
type AttrAllowedOps TcpWrapperConnectionBaseIoStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint TcpWrapperConnectionBaseIoStreamPropertyInfo = IOStreamK
type AttrBaseTypeConstraint TcpWrapperConnectionBaseIoStreamPropertyInfo = TcpWrapperConnectionK
type AttrGetType TcpWrapperConnectionBaseIoStreamPropertyInfo = IOStream
type AttrLabel TcpWrapperConnectionBaseIoStreamPropertyInfo = "TcpWrapperConnection::base-io-stream"
attrGet _ = getTcpWrapperConnectionBaseIoStream
attrSet _ = undefined
attrConstruct _ = constructTcpWrapperConnectionBaseIoStream
type instance AttributeList TcpWrapperConnection = TcpWrapperConnectionAttributeList
type TcpWrapperConnectionAttributeList = ('[ '("base-io-stream", TcpWrapperConnectionBaseIoStreamPropertyInfo), '("closed", IOStreamClosedPropertyInfo), '("graceful-disconnect", TcpConnectionGracefulDisconnectPropertyInfo), '("input-stream", IOStreamInputStreamPropertyInfo), '("output-stream", IOStreamOutputStreamPropertyInfo), '("socket", SocketConnectionSocketPropertyInfo)] :: [(Symbol, *)])
type instance SignalList TcpWrapperConnection = TcpWrapperConnectionSignalList
type TcpWrapperConnectionSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "g_tcp_wrapper_connection_new" g_tcp_wrapper_connection_new ::
Ptr IOStream ->
Ptr Socket ->
IO (Ptr TcpWrapperConnection)
tcpWrapperConnectionNew ::
(MonadIO m, IOStreamK a, SocketK b) =>
a ->
b ->
m TcpWrapperConnection
tcpWrapperConnectionNew base_io_stream socket = liftIO $ do
let base_io_stream' = unsafeManagedPtrCastPtr base_io_stream
let socket' = unsafeManagedPtrCastPtr socket
result <- g_tcp_wrapper_connection_new base_io_stream' socket'
checkUnexpectedReturnNULL "g_tcp_wrapper_connection_new" result
result' <- (wrapObject TcpWrapperConnection) result
touchManagedPtr base_io_stream
touchManagedPtr socket
return result'
foreign import ccall "g_tcp_wrapper_connection_get_base_io_stream" g_tcp_wrapper_connection_get_base_io_stream ::
Ptr TcpWrapperConnection ->
IO (Ptr IOStream)
tcpWrapperConnectionGetBaseIoStream ::
(MonadIO m, TcpWrapperConnectionK a) =>
a ->
m IOStream
tcpWrapperConnectionGetBaseIoStream _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_tcp_wrapper_connection_get_base_io_stream _obj'
checkUnexpectedReturnNULL "g_tcp_wrapper_connection_get_base_io_stream" result
result' <- (newObject IOStream) result
touchManagedPtr _obj
return result'