{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.SocketConnectable
(
SocketConnectable(..) ,
noSocketConnectable ,
IsSocketConnectable ,
toSocketConnectable ,
#if defined(ENABLE_OVERLOADING)
ResolveSocketConnectableMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketConnectableEnumerateMethodInfo ,
#endif
socketConnectableEnumerate ,
#if defined(ENABLE_OVERLOADING)
SocketConnectableProxyEnumerateMethodInfo,
#endif
socketConnectableProxyEnumerate ,
#if defined(ENABLE_OVERLOADING)
SocketConnectableToStringMethodInfo ,
#endif
socketConnectableToString ,
) 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.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 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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddressEnumerator as Gio.SocketAddressEnumerator
newtype SocketConnectable = SocketConnectable (ManagedPtr SocketConnectable)
deriving (SocketConnectable -> SocketConnectable -> Bool
(SocketConnectable -> SocketConnectable -> Bool)
-> (SocketConnectable -> SocketConnectable -> Bool)
-> Eq SocketConnectable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SocketConnectable -> SocketConnectable -> Bool
$c/= :: SocketConnectable -> SocketConnectable -> Bool
== :: SocketConnectable -> SocketConnectable -> Bool
$c== :: SocketConnectable -> SocketConnectable -> Bool
Eq)
noSocketConnectable :: Maybe SocketConnectable
noSocketConnectable :: Maybe SocketConnectable
noSocketConnectable = Maybe SocketConnectable
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SocketConnectable = SocketConnectableSignalList
type SocketConnectableSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_socket_connectable_get_type"
c_g_socket_connectable_get_type :: IO GType
instance GObject SocketConnectable where
gobjectType :: IO GType
gobjectType = IO GType
c_g_socket_connectable_get_type
instance B.GValue.IsGValue SocketConnectable where
toGValue :: SocketConnectable -> IO GValue
toGValue o :: SocketConnectable
o = do
GType
gtype <- IO GType
c_g_socket_connectable_get_type
SocketConnectable
-> (Ptr SocketConnectable -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SocketConnectable
o (GType
-> (GValue -> Ptr SocketConnectable -> IO ())
-> Ptr SocketConnectable
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr SocketConnectable -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO SocketConnectable
fromGValue gv :: GValue
gv = do
Ptr SocketConnectable
ptr <- GValue -> IO (Ptr SocketConnectable)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr SocketConnectable)
(ManagedPtr SocketConnectable -> SocketConnectable)
-> Ptr SocketConnectable -> IO SocketConnectable
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SocketConnectable -> SocketConnectable
SocketConnectable Ptr SocketConnectable
ptr
class (GObject o, O.IsDescendantOf SocketConnectable o) => IsSocketConnectable o
instance (GObject o, O.IsDescendantOf SocketConnectable o) => IsSocketConnectable o
instance O.HasParentTypes SocketConnectable
type instance O.ParentTypes SocketConnectable = '[GObject.Object.Object]
toSocketConnectable :: (MonadIO m, IsSocketConnectable o) => o -> m SocketConnectable
toSocketConnectable :: o -> m SocketConnectable
toSocketConnectable = IO SocketConnectable -> m SocketConnectable
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketConnectable -> m SocketConnectable)
-> (o -> IO SocketConnectable) -> o -> m SocketConnectable
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SocketConnectable -> SocketConnectable)
-> o -> IO SocketConnectable
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr SocketConnectable -> SocketConnectable
SocketConnectable
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SocketConnectable
type instance O.AttributeList SocketConnectable = SocketConnectableAttributeList
type SocketConnectableAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveSocketConnectableMethod (t :: Symbol) (o :: *) :: * where
ResolveSocketConnectableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSocketConnectableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSocketConnectableMethod "enumerate" o = SocketConnectableEnumerateMethodInfo
ResolveSocketConnectableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSocketConnectableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSocketConnectableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSocketConnectableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSocketConnectableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSocketConnectableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSocketConnectableMethod "proxyEnumerate" o = SocketConnectableProxyEnumerateMethodInfo
ResolveSocketConnectableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSocketConnectableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSocketConnectableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSocketConnectableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSocketConnectableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSocketConnectableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSocketConnectableMethod "toString" o = SocketConnectableToStringMethodInfo
ResolveSocketConnectableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSocketConnectableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSocketConnectableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSocketConnectableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSocketConnectableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSocketConnectableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSocketConnectableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSocketConnectableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSocketConnectableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSocketConnectableMethod t SocketConnectable, O.MethodInfo info SocketConnectable p) => OL.IsLabel t (SocketConnectable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "g_socket_connectable_enumerate" g_socket_connectable_enumerate ::
Ptr SocketConnectable ->
IO (Ptr Gio.SocketAddressEnumerator.SocketAddressEnumerator)
socketConnectableEnumerate ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketConnectable a) =>
a
-> m Gio.SocketAddressEnumerator.SocketAddressEnumerator
socketConnectableEnumerate :: a -> m SocketAddressEnumerator
socketConnectableEnumerate connectable :: a
connectable = IO SocketAddressEnumerator -> m SocketAddressEnumerator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketAddressEnumerator -> m SocketAddressEnumerator)
-> IO SocketAddressEnumerator -> m SocketAddressEnumerator
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketConnectable
connectable' <- a -> IO (Ptr SocketConnectable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connectable
Ptr SocketAddressEnumerator
result <- Ptr SocketConnectable -> IO (Ptr SocketAddressEnumerator)
g_socket_connectable_enumerate Ptr SocketConnectable
connectable'
Text -> Ptr SocketAddressEnumerator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketConnectableEnumerate" Ptr SocketAddressEnumerator
result
SocketAddressEnumerator
result' <- ((ManagedPtr SocketAddressEnumerator -> SocketAddressEnumerator)
-> Ptr SocketAddressEnumerator -> IO SocketAddressEnumerator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketAddressEnumerator -> SocketAddressEnumerator
Gio.SocketAddressEnumerator.SocketAddressEnumerator) Ptr SocketAddressEnumerator
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connectable
SocketAddressEnumerator -> IO SocketAddressEnumerator
forall (m :: * -> *) a. Monad m => a -> m a
return SocketAddressEnumerator
result'
#if defined(ENABLE_OVERLOADING)
data SocketConnectableEnumerateMethodInfo
instance (signature ~ (m Gio.SocketAddressEnumerator.SocketAddressEnumerator), MonadIO m, IsSocketConnectable a) => O.MethodInfo SocketConnectableEnumerateMethodInfo a signature where
overloadedMethod = socketConnectableEnumerate
#endif
foreign import ccall "g_socket_connectable_proxy_enumerate" g_socket_connectable_proxy_enumerate ::
Ptr SocketConnectable ->
IO (Ptr Gio.SocketAddressEnumerator.SocketAddressEnumerator)
socketConnectableProxyEnumerate ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketConnectable a) =>
a
-> m Gio.SocketAddressEnumerator.SocketAddressEnumerator
socketConnectableProxyEnumerate :: a -> m SocketAddressEnumerator
socketConnectableProxyEnumerate connectable :: a
connectable = IO SocketAddressEnumerator -> m SocketAddressEnumerator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketAddressEnumerator -> m SocketAddressEnumerator)
-> IO SocketAddressEnumerator -> m SocketAddressEnumerator
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketConnectable
connectable' <- a -> IO (Ptr SocketConnectable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connectable
Ptr SocketAddressEnumerator
result <- Ptr SocketConnectable -> IO (Ptr SocketAddressEnumerator)
g_socket_connectable_proxy_enumerate Ptr SocketConnectable
connectable'
Text -> Ptr SocketAddressEnumerator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketConnectableProxyEnumerate" Ptr SocketAddressEnumerator
result
SocketAddressEnumerator
result' <- ((ManagedPtr SocketAddressEnumerator -> SocketAddressEnumerator)
-> Ptr SocketAddressEnumerator -> IO SocketAddressEnumerator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SocketAddressEnumerator -> SocketAddressEnumerator
Gio.SocketAddressEnumerator.SocketAddressEnumerator) Ptr SocketAddressEnumerator
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connectable
SocketAddressEnumerator -> IO SocketAddressEnumerator
forall (m :: * -> *) a. Monad m => a -> m a
return SocketAddressEnumerator
result'
#if defined(ENABLE_OVERLOADING)
data SocketConnectableProxyEnumerateMethodInfo
instance (signature ~ (m Gio.SocketAddressEnumerator.SocketAddressEnumerator), MonadIO m, IsSocketConnectable a) => O.MethodInfo SocketConnectableProxyEnumerateMethodInfo a signature where
overloadedMethod = socketConnectableProxyEnumerate
#endif
foreign import ccall "g_socket_connectable_to_string" g_socket_connectable_to_string ::
Ptr SocketConnectable ->
IO CString
socketConnectableToString ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketConnectable a) =>
a
-> m T.Text
socketConnectableToString :: a -> m Text
socketConnectableToString connectable :: a
connectable = 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 SocketConnectable
connectable' <- a -> IO (Ptr SocketConnectable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connectable
CString
result <- Ptr SocketConnectable -> IO CString
g_socket_connectable_to_string Ptr SocketConnectable
connectable'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "socketConnectableToString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connectable
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data SocketConnectableToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSocketConnectable a) => O.MethodInfo SocketConnectableToStringMethodInfo a signature where
overloadedMethod = socketConnectableToString
#endif