#define ENABLE_OVERLOADING \
(!defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.TcpWrapperConnection
(
TcpWrapperConnection(..) ,
IsTcpWrapperConnection ,
toTcpWrapperConnection ,
noTcpWrapperConnection ,
#if ENABLE_OVERLOADING
TcpWrapperConnectionGetBaseIoStreamMethodInfo,
#endif
tcpWrapperConnectionGetBaseIoStream ,
tcpWrapperConnectionNew ,
#if ENABLE_OVERLOADING
TcpWrapperConnectionBaseIoStreamPropertyInfo,
#endif
constructTcpWrapperConnectionBaseIoStream,
getTcpWrapperConnectionBaseIoStream ,
#if ENABLE_OVERLOADING
tcpWrapperConnectionBaseIoStream ,
#endif
) 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.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.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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.Socket as Gio.Socket
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketConnection as Gio.SocketConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.TcpConnection as Gio.TcpConnection
newtype TcpWrapperConnection = TcpWrapperConnection (ManagedPtr TcpWrapperConnection)
foreign import ccall "g_tcp_wrapper_connection_get_type"
c_g_tcp_wrapper_connection_get_type :: IO GType
instance GObject TcpWrapperConnection where
gobjectType :: TcpWrapperConnection -> IO GType
gobjectType _ = IO GType
c_g_tcp_wrapper_connection_get_type
class GObject o => IsTcpWrapperConnection o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError TcpWrapperConnection a) =>
IsTcpWrapperConnection a
#endif
instance IsTcpWrapperConnection TcpWrapperConnection
instance Gio.TcpConnection.IsTcpConnection TcpWrapperConnection
instance Gio.SocketConnection.IsSocketConnection TcpWrapperConnection
instance Gio.IOStream.IsIOStream TcpWrapperConnection
instance GObject.Object.IsObject TcpWrapperConnection
toTcpWrapperConnection :: (MonadIO m, IsTcpWrapperConnection o) => o -> m TcpWrapperConnection
toTcpWrapperConnection :: o -> m TcpWrapperConnection
toTcpWrapperConnection = IO TcpWrapperConnection -> m TcpWrapperConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TcpWrapperConnection -> m TcpWrapperConnection)
-> (o -> IO TcpWrapperConnection) -> o -> m TcpWrapperConnection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TcpWrapperConnection -> TcpWrapperConnection)
-> o -> IO TcpWrapperConnection
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr TcpWrapperConnection -> TcpWrapperConnection
TcpWrapperConnection
noTcpWrapperConnection :: Maybe TcpWrapperConnection
noTcpWrapperConnection :: Maybe TcpWrapperConnection
noTcpWrapperConnection = Maybe TcpWrapperConnection
forall a. Maybe a
Nothing
#if ENABLE_OVERLOADING
type family ResolveTcpWrapperConnectionMethod (t :: Symbol) (o :: *) :: * where
ResolveTcpWrapperConnectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTcpWrapperConnectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTcpWrapperConnectionMethod "clearPending" o = Gio.IOStream.IOStreamClearPendingMethodInfo
ResolveTcpWrapperConnectionMethod "close" o = Gio.IOStream.IOStreamCloseMethodInfo
ResolveTcpWrapperConnectionMethod "closeAsync" o = Gio.IOStream.IOStreamCloseAsyncMethodInfo
ResolveTcpWrapperConnectionMethod "closeFinish" o = Gio.IOStream.IOStreamCloseFinishMethodInfo
ResolveTcpWrapperConnectionMethod "connect" o = Gio.SocketConnection.SocketConnectionConnectMethodInfo
ResolveTcpWrapperConnectionMethod "connectAsync" o = Gio.SocketConnection.SocketConnectionConnectAsyncMethodInfo
ResolveTcpWrapperConnectionMethod "connectFinish" o = Gio.SocketConnection.SocketConnectionConnectFinishMethodInfo
ResolveTcpWrapperConnectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTcpWrapperConnectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTcpWrapperConnectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTcpWrapperConnectionMethod "hasPending" o = Gio.IOStream.IOStreamHasPendingMethodInfo
ResolveTcpWrapperConnectionMethod "isClosed" o = Gio.IOStream.IOStreamIsClosedMethodInfo
ResolveTcpWrapperConnectionMethod "isConnected" o = Gio.SocketConnection.SocketConnectionIsConnectedMethodInfo
ResolveTcpWrapperConnectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTcpWrapperConnectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTcpWrapperConnectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTcpWrapperConnectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTcpWrapperConnectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTcpWrapperConnectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTcpWrapperConnectionMethod "spliceAsync" o = Gio.IOStream.IOStreamSpliceAsyncMethodInfo
ResolveTcpWrapperConnectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTcpWrapperConnectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTcpWrapperConnectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTcpWrapperConnectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTcpWrapperConnectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTcpWrapperConnectionMethod "getBaseIoStream" o = TcpWrapperConnectionGetBaseIoStreamMethodInfo
ResolveTcpWrapperConnectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTcpWrapperConnectionMethod "getGracefulDisconnect" o = Gio.TcpConnection.TcpConnectionGetGracefulDisconnectMethodInfo
ResolveTcpWrapperConnectionMethod "getInputStream" o = Gio.IOStream.IOStreamGetInputStreamMethodInfo
ResolveTcpWrapperConnectionMethod "getLocalAddress" o = Gio.SocketConnection.SocketConnectionGetLocalAddressMethodInfo
ResolveTcpWrapperConnectionMethod "getOutputStream" o = Gio.IOStream.IOStreamGetOutputStreamMethodInfo
ResolveTcpWrapperConnectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTcpWrapperConnectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTcpWrapperConnectionMethod "getRemoteAddress" o = Gio.SocketConnection.SocketConnectionGetRemoteAddressMethodInfo
ResolveTcpWrapperConnectionMethod "getSocket" o = Gio.SocketConnection.SocketConnectionGetSocketMethodInfo
ResolveTcpWrapperConnectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTcpWrapperConnectionMethod "setGracefulDisconnect" o = Gio.TcpConnection.TcpConnectionSetGracefulDisconnectMethodInfo
ResolveTcpWrapperConnectionMethod "setPending" o = Gio.IOStream.IOStreamSetPendingMethodInfo
ResolveTcpWrapperConnectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTcpWrapperConnectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTcpWrapperConnectionMethod t TcpWrapperConnection, O.MethodInfo info TcpWrapperConnection p) => O.IsLabelProxy t (TcpWrapperConnection -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTcpWrapperConnectionMethod t TcpWrapperConnection, O.MethodInfo info TcpWrapperConnection p) => O.IsLabel t (TcpWrapperConnection -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getTcpWrapperConnectionBaseIoStream :: (MonadIO m, IsTcpWrapperConnection o) => o -> m Gio.IOStream.IOStream
getTcpWrapperConnectionBaseIoStream :: o -> m IOStream
getTcpWrapperConnectionBaseIoStream obj :: 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 "getTcpWrapperConnectionBaseIoStream" (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)
getObjectPropertyObject o
obj "base-io-stream" ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream
constructTcpWrapperConnectionBaseIoStream :: (IsTcpWrapperConnection o, Gio.IOStream.IsIOStream a) => a -> IO (GValueConstruct o)
constructTcpWrapperConnectionBaseIoStream :: a -> IO (GValueConstruct o)
constructTcpWrapperConnectionBaseIoStream val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyObject "base-io-stream" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if ENABLE_OVERLOADING
data TcpWrapperConnectionBaseIoStreamPropertyInfo
instance AttrInfo TcpWrapperConnectionBaseIoStreamPropertyInfo where
type AttrAllowedOps TcpWrapperConnectionBaseIoStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint TcpWrapperConnectionBaseIoStreamPropertyInfo = Gio.IOStream.IsIOStream
type AttrBaseTypeConstraint TcpWrapperConnectionBaseIoStreamPropertyInfo = IsTcpWrapperConnection
type AttrGetType TcpWrapperConnectionBaseIoStreamPropertyInfo = Gio.IOStream.IOStream
type AttrLabel TcpWrapperConnectionBaseIoStreamPropertyInfo = "base-io-stream"
type AttrOrigin TcpWrapperConnectionBaseIoStreamPropertyInfo = TcpWrapperConnection
attrGet _ = getTcpWrapperConnectionBaseIoStream
attrSet _ = undefined
attrConstruct _ = constructTcpWrapperConnectionBaseIoStream
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList TcpWrapperConnection
type instance O.AttributeList TcpWrapperConnection = TcpWrapperConnectionAttributeList
type TcpWrapperConnectionAttributeList = ('[ '("baseIoStream", TcpWrapperConnectionBaseIoStreamPropertyInfo), '("closed", Gio.IOStream.IOStreamClosedPropertyInfo), '("gracefulDisconnect", Gio.TcpConnection.TcpConnectionGracefulDisconnectPropertyInfo), '("inputStream", Gio.IOStream.IOStreamInputStreamPropertyInfo), '("outputStream", Gio.IOStream.IOStreamOutputStreamPropertyInfo), '("socket", Gio.SocketConnection.SocketConnectionSocketPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
tcpWrapperConnectionBaseIoStream :: AttrLabelProxy "baseIoStream"
tcpWrapperConnectionBaseIoStream = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList TcpWrapperConnection = TcpWrapperConnectionSignalList
type TcpWrapperConnectionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_tcp_wrapper_connection_new" g_tcp_wrapper_connection_new ::
Ptr Gio.IOStream.IOStream ->
Ptr Gio.Socket.Socket ->
IO (Ptr TcpWrapperConnection)
tcpWrapperConnectionNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.IOStream.IsIOStream a, Gio.Socket.IsSocket b) =>
a
-> b
-> m TcpWrapperConnection
tcpWrapperConnectionNew :: a -> b -> m TcpWrapperConnection
tcpWrapperConnectionNew baseIoStream :: a
baseIoStream socket :: b
socket = IO TcpWrapperConnection -> m TcpWrapperConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TcpWrapperConnection -> m TcpWrapperConnection)
-> IO TcpWrapperConnection -> m TcpWrapperConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr IOStream
baseIoStream' <- a -> IO (Ptr IOStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
baseIoStream
Ptr Socket
socket' <- b -> IO (Ptr Socket)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
socket
Ptr TcpWrapperConnection
result <- Ptr IOStream -> Ptr Socket -> IO (Ptr TcpWrapperConnection)
g_tcp_wrapper_connection_new Ptr IOStream
baseIoStream' Ptr Socket
socket'
Text -> Ptr TcpWrapperConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "tcpWrapperConnectionNew" Ptr TcpWrapperConnection
result
TcpWrapperConnection
result' <- ((ManagedPtr TcpWrapperConnection -> TcpWrapperConnection)
-> Ptr TcpWrapperConnection -> IO TcpWrapperConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr TcpWrapperConnection -> TcpWrapperConnection
TcpWrapperConnection) Ptr TcpWrapperConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
baseIoStream
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
socket
TcpWrapperConnection -> IO TcpWrapperConnection
forall (m :: * -> *) a. Monad m => a -> m a
return TcpWrapperConnection
result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_tcp_wrapper_connection_get_base_io_stream" g_tcp_wrapper_connection_get_base_io_stream ::
Ptr TcpWrapperConnection ->
IO (Ptr Gio.IOStream.IOStream)
tcpWrapperConnectionGetBaseIoStream ::
(B.CallStack.HasCallStack, MonadIO m, IsTcpWrapperConnection a) =>
a
-> m Gio.IOStream.IOStream
tcpWrapperConnectionGetBaseIoStream :: a -> m IOStream
tcpWrapperConnectionGetBaseIoStream conn :: a
conn = 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 TcpWrapperConnection
conn' <- a -> IO (Ptr TcpWrapperConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
conn
Ptr IOStream
result <- Ptr TcpWrapperConnection -> IO (Ptr IOStream)
g_tcp_wrapper_connection_get_base_io_stream Ptr TcpWrapperConnection
conn'
Text -> Ptr IOStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "tcpWrapperConnectionGetBaseIoStream" 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
conn
IOStream -> IO IOStream
forall (m :: * -> *) a. Monad m => a -> m a
return IOStream
result'
#if ENABLE_OVERLOADING
data TcpWrapperConnectionGetBaseIoStreamMethodInfo
instance (signature ~ (m Gio.IOStream.IOStream), MonadIO m, IsTcpWrapperConnection a) => O.MethodInfo TcpWrapperConnectionGetBaseIoStreamMethodInfo a signature where
overloadedMethod _ = tcpWrapperConnectionGetBaseIoStream
#endif