#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.UnixFDMessage
(
UnixFDMessage(..) ,
IsUnixFDMessage ,
toUnixFDMessage ,
noUnixFDMessage ,
#if ENABLE_OVERLOADING
UnixFDMessageAppendFdMethodInfo ,
#endif
unixFDMessageAppendFd ,
#if ENABLE_OVERLOADING
UnixFDMessageGetFdListMethodInfo ,
#endif
unixFDMessageGetFdList ,
unixFDMessageNew ,
unixFDMessageNewWithFdList ,
#if ENABLE_OVERLOADING
UnixFDMessageStealFdsMethodInfo ,
#endif
unixFDMessageStealFds ,
#if ENABLE_OVERLOADING
UnixFDMessageFdListPropertyInfo ,
#endif
constructUnixFDMessageFdList ,
getUnixFDMessageFdList ,
#if ENABLE_OVERLOADING
unixFDMessageFdList ,
#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.Objects.SocketControlMessage as Gio.SocketControlMessage
import {-# SOURCE #-} qualified GI.Gio.Objects.UnixFDList as Gio.UnixFDList
newtype UnixFDMessage = UnixFDMessage (ManagedPtr UnixFDMessage)
foreign import ccall "g_unix_fd_message_get_type"
c_g_unix_fd_message_get_type :: IO GType
instance GObject UnixFDMessage where
gobjectType = c_g_unix_fd_message_get_type
class (GObject o, O.IsDescendantOf UnixFDMessage o) => IsUnixFDMessage o
instance (GObject o, O.IsDescendantOf UnixFDMessage o) => IsUnixFDMessage o
instance O.HasParentTypes UnixFDMessage
type instance O.ParentTypes UnixFDMessage = '[Gio.SocketControlMessage.SocketControlMessage, GObject.Object.Object]
toUnixFDMessage :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDMessage
toUnixFDMessage = liftIO . unsafeCastTo UnixFDMessage
noUnixFDMessage :: Maybe UnixFDMessage
noUnixFDMessage = Nothing
#if ENABLE_OVERLOADING
type family ResolveUnixFDMessageMethod (t :: Symbol) (o :: *) :: * where
ResolveUnixFDMessageMethod "appendFd" o = UnixFDMessageAppendFdMethodInfo
ResolveUnixFDMessageMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveUnixFDMessageMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveUnixFDMessageMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveUnixFDMessageMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveUnixFDMessageMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveUnixFDMessageMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveUnixFDMessageMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveUnixFDMessageMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveUnixFDMessageMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveUnixFDMessageMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveUnixFDMessageMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveUnixFDMessageMethod "serialize" o = Gio.SocketControlMessage.SocketControlMessageSerializeMethodInfo
ResolveUnixFDMessageMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveUnixFDMessageMethod "stealFds" o = UnixFDMessageStealFdsMethodInfo
ResolveUnixFDMessageMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveUnixFDMessageMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveUnixFDMessageMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveUnixFDMessageMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveUnixFDMessageMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveUnixFDMessageMethod "getFdList" o = UnixFDMessageGetFdListMethodInfo
ResolveUnixFDMessageMethod "getLevel" o = Gio.SocketControlMessage.SocketControlMessageGetLevelMethodInfo
ResolveUnixFDMessageMethod "getMsgType" o = Gio.SocketControlMessage.SocketControlMessageGetMsgTypeMethodInfo
ResolveUnixFDMessageMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveUnixFDMessageMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveUnixFDMessageMethod "getSize" o = Gio.SocketControlMessage.SocketControlMessageGetSizeMethodInfo
ResolveUnixFDMessageMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveUnixFDMessageMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveUnixFDMessageMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveUnixFDMessageMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveUnixFDMessageMethod t UnixFDMessage, O.MethodInfo info UnixFDMessage p) => OL.IsLabel t (UnixFDMessage -> 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
getUnixFDMessageFdList :: (MonadIO m, IsUnixFDMessage o) => o -> m Gio.UnixFDList.UnixFDList
getUnixFDMessageFdList obj = liftIO $ checkUnexpectedNothing "getUnixFDMessageFdList" $ B.Properties.getObjectPropertyObject obj "fd-list" Gio.UnixFDList.UnixFDList
constructUnixFDMessageFdList :: (IsUnixFDMessage o, Gio.UnixFDList.IsUnixFDList a) => a -> IO (GValueConstruct o)
constructUnixFDMessageFdList val = B.Properties.constructObjectPropertyObject "fd-list" (Just val)
#if ENABLE_OVERLOADING
data UnixFDMessageFdListPropertyInfo
instance AttrInfo UnixFDMessageFdListPropertyInfo where
type AttrAllowedOps UnixFDMessageFdListPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint UnixFDMessageFdListPropertyInfo = Gio.UnixFDList.IsUnixFDList
type AttrBaseTypeConstraint UnixFDMessageFdListPropertyInfo = IsUnixFDMessage
type AttrGetType UnixFDMessageFdListPropertyInfo = Gio.UnixFDList.UnixFDList
type AttrLabel UnixFDMessageFdListPropertyInfo = "fd-list"
type AttrOrigin UnixFDMessageFdListPropertyInfo = UnixFDMessage
attrGet _ = getUnixFDMessageFdList
attrSet _ = undefined
attrConstruct _ = constructUnixFDMessageFdList
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList UnixFDMessage
type instance O.AttributeList UnixFDMessage = UnixFDMessageAttributeList
type UnixFDMessageAttributeList = ('[ '("fdList", UnixFDMessageFdListPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
unixFDMessageFdList :: AttrLabelProxy "fdList"
unixFDMessageFdList = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList UnixFDMessage = UnixFDMessageSignalList
type UnixFDMessageSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_unix_fd_message_new" g_unix_fd_message_new ::
IO (Ptr UnixFDMessage)
unixFDMessageNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m UnixFDMessage
unixFDMessageNew = liftIO $ do
result <- g_unix_fd_message_new
checkUnexpectedReturnNULL "unixFDMessageNew" result
result' <- (wrapObject UnixFDMessage) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_unix_fd_message_new_with_fd_list" g_unix_fd_message_new_with_fd_list ::
Ptr Gio.UnixFDList.UnixFDList ->
IO (Ptr UnixFDMessage)
unixFDMessageNewWithFdList ::
(B.CallStack.HasCallStack, MonadIO m, Gio.UnixFDList.IsUnixFDList a) =>
a
-> m UnixFDMessage
unixFDMessageNewWithFdList fdList = liftIO $ do
fdList' <- unsafeManagedPtrCastPtr fdList
result <- g_unix_fd_message_new_with_fd_list fdList'
checkUnexpectedReturnNULL "unixFDMessageNewWithFdList" result
result' <- (wrapObject UnixFDMessage) result
touchManagedPtr fdList
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_unix_fd_message_append_fd" g_unix_fd_message_append_fd ::
Ptr UnixFDMessage ->
Int32 ->
Ptr (Ptr GError) ->
IO CInt
unixFDMessageAppendFd ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixFDMessage a) =>
a
-> Int32
-> m ()
unixFDMessageAppendFd message fd = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
onException (do
_ <- propagateGError $ g_unix_fd_message_append_fd message' fd
touchManagedPtr message
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data UnixFDMessageAppendFdMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsUnixFDMessage a) => O.MethodInfo UnixFDMessageAppendFdMethodInfo a signature where
overloadedMethod _ = unixFDMessageAppendFd
#endif
foreign import ccall "g_unix_fd_message_get_fd_list" g_unix_fd_message_get_fd_list ::
Ptr UnixFDMessage ->
IO (Ptr Gio.UnixFDList.UnixFDList)
unixFDMessageGetFdList ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixFDMessage a) =>
a
-> m Gio.UnixFDList.UnixFDList
unixFDMessageGetFdList message = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
result <- g_unix_fd_message_get_fd_list message'
checkUnexpectedReturnNULL "unixFDMessageGetFdList" result
result' <- (newObject Gio.UnixFDList.UnixFDList) result
touchManagedPtr message
return result'
#if ENABLE_OVERLOADING
data UnixFDMessageGetFdListMethodInfo
instance (signature ~ (m Gio.UnixFDList.UnixFDList), MonadIO m, IsUnixFDMessage a) => O.MethodInfo UnixFDMessageGetFdListMethodInfo a signature where
overloadedMethod _ = unixFDMessageGetFdList
#endif
foreign import ccall "g_unix_fd_message_steal_fds" g_unix_fd_message_steal_fds ::
Ptr UnixFDMessage ->
Ptr Int32 ->
IO (Ptr Int32)
unixFDMessageStealFds ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixFDMessage a) =>
a
-> m [Int32]
unixFDMessageStealFds message = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
length_ <- allocMem :: IO (Ptr Int32)
result <- g_unix_fd_message_steal_fds message' length_
length_' <- peek length_
checkUnexpectedReturnNULL "unixFDMessageStealFds" result
result' <- (unpackStorableArrayWithLength length_') result
freeMem result
touchManagedPtr message
freeMem length_
return result'
#if ENABLE_OVERLOADING
data UnixFDMessageStealFdsMethodInfo
instance (signature ~ (m [Int32]), MonadIO m, IsUnixFDMessage a) => O.MethodInfo UnixFDMessageStealFdsMethodInfo a signature where
overloadedMethod _ = unixFDMessageStealFds
#endif