#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.InetSocketAddress
(
InetSocketAddress(..) ,
IsInetSocketAddress ,
toInetSocketAddress ,
noInetSocketAddress ,
#if ENABLE_OVERLOADING
InetSocketAddressGetAddressMethodInfo ,
#endif
inetSocketAddressGetAddress ,
#if ENABLE_OVERLOADING
InetSocketAddressGetFlowinfoMethodInfo ,
#endif
inetSocketAddressGetFlowinfo ,
#if ENABLE_OVERLOADING
InetSocketAddressGetPortMethodInfo ,
#endif
inetSocketAddressGetPort ,
#if ENABLE_OVERLOADING
InetSocketAddressGetScopeIdMethodInfo ,
#endif
inetSocketAddressGetScopeId ,
inetSocketAddressNew ,
inetSocketAddressNewFromString ,
#if ENABLE_OVERLOADING
InetSocketAddressAddressPropertyInfo ,
#endif
constructInetSocketAddressAddress ,
getInetSocketAddressAddress ,
#if ENABLE_OVERLOADING
inetSocketAddressAddress ,
#endif
#if ENABLE_OVERLOADING
InetSocketAddressFlowinfoPropertyInfo ,
#endif
constructInetSocketAddressFlowinfo ,
getInetSocketAddressFlowinfo ,
#if ENABLE_OVERLOADING
inetSocketAddressFlowinfo ,
#endif
#if ENABLE_OVERLOADING
InetSocketAddressPortPropertyInfo ,
#endif
constructInetSocketAddressPort ,
getInetSocketAddressPort ,
#if ENABLE_OVERLOADING
inetSocketAddressPort ,
#endif
#if ENABLE_OVERLOADING
InetSocketAddressScopeIdPropertyInfo ,
#endif
constructInetSocketAddressScopeId ,
getInetSocketAddressScopeId ,
#if ENABLE_OVERLOADING
inetSocketAddressScopeId ,
#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.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.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.Interfaces.SocketConnectable as Gio.SocketConnectable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
newtype InetSocketAddress = InetSocketAddress (ManagedPtr InetSocketAddress)
foreign import ccall "g_inet_socket_address_get_type"
c_g_inet_socket_address_get_type :: IO GType
instance GObject InetSocketAddress where
gobjectType = c_g_inet_socket_address_get_type
class (GObject o, O.IsDescendantOf InetSocketAddress o) => IsInetSocketAddress o
instance (GObject o, O.IsDescendantOf InetSocketAddress o) => IsInetSocketAddress o
instance O.HasParentTypes InetSocketAddress
type instance O.ParentTypes InetSocketAddress = '[Gio.SocketAddress.SocketAddress, GObject.Object.Object, Gio.SocketConnectable.SocketConnectable]
toInetSocketAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m InetSocketAddress
toInetSocketAddress = liftIO . unsafeCastTo InetSocketAddress
noInetSocketAddress :: Maybe InetSocketAddress
noInetSocketAddress = Nothing
#if ENABLE_OVERLOADING
type family ResolveInetSocketAddressMethod (t :: Symbol) (o :: *) :: * where
ResolveInetSocketAddressMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveInetSocketAddressMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveInetSocketAddressMethod "enumerate" o = Gio.SocketConnectable.SocketConnectableEnumerateMethodInfo
ResolveInetSocketAddressMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveInetSocketAddressMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveInetSocketAddressMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveInetSocketAddressMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveInetSocketAddressMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveInetSocketAddressMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveInetSocketAddressMethod "proxyEnumerate" o = Gio.SocketConnectable.SocketConnectableProxyEnumerateMethodInfo
ResolveInetSocketAddressMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveInetSocketAddressMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveInetSocketAddressMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveInetSocketAddressMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveInetSocketAddressMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveInetSocketAddressMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveInetSocketAddressMethod "toNative" o = Gio.SocketAddress.SocketAddressToNativeMethodInfo
ResolveInetSocketAddressMethod "toString" o = Gio.SocketConnectable.SocketConnectableToStringMethodInfo
ResolveInetSocketAddressMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveInetSocketAddressMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveInetSocketAddressMethod "getAddress" o = InetSocketAddressGetAddressMethodInfo
ResolveInetSocketAddressMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveInetSocketAddressMethod "getFamily" o = Gio.SocketAddress.SocketAddressGetFamilyMethodInfo
ResolveInetSocketAddressMethod "getFlowinfo" o = InetSocketAddressGetFlowinfoMethodInfo
ResolveInetSocketAddressMethod "getNativeSize" o = Gio.SocketAddress.SocketAddressGetNativeSizeMethodInfo
ResolveInetSocketAddressMethod "getPort" o = InetSocketAddressGetPortMethodInfo
ResolveInetSocketAddressMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveInetSocketAddressMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveInetSocketAddressMethod "getScopeId" o = InetSocketAddressGetScopeIdMethodInfo
ResolveInetSocketAddressMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveInetSocketAddressMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveInetSocketAddressMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveInetSocketAddressMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveInetSocketAddressMethod t InetSocketAddress, O.MethodInfo info InetSocketAddress p) => OL.IsLabel t (InetSocketAddress -> 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
getInetSocketAddressAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m Gio.InetAddress.InetAddress
getInetSocketAddressAddress obj = liftIO $ checkUnexpectedNothing "getInetSocketAddressAddress" $ B.Properties.getObjectPropertyObject obj "address" Gio.InetAddress.InetAddress
constructInetSocketAddressAddress :: (IsInetSocketAddress o, Gio.InetAddress.IsInetAddress a) => a -> IO (GValueConstruct o)
constructInetSocketAddressAddress val = B.Properties.constructObjectPropertyObject "address" (Just val)
#if ENABLE_OVERLOADING
data InetSocketAddressAddressPropertyInfo
instance AttrInfo InetSocketAddressAddressPropertyInfo where
type AttrAllowedOps InetSocketAddressAddressPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint InetSocketAddressAddressPropertyInfo = Gio.InetAddress.IsInetAddress
type AttrBaseTypeConstraint InetSocketAddressAddressPropertyInfo = IsInetSocketAddress
type AttrGetType InetSocketAddressAddressPropertyInfo = Gio.InetAddress.InetAddress
type AttrLabel InetSocketAddressAddressPropertyInfo = "address"
type AttrOrigin InetSocketAddressAddressPropertyInfo = InetSocketAddress
attrGet _ = getInetSocketAddressAddress
attrSet _ = undefined
attrConstruct _ = constructInetSocketAddressAddress
attrClear _ = undefined
#endif
getInetSocketAddressFlowinfo :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
getInetSocketAddressFlowinfo obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "flowinfo"
constructInetSocketAddressFlowinfo :: (IsInetSocketAddress o) => Word32 -> IO (GValueConstruct o)
constructInetSocketAddressFlowinfo val = B.Properties.constructObjectPropertyUInt32 "flowinfo" val
#if ENABLE_OVERLOADING
data InetSocketAddressFlowinfoPropertyInfo
instance AttrInfo InetSocketAddressFlowinfoPropertyInfo where
type AttrAllowedOps InetSocketAddressFlowinfoPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint InetSocketAddressFlowinfoPropertyInfo = (~) Word32
type AttrBaseTypeConstraint InetSocketAddressFlowinfoPropertyInfo = IsInetSocketAddress
type AttrGetType InetSocketAddressFlowinfoPropertyInfo = Word32
type AttrLabel InetSocketAddressFlowinfoPropertyInfo = "flowinfo"
type AttrOrigin InetSocketAddressFlowinfoPropertyInfo = InetSocketAddress
attrGet _ = getInetSocketAddressFlowinfo
attrSet _ = undefined
attrConstruct _ = constructInetSocketAddressFlowinfo
attrClear _ = undefined
#endif
getInetSocketAddressPort :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
getInetSocketAddressPort obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "port"
constructInetSocketAddressPort :: (IsInetSocketAddress o) => Word32 -> IO (GValueConstruct o)
constructInetSocketAddressPort val = B.Properties.constructObjectPropertyUInt32 "port" val
#if ENABLE_OVERLOADING
data InetSocketAddressPortPropertyInfo
instance AttrInfo InetSocketAddressPortPropertyInfo where
type AttrAllowedOps InetSocketAddressPortPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint InetSocketAddressPortPropertyInfo = (~) Word32
type AttrBaseTypeConstraint InetSocketAddressPortPropertyInfo = IsInetSocketAddress
type AttrGetType InetSocketAddressPortPropertyInfo = Word32
type AttrLabel InetSocketAddressPortPropertyInfo = "port"
type AttrOrigin InetSocketAddressPortPropertyInfo = InetSocketAddress
attrGet _ = getInetSocketAddressPort
attrSet _ = undefined
attrConstruct _ = constructInetSocketAddressPort
attrClear _ = undefined
#endif
getInetSocketAddressScopeId :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
getInetSocketAddressScopeId obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "scope-id"
constructInetSocketAddressScopeId :: (IsInetSocketAddress o) => Word32 -> IO (GValueConstruct o)
constructInetSocketAddressScopeId val = B.Properties.constructObjectPropertyUInt32 "scope-id" val
#if ENABLE_OVERLOADING
data InetSocketAddressScopeIdPropertyInfo
instance AttrInfo InetSocketAddressScopeIdPropertyInfo where
type AttrAllowedOps InetSocketAddressScopeIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint InetSocketAddressScopeIdPropertyInfo = (~) Word32
type AttrBaseTypeConstraint InetSocketAddressScopeIdPropertyInfo = IsInetSocketAddress
type AttrGetType InetSocketAddressScopeIdPropertyInfo = Word32
type AttrLabel InetSocketAddressScopeIdPropertyInfo = "scope-id"
type AttrOrigin InetSocketAddressScopeIdPropertyInfo = InetSocketAddress
attrGet _ = getInetSocketAddressScopeId
attrSet _ = undefined
attrConstruct _ = constructInetSocketAddressScopeId
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList InetSocketAddress
type instance O.AttributeList InetSocketAddress = InetSocketAddressAttributeList
type InetSocketAddressAttributeList = ('[ '("address", InetSocketAddressAddressPropertyInfo), '("family", Gio.SocketAddress.SocketAddressFamilyPropertyInfo), '("flowinfo", InetSocketAddressFlowinfoPropertyInfo), '("port", InetSocketAddressPortPropertyInfo), '("scopeId", InetSocketAddressScopeIdPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
inetSocketAddressAddress :: AttrLabelProxy "address"
inetSocketAddressAddress = AttrLabelProxy
inetSocketAddressFlowinfo :: AttrLabelProxy "flowinfo"
inetSocketAddressFlowinfo = AttrLabelProxy
inetSocketAddressPort :: AttrLabelProxy "port"
inetSocketAddressPort = AttrLabelProxy
inetSocketAddressScopeId :: AttrLabelProxy "scopeId"
inetSocketAddressScopeId = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList InetSocketAddress = InetSocketAddressSignalList
type InetSocketAddressSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_inet_socket_address_new" g_inet_socket_address_new ::
Ptr Gio.InetAddress.InetAddress ->
Word16 ->
IO (Ptr InetSocketAddress)
inetSocketAddressNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InetAddress.IsInetAddress a) =>
a
-> Word16
-> m InetSocketAddress
inetSocketAddressNew address port = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_inet_socket_address_new address' port
checkUnexpectedReturnNULL "inetSocketAddressNew" result
result' <- (wrapObject InetSocketAddress) result
touchManagedPtr address
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_inet_socket_address_new_from_string" g_inet_socket_address_new_from_string ::
CString ->
Word32 ->
IO (Ptr InetSocketAddress)
inetSocketAddressNewFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Word32
-> m InetSocketAddress
inetSocketAddressNewFromString address port = liftIO $ do
address' <- textToCString address
result <- g_inet_socket_address_new_from_string address' port
checkUnexpectedReturnNULL "inetSocketAddressNewFromString" result
result' <- (wrapObject InetSocketAddress) result
freeMem address'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_inet_socket_address_get_address" g_inet_socket_address_get_address ::
Ptr InetSocketAddress ->
IO (Ptr Gio.InetAddress.InetAddress)
inetSocketAddressGetAddress ::
(B.CallStack.HasCallStack, MonadIO m, IsInetSocketAddress a) =>
a
-> m Gio.InetAddress.InetAddress
inetSocketAddressGetAddress address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_inet_socket_address_get_address address'
checkUnexpectedReturnNULL "inetSocketAddressGetAddress" result
result' <- (newObject Gio.InetAddress.InetAddress) result
touchManagedPtr address
return result'
#if ENABLE_OVERLOADING
data InetSocketAddressGetAddressMethodInfo
instance (signature ~ (m Gio.InetAddress.InetAddress), MonadIO m, IsInetSocketAddress a) => O.MethodInfo InetSocketAddressGetAddressMethodInfo a signature where
overloadedMethod _ = inetSocketAddressGetAddress
#endif
foreign import ccall "g_inet_socket_address_get_flowinfo" g_inet_socket_address_get_flowinfo ::
Ptr InetSocketAddress ->
IO Word32
inetSocketAddressGetFlowinfo ::
(B.CallStack.HasCallStack, MonadIO m, IsInetSocketAddress a) =>
a
-> m Word32
inetSocketAddressGetFlowinfo address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_inet_socket_address_get_flowinfo address'
touchManagedPtr address
return result
#if ENABLE_OVERLOADING
data InetSocketAddressGetFlowinfoMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsInetSocketAddress a) => O.MethodInfo InetSocketAddressGetFlowinfoMethodInfo a signature where
overloadedMethod _ = inetSocketAddressGetFlowinfo
#endif
foreign import ccall "g_inet_socket_address_get_port" g_inet_socket_address_get_port ::
Ptr InetSocketAddress ->
IO Word16
inetSocketAddressGetPort ::
(B.CallStack.HasCallStack, MonadIO m, IsInetSocketAddress a) =>
a
-> m Word16
inetSocketAddressGetPort address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_inet_socket_address_get_port address'
touchManagedPtr address
return result
#if ENABLE_OVERLOADING
data InetSocketAddressGetPortMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsInetSocketAddress a) => O.MethodInfo InetSocketAddressGetPortMethodInfo a signature where
overloadedMethod _ = inetSocketAddressGetPort
#endif
foreign import ccall "g_inet_socket_address_get_scope_id" g_inet_socket_address_get_scope_id ::
Ptr InetSocketAddress ->
IO Word32
inetSocketAddressGetScopeId ::
(B.CallStack.HasCallStack, MonadIO m, IsInetSocketAddress a) =>
a
-> m Word32
inetSocketAddressGetScopeId address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_inet_socket_address_get_scope_id address'
touchManagedPtr address
return result
#if ENABLE_OVERLOADING
data InetSocketAddressGetScopeIdMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsInetSocketAddress a) => O.MethodInfo InetSocketAddressGetScopeIdMethodInfo a signature where
overloadedMethod _ = inetSocketAddressGetScopeId
#endif