#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.UnixSocketAddress
(
UnixSocketAddress(..) ,
IsUnixSocketAddress ,
toUnixSocketAddress ,
noUnixSocketAddress ,
unixSocketAddressAbstractNamesSupported ,
#if ENABLE_OVERLOADING
UnixSocketAddressGetAddressTypeMethodInfo,
#endif
unixSocketAddressGetAddressType ,
#if ENABLE_OVERLOADING
UnixSocketAddressGetIsAbstractMethodInfo,
#endif
unixSocketAddressGetIsAbstract ,
#if ENABLE_OVERLOADING
UnixSocketAddressGetPathMethodInfo ,
#endif
unixSocketAddressGetPath ,
#if ENABLE_OVERLOADING
UnixSocketAddressGetPathLenMethodInfo ,
#endif
unixSocketAddressGetPathLen ,
unixSocketAddressNew ,
unixSocketAddressNewAbstract ,
unixSocketAddressNewWithType ,
#if ENABLE_OVERLOADING
UnixSocketAddressAbstractPropertyInfo ,
#endif
constructUnixSocketAddressAbstract ,
getUnixSocketAddressAbstract ,
#if ENABLE_OVERLOADING
unixSocketAddressAbstract ,
#endif
#if ENABLE_OVERLOADING
UnixSocketAddressAddressTypePropertyInfo,
#endif
constructUnixSocketAddressAddressType ,
getUnixSocketAddressAddressType ,
#if ENABLE_OVERLOADING
unixSocketAddressAddressType ,
#endif
#if ENABLE_OVERLOADING
UnixSocketAddressPathPropertyInfo ,
#endif
constructUnixSocketAddressPath ,
getUnixSocketAddressPath ,
#if ENABLE_OVERLOADING
unixSocketAddressPath ,
#endif
#if ENABLE_OVERLOADING
UnixSocketAddressPathAsArrayPropertyInfo,
#endif
constructUnixSocketAddressPathAsArray ,
getUnixSocketAddressPathAsArray ,
#if ENABLE_OVERLOADING
unixSocketAddressPathAsArray ,
#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.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
newtype UnixSocketAddress = UnixSocketAddress (ManagedPtr UnixSocketAddress)
foreign import ccall "g_unix_socket_address_get_type"
c_g_unix_socket_address_get_type :: IO GType
instance GObject UnixSocketAddress where
gobjectType = c_g_unix_socket_address_get_type
class (GObject o, O.IsDescendantOf UnixSocketAddress o) => IsUnixSocketAddress o
instance (GObject o, O.IsDescendantOf UnixSocketAddress o) => IsUnixSocketAddress o
instance O.HasParentTypes UnixSocketAddress
type instance O.ParentTypes UnixSocketAddress = '[Gio.SocketAddress.SocketAddress, GObject.Object.Object, Gio.SocketConnectable.SocketConnectable]
toUnixSocketAddress :: (MonadIO m, IsUnixSocketAddress o) => o -> m UnixSocketAddress
toUnixSocketAddress = liftIO . unsafeCastTo UnixSocketAddress
noUnixSocketAddress :: Maybe UnixSocketAddress
noUnixSocketAddress = Nothing
#if ENABLE_OVERLOADING
type family ResolveUnixSocketAddressMethod (t :: Symbol) (o :: *) :: * where
ResolveUnixSocketAddressMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveUnixSocketAddressMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveUnixSocketAddressMethod "enumerate" o = Gio.SocketConnectable.SocketConnectableEnumerateMethodInfo
ResolveUnixSocketAddressMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveUnixSocketAddressMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveUnixSocketAddressMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveUnixSocketAddressMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveUnixSocketAddressMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveUnixSocketAddressMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveUnixSocketAddressMethod "proxyEnumerate" o = Gio.SocketConnectable.SocketConnectableProxyEnumerateMethodInfo
ResolveUnixSocketAddressMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveUnixSocketAddressMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveUnixSocketAddressMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveUnixSocketAddressMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveUnixSocketAddressMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveUnixSocketAddressMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveUnixSocketAddressMethod "toNative" o = Gio.SocketAddress.SocketAddressToNativeMethodInfo
ResolveUnixSocketAddressMethod "toString" o = Gio.SocketConnectable.SocketConnectableToStringMethodInfo
ResolveUnixSocketAddressMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveUnixSocketAddressMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveUnixSocketAddressMethod "getAddressType" o = UnixSocketAddressGetAddressTypeMethodInfo
ResolveUnixSocketAddressMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveUnixSocketAddressMethod "getFamily" o = Gio.SocketAddress.SocketAddressGetFamilyMethodInfo
ResolveUnixSocketAddressMethod "getIsAbstract" o = UnixSocketAddressGetIsAbstractMethodInfo
ResolveUnixSocketAddressMethod "getNativeSize" o = Gio.SocketAddress.SocketAddressGetNativeSizeMethodInfo
ResolveUnixSocketAddressMethod "getPath" o = UnixSocketAddressGetPathMethodInfo
ResolveUnixSocketAddressMethod "getPathLen" o = UnixSocketAddressGetPathLenMethodInfo
ResolveUnixSocketAddressMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveUnixSocketAddressMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveUnixSocketAddressMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveUnixSocketAddressMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveUnixSocketAddressMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveUnixSocketAddressMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveUnixSocketAddressMethod t UnixSocketAddress, O.MethodInfo info UnixSocketAddress p) => OL.IsLabel t (UnixSocketAddress -> 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
getUnixSocketAddressAbstract :: (MonadIO m, IsUnixSocketAddress o) => o -> m Bool
getUnixSocketAddressAbstract obj = liftIO $ B.Properties.getObjectPropertyBool obj "abstract"
constructUnixSocketAddressAbstract :: (IsUnixSocketAddress o) => Bool -> IO (GValueConstruct o)
constructUnixSocketAddressAbstract val = B.Properties.constructObjectPropertyBool "abstract" val
#if ENABLE_OVERLOADING
data UnixSocketAddressAbstractPropertyInfo
instance AttrInfo UnixSocketAddressAbstractPropertyInfo where
type AttrAllowedOps UnixSocketAddressAbstractPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint UnixSocketAddressAbstractPropertyInfo = (~) Bool
type AttrBaseTypeConstraint UnixSocketAddressAbstractPropertyInfo = IsUnixSocketAddress
type AttrGetType UnixSocketAddressAbstractPropertyInfo = Bool
type AttrLabel UnixSocketAddressAbstractPropertyInfo = "abstract"
type AttrOrigin UnixSocketAddressAbstractPropertyInfo = UnixSocketAddress
attrGet _ = getUnixSocketAddressAbstract
attrSet _ = undefined
attrConstruct _ = constructUnixSocketAddressAbstract
attrClear _ = undefined
#endif
getUnixSocketAddressAddressType :: (MonadIO m, IsUnixSocketAddress o) => o -> m Gio.Enums.UnixSocketAddressType
getUnixSocketAddressAddressType obj = liftIO $ B.Properties.getObjectPropertyEnum obj "address-type"
constructUnixSocketAddressAddressType :: (IsUnixSocketAddress o) => Gio.Enums.UnixSocketAddressType -> IO (GValueConstruct o)
constructUnixSocketAddressAddressType val = B.Properties.constructObjectPropertyEnum "address-type" val
#if ENABLE_OVERLOADING
data UnixSocketAddressAddressTypePropertyInfo
instance AttrInfo UnixSocketAddressAddressTypePropertyInfo where
type AttrAllowedOps UnixSocketAddressAddressTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint UnixSocketAddressAddressTypePropertyInfo = (~) Gio.Enums.UnixSocketAddressType
type AttrBaseTypeConstraint UnixSocketAddressAddressTypePropertyInfo = IsUnixSocketAddress
type AttrGetType UnixSocketAddressAddressTypePropertyInfo = Gio.Enums.UnixSocketAddressType
type AttrLabel UnixSocketAddressAddressTypePropertyInfo = "address-type"
type AttrOrigin UnixSocketAddressAddressTypePropertyInfo = UnixSocketAddress
attrGet _ = getUnixSocketAddressAddressType
attrSet _ = undefined
attrConstruct _ = constructUnixSocketAddressAddressType
attrClear _ = undefined
#endif
getUnixSocketAddressPath :: (MonadIO m, IsUnixSocketAddress o) => o -> m T.Text
getUnixSocketAddressPath obj = liftIO $ checkUnexpectedNothing "getUnixSocketAddressPath" $ B.Properties.getObjectPropertyString obj "path"
constructUnixSocketAddressPath :: (IsUnixSocketAddress o) => T.Text -> IO (GValueConstruct o)
constructUnixSocketAddressPath val = B.Properties.constructObjectPropertyString "path" (Just val)
#if ENABLE_OVERLOADING
data UnixSocketAddressPathPropertyInfo
instance AttrInfo UnixSocketAddressPathPropertyInfo where
type AttrAllowedOps UnixSocketAddressPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint UnixSocketAddressPathPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint UnixSocketAddressPathPropertyInfo = IsUnixSocketAddress
type AttrGetType UnixSocketAddressPathPropertyInfo = T.Text
type AttrLabel UnixSocketAddressPathPropertyInfo = "path"
type AttrOrigin UnixSocketAddressPathPropertyInfo = UnixSocketAddress
attrGet _ = getUnixSocketAddressPath
attrSet _ = undefined
attrConstruct _ = constructUnixSocketAddressPath
attrClear _ = undefined
#endif
getUnixSocketAddressPathAsArray :: (MonadIO m, IsUnixSocketAddress o) => o -> m (Maybe ByteString)
getUnixSocketAddressPathAsArray obj = liftIO $ B.Properties.getObjectPropertyByteArray obj "path-as-array"
constructUnixSocketAddressPathAsArray :: (IsUnixSocketAddress o) => ByteString -> IO (GValueConstruct o)
constructUnixSocketAddressPathAsArray val = B.Properties.constructObjectPropertyByteArray "path-as-array" (Just val)
#if ENABLE_OVERLOADING
data UnixSocketAddressPathAsArrayPropertyInfo
instance AttrInfo UnixSocketAddressPathAsArrayPropertyInfo where
type AttrAllowedOps UnixSocketAddressPathAsArrayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo = (~) ByteString
type AttrBaseTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo = IsUnixSocketAddress
type AttrGetType UnixSocketAddressPathAsArrayPropertyInfo = (Maybe ByteString)
type AttrLabel UnixSocketAddressPathAsArrayPropertyInfo = "path-as-array"
type AttrOrigin UnixSocketAddressPathAsArrayPropertyInfo = UnixSocketAddress
attrGet _ = getUnixSocketAddressPathAsArray
attrSet _ = undefined
attrConstruct _ = constructUnixSocketAddressPathAsArray
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList UnixSocketAddress
type instance O.AttributeList UnixSocketAddress = UnixSocketAddressAttributeList
type UnixSocketAddressAttributeList = ('[ '("abstract", UnixSocketAddressAbstractPropertyInfo), '("addressType", UnixSocketAddressAddressTypePropertyInfo), '("family", Gio.SocketAddress.SocketAddressFamilyPropertyInfo), '("path", UnixSocketAddressPathPropertyInfo), '("pathAsArray", UnixSocketAddressPathAsArrayPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
unixSocketAddressAbstract :: AttrLabelProxy "abstract"
unixSocketAddressAbstract = AttrLabelProxy
unixSocketAddressAddressType :: AttrLabelProxy "addressType"
unixSocketAddressAddressType = AttrLabelProxy
unixSocketAddressPath :: AttrLabelProxy "path"
unixSocketAddressPath = AttrLabelProxy
unixSocketAddressPathAsArray :: AttrLabelProxy "pathAsArray"
unixSocketAddressPathAsArray = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList UnixSocketAddress = UnixSocketAddressSignalList
type UnixSocketAddressSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_unix_socket_address_new" g_unix_socket_address_new ::
CString ->
IO (Ptr UnixSocketAddress)
unixSocketAddressNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m UnixSocketAddress
unixSocketAddressNew path = liftIO $ do
path' <- textToCString path
result <- g_unix_socket_address_new path'
checkUnexpectedReturnNULL "unixSocketAddressNew" result
result' <- (wrapObject UnixSocketAddress) result
freeMem path'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_unix_socket_address_new_abstract" g_unix_socket_address_new_abstract ::
Ptr Int8 ->
Int32 ->
IO (Ptr UnixSocketAddress)
{-# DEPRECATED unixSocketAddressNewAbstract ["Use 'GI.Gio.Objects.UnixSocketAddress.unixSocketAddressNewWithType'."] #-}
unixSocketAddressNewAbstract ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Int8]
-> m UnixSocketAddress
unixSocketAddressNewAbstract path = liftIO $ do
let pathLen = fromIntegral $ length path
path' <- packStorableArray path
result <- g_unix_socket_address_new_abstract path' pathLen
checkUnexpectedReturnNULL "unixSocketAddressNewAbstract" result
result' <- (wrapObject UnixSocketAddress) result
freeMem path'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_unix_socket_address_new_with_type" g_unix_socket_address_new_with_type ::
Ptr Int8 ->
Int32 ->
CUInt ->
IO (Ptr UnixSocketAddress)
unixSocketAddressNewWithType ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Int8]
-> Gio.Enums.UnixSocketAddressType
-> m UnixSocketAddress
unixSocketAddressNewWithType path type_ = liftIO $ do
let pathLen = fromIntegral $ length path
path' <- packStorableArray path
let type_' = (fromIntegral . fromEnum) type_
result <- g_unix_socket_address_new_with_type path' pathLen type_'
checkUnexpectedReturnNULL "unixSocketAddressNewWithType" result
result' <- (wrapObject UnixSocketAddress) result
freeMem path'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_unix_socket_address_get_address_type" g_unix_socket_address_get_address_type ::
Ptr UnixSocketAddress ->
IO CUInt
unixSocketAddressGetAddressType ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixSocketAddress a) =>
a
-> m Gio.Enums.UnixSocketAddressType
unixSocketAddressGetAddressType address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_unix_socket_address_get_address_type address'
let result' = (toEnum . fromIntegral) result
touchManagedPtr address
return result'
#if ENABLE_OVERLOADING
data UnixSocketAddressGetAddressTypeMethodInfo
instance (signature ~ (m Gio.Enums.UnixSocketAddressType), MonadIO m, IsUnixSocketAddress a) => O.MethodInfo UnixSocketAddressGetAddressTypeMethodInfo a signature where
overloadedMethod _ = unixSocketAddressGetAddressType
#endif
foreign import ccall "g_unix_socket_address_get_is_abstract" g_unix_socket_address_get_is_abstract ::
Ptr UnixSocketAddress ->
IO CInt
{-# DEPRECATED unixSocketAddressGetIsAbstract ["Use 'GI.Gio.Objects.UnixSocketAddress.unixSocketAddressGetAddressType'"] #-}
unixSocketAddressGetIsAbstract ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixSocketAddress a) =>
a
-> m Bool
unixSocketAddressGetIsAbstract address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_unix_socket_address_get_is_abstract address'
let result' = (/= 0) result
touchManagedPtr address
return result'
#if ENABLE_OVERLOADING
data UnixSocketAddressGetIsAbstractMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsUnixSocketAddress a) => O.MethodInfo UnixSocketAddressGetIsAbstractMethodInfo a signature where
overloadedMethod _ = unixSocketAddressGetIsAbstract
#endif
foreign import ccall "g_unix_socket_address_get_path" g_unix_socket_address_get_path ::
Ptr UnixSocketAddress ->
IO CString
unixSocketAddressGetPath ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixSocketAddress a) =>
a
-> m T.Text
unixSocketAddressGetPath address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_unix_socket_address_get_path address'
checkUnexpectedReturnNULL "unixSocketAddressGetPath" result
result' <- cstringToText result
touchManagedPtr address
return result'
#if ENABLE_OVERLOADING
data UnixSocketAddressGetPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsUnixSocketAddress a) => O.MethodInfo UnixSocketAddressGetPathMethodInfo a signature where
overloadedMethod _ = unixSocketAddressGetPath
#endif
foreign import ccall "g_unix_socket_address_get_path_len" g_unix_socket_address_get_path_len ::
Ptr UnixSocketAddress ->
IO Word64
unixSocketAddressGetPathLen ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixSocketAddress a) =>
a
-> m Word64
unixSocketAddressGetPathLen address = liftIO $ do
address' <- unsafeManagedPtrCastPtr address
result <- g_unix_socket_address_get_path_len address'
touchManagedPtr address
return result
#if ENABLE_OVERLOADING
data UnixSocketAddressGetPathLenMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsUnixSocketAddress a) => O.MethodInfo UnixSocketAddressGetPathLenMethodInfo a signature where
overloadedMethod _ = unixSocketAddressGetPathLen
#endif
foreign import ccall "g_unix_socket_address_abstract_names_supported" g_unix_socket_address_abstract_names_supported ::
IO CInt
unixSocketAddressAbstractNamesSupported ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bool
unixSocketAddressAbstractNamesSupported = liftIO $ do
result <- g_unix_socket_address_abstract_names_supported
let result' = (/= 0) result
return result'
#if ENABLE_OVERLOADING
#endif