#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.OutputMessage
(
OutputMessage(..) ,
newZeroOutputMessage ,
noOutputMessage ,
clearOutputMessageAddress ,
getOutputMessageAddress ,
#if ENABLE_OVERLOADING
outputMessage_address ,
#endif
setOutputMessageAddress ,
getOutputMessageBytesSent ,
#if ENABLE_OVERLOADING
outputMessage_bytesSent ,
#endif
setOutputMessageBytesSent ,
getOutputMessageNumControlMessages ,
#if ENABLE_OVERLOADING
outputMessage_numControlMessages ,
#endif
setOutputMessageNumControlMessages ,
getOutputMessageNumVectors ,
#if ENABLE_OVERLOADING
outputMessage_numVectors ,
#endif
setOutputMessageNumVectors ,
clearOutputMessageVectors ,
getOutputMessageVectors ,
#if ENABLE_OVERLOADING
outputMessage_vectors ,
#endif
setOutputMessageVectors ,
) 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 {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
newtype OutputMessage = OutputMessage (ManagedPtr OutputMessage)
instance WrappedPtr OutputMessage where
wrappedPtrCalloc = callocBytes 40
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 40 >=> wrapPtr OutputMessage)
wrappedPtrFree = Just ptr_to_g_free
newZeroOutputMessage :: MonadIO m => m OutputMessage
newZeroOutputMessage = liftIO $ wrappedPtrCalloc >>= wrapPtr OutputMessage
instance tag ~ 'AttrSet => Constructible OutputMessage tag where
new _ attrs = do
o <- newZeroOutputMessage
GI.Attributes.set o attrs
return o
noOutputMessage :: Maybe OutputMessage
noOutputMessage = Nothing
getOutputMessageAddress :: MonadIO m => OutputMessage -> m (Maybe Gio.SocketAddress.SocketAddress)
getOutputMessageAddress s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr Gio.SocketAddress.SocketAddress)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject Gio.SocketAddress.SocketAddress) val'
return val''
return result
setOutputMessageAddress :: MonadIO m => OutputMessage -> Ptr Gio.SocketAddress.SocketAddress -> m ()
setOutputMessageAddress s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr Gio.SocketAddress.SocketAddress)
clearOutputMessageAddress :: MonadIO m => OutputMessage -> m ()
clearOutputMessageAddress s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr Gio.SocketAddress.SocketAddress)
#if ENABLE_OVERLOADING
data OutputMessageAddressFieldInfo
instance AttrInfo OutputMessageAddressFieldInfo where
type AttrAllowedOps OutputMessageAddressFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint OutputMessageAddressFieldInfo = (~) (Ptr Gio.SocketAddress.SocketAddress)
type AttrBaseTypeConstraint OutputMessageAddressFieldInfo = (~) OutputMessage
type AttrGetType OutputMessageAddressFieldInfo = Maybe Gio.SocketAddress.SocketAddress
type AttrLabel OutputMessageAddressFieldInfo = "address"
type AttrOrigin OutputMessageAddressFieldInfo = OutputMessage
attrGet _ = getOutputMessageAddress
attrSet _ = setOutputMessageAddress
attrConstruct = undefined
attrClear _ = clearOutputMessageAddress
outputMessage_address :: AttrLabelProxy "address"
outputMessage_address = AttrLabelProxy
#endif
getOutputMessageVectors :: MonadIO m => OutputMessage -> m (Maybe Gio.OutputVector.OutputVector)
getOutputMessageVectors s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr Gio.OutputVector.OutputVector)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newPtr Gio.OutputVector.OutputVector) val'
return val''
return result
setOutputMessageVectors :: MonadIO m => OutputMessage -> Ptr Gio.OutputVector.OutputVector -> m ()
setOutputMessageVectors s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Ptr Gio.OutputVector.OutputVector)
clearOutputMessageVectors :: MonadIO m => OutputMessage -> m ()
clearOutputMessageVectors s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Gio.OutputVector.OutputVector)
#if ENABLE_OVERLOADING
data OutputMessageVectorsFieldInfo
instance AttrInfo OutputMessageVectorsFieldInfo where
type AttrAllowedOps OutputMessageVectorsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint OutputMessageVectorsFieldInfo = (~) (Ptr Gio.OutputVector.OutputVector)
type AttrBaseTypeConstraint OutputMessageVectorsFieldInfo = (~) OutputMessage
type AttrGetType OutputMessageVectorsFieldInfo = Maybe Gio.OutputVector.OutputVector
type AttrLabel OutputMessageVectorsFieldInfo = "vectors"
type AttrOrigin OutputMessageVectorsFieldInfo = OutputMessage
attrGet _ = getOutputMessageVectors
attrSet _ = setOutputMessageVectors
attrConstruct = undefined
attrClear _ = clearOutputMessageVectors
outputMessage_vectors :: AttrLabelProxy "vectors"
outputMessage_vectors = AttrLabelProxy
#endif
getOutputMessageNumVectors :: MonadIO m => OutputMessage -> m Word32
getOutputMessageNumVectors s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Word32
return val
setOutputMessageNumVectors :: MonadIO m => OutputMessage -> Word32 -> m ()
setOutputMessageNumVectors s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Word32)
#if ENABLE_OVERLOADING
data OutputMessageNumVectorsFieldInfo
instance AttrInfo OutputMessageNumVectorsFieldInfo where
type AttrAllowedOps OutputMessageNumVectorsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint OutputMessageNumVectorsFieldInfo = (~) Word32
type AttrBaseTypeConstraint OutputMessageNumVectorsFieldInfo = (~) OutputMessage
type AttrGetType OutputMessageNumVectorsFieldInfo = Word32
type AttrLabel OutputMessageNumVectorsFieldInfo = "num_vectors"
type AttrOrigin OutputMessageNumVectorsFieldInfo = OutputMessage
attrGet _ = getOutputMessageNumVectors
attrSet _ = setOutputMessageNumVectors
attrConstruct = undefined
attrClear _ = undefined
outputMessage_numVectors :: AttrLabelProxy "numVectors"
outputMessage_numVectors = AttrLabelProxy
#endif
getOutputMessageBytesSent :: MonadIO m => OutputMessage -> m Word32
getOutputMessageBytesSent s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 20) :: IO Word32
return val
setOutputMessageBytesSent :: MonadIO m => OutputMessage -> Word32 -> m ()
setOutputMessageBytesSent s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 20) (val :: Word32)
#if ENABLE_OVERLOADING
data OutputMessageBytesSentFieldInfo
instance AttrInfo OutputMessageBytesSentFieldInfo where
type AttrAllowedOps OutputMessageBytesSentFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint OutputMessageBytesSentFieldInfo = (~) Word32
type AttrBaseTypeConstraint OutputMessageBytesSentFieldInfo = (~) OutputMessage
type AttrGetType OutputMessageBytesSentFieldInfo = Word32
type AttrLabel OutputMessageBytesSentFieldInfo = "bytes_sent"
type AttrOrigin OutputMessageBytesSentFieldInfo = OutputMessage
attrGet _ = getOutputMessageBytesSent
attrSet _ = setOutputMessageBytesSent
attrConstruct = undefined
attrClear _ = undefined
outputMessage_bytesSent :: AttrLabelProxy "bytesSent"
outputMessage_bytesSent = AttrLabelProxy
#endif
getOutputMessageNumControlMessages :: MonadIO m => OutputMessage -> m Word32
getOutputMessageNumControlMessages s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Word32
return val
setOutputMessageNumControlMessages :: MonadIO m => OutputMessage -> Word32 -> m ()
setOutputMessageNumControlMessages s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Word32)
#if ENABLE_OVERLOADING
data OutputMessageNumControlMessagesFieldInfo
instance AttrInfo OutputMessageNumControlMessagesFieldInfo where
type AttrAllowedOps OutputMessageNumControlMessagesFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint OutputMessageNumControlMessagesFieldInfo = (~) Word32
type AttrBaseTypeConstraint OutputMessageNumControlMessagesFieldInfo = (~) OutputMessage
type AttrGetType OutputMessageNumControlMessagesFieldInfo = Word32
type AttrLabel OutputMessageNumControlMessagesFieldInfo = "num_control_messages"
type AttrOrigin OutputMessageNumControlMessagesFieldInfo = OutputMessage
attrGet _ = getOutputMessageNumControlMessages
attrSet _ = setOutputMessageNumControlMessages
attrConstruct = undefined
attrClear _ = undefined
outputMessage_numControlMessages :: AttrLabelProxy "numControlMessages"
outputMessage_numControlMessages = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList OutputMessage
type instance O.AttributeList OutputMessage = OutputMessageAttributeList
type OutputMessageAttributeList = ('[ '("address", OutputMessageAddressFieldInfo), '("vectors", OutputMessageVectorsFieldInfo), '("numVectors", OutputMessageNumVectorsFieldInfo), '("bytesSent", OutputMessageBytesSentFieldInfo), '("numControlMessages", OutputMessageNumControlMessagesFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveOutputMessageMethod (t :: Symbol) (o :: *) :: * where
ResolveOutputMessageMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveOutputMessageMethod t OutputMessage, O.MethodInfo info OutputMessage p) => OL.IsLabel t (OutputMessage -> 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