{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Structs.InputMessage
(
InputMessage(..) ,
newZeroInputMessage ,
noInputMessage ,
#if defined(ENABLE_OVERLOADING)
ResolveInputMessageMethod ,
#endif
clearInputMessageAddress ,
getInputMessageAddress ,
#if defined(ENABLE_OVERLOADING)
inputMessage_address ,
#endif
setInputMessageAddress ,
getInputMessageBytesReceived ,
#if defined(ENABLE_OVERLOADING)
inputMessage_bytesReceived ,
#endif
setInputMessageBytesReceived ,
getInputMessageFlags ,
#if defined(ENABLE_OVERLOADING)
inputMessage_flags ,
#endif
setInputMessageFlags ,
getInputMessageNumControlMessages ,
#if defined(ENABLE_OVERLOADING)
inputMessage_numControlMessages ,
#endif
setInputMessageNumControlMessages ,
getInputMessageNumVectors ,
#if defined(ENABLE_OVERLOADING)
inputMessage_numVectors ,
#endif
setInputMessageNumVectors ,
) 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 {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
newtype InputMessage = InputMessage (ManagedPtr InputMessage)
deriving (InputMessage -> InputMessage -> Bool
(InputMessage -> InputMessage -> Bool)
-> (InputMessage -> InputMessage -> Bool) -> Eq InputMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputMessage -> InputMessage -> Bool
$c/= :: InputMessage -> InputMessage -> Bool
== :: InputMessage -> InputMessage -> Bool
$c== :: InputMessage -> InputMessage -> Bool
Eq)
instance WrappedPtr InputMessage where
wrappedPtrCalloc :: IO (Ptr InputMessage)
wrappedPtrCalloc = Int -> IO (Ptr InputMessage)
forall a. Int -> IO (Ptr a)
callocBytes 56
wrappedPtrCopy :: InputMessage -> IO InputMessage
wrappedPtrCopy = \p :: InputMessage
p -> InputMessage
-> (Ptr InputMessage -> IO InputMessage) -> IO InputMessage
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
p (Int -> Ptr InputMessage -> IO (Ptr InputMessage)
forall a. WrappedPtr a => Int -> Ptr a -> IO (Ptr a)
copyBytes 56 (Ptr InputMessage -> IO (Ptr InputMessage))
-> (Ptr InputMessage -> IO InputMessage)
-> Ptr InputMessage
-> IO InputMessage
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr InputMessage -> InputMessage)
-> Ptr InputMessage -> IO InputMessage
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr InputMessage -> InputMessage
InputMessage)
wrappedPtrFree :: Maybe (GDestroyNotify InputMessage)
wrappedPtrFree = GDestroyNotify InputMessage -> Maybe (GDestroyNotify InputMessage)
forall a. a -> Maybe a
Just GDestroyNotify InputMessage
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free
newZeroInputMessage :: MonadIO m => m InputMessage
newZeroInputMessage :: m InputMessage
newZeroInputMessage = IO InputMessage -> m InputMessage
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputMessage -> m InputMessage)
-> IO InputMessage -> m InputMessage
forall a b. (a -> b) -> a -> b
$ IO (Ptr InputMessage)
forall a. WrappedPtr a => IO (Ptr a)
wrappedPtrCalloc IO (Ptr InputMessage)
-> (Ptr InputMessage -> IO InputMessage) -> IO InputMessage
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr InputMessage -> InputMessage)
-> Ptr InputMessage -> IO InputMessage
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr InputMessage -> InputMessage
InputMessage
instance tag ~ 'AttrSet => Constructible InputMessage tag where
new :: (ManagedPtr InputMessage -> InputMessage)
-> [AttrOp InputMessage tag] -> m InputMessage
new _ attrs :: [AttrOp InputMessage tag]
attrs = do
InputMessage
o <- m InputMessage
forall (m :: * -> *). MonadIO m => m InputMessage
newZeroInputMessage
InputMessage -> [AttrOp InputMessage 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set InputMessage
o [AttrOp InputMessage tag]
[AttrOp InputMessage 'AttrSet]
attrs
InputMessage -> m InputMessage
forall (m :: * -> *) a. Monad m => a -> m a
return InputMessage
o
noInputMessage :: Maybe InputMessage
noInputMessage :: Maybe InputMessage
noInputMessage = Maybe InputMessage
forall a. Maybe a
Nothing
getInputMessageAddress :: MonadIO m => InputMessage -> m (Maybe Gio.SocketAddress.SocketAddress)
getInputMessageAddress :: InputMessage -> m (Maybe SocketAddress)
getInputMessageAddress s :: InputMessage
s = IO (Maybe SocketAddress) -> m (Maybe SocketAddress)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SocketAddress) -> m (Maybe SocketAddress))
-> IO (Maybe SocketAddress) -> m (Maybe SocketAddress)
forall a b. (a -> b) -> a -> b
$ InputMessage
-> (Ptr InputMessage -> IO (Maybe SocketAddress))
-> IO (Maybe SocketAddress)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO (Maybe SocketAddress))
-> IO (Maybe SocketAddress))
-> (Ptr InputMessage -> IO (Maybe SocketAddress))
-> IO (Maybe SocketAddress)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr SocketAddress
val <- Ptr (Ptr SocketAddress) -> IO (Ptr SocketAddress)
forall a. Storable a => Ptr a -> IO a
peek (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr (Ptr SocketAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) :: IO (Ptr Gio.SocketAddress.SocketAddress)
Maybe SocketAddress
result <- Ptr SocketAddress
-> (Ptr SocketAddress -> IO SocketAddress)
-> IO (Maybe SocketAddress)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr SocketAddress
val ((Ptr SocketAddress -> IO SocketAddress)
-> IO (Maybe SocketAddress))
-> (Ptr SocketAddress -> IO SocketAddress)
-> IO (Maybe SocketAddress)
forall a b. (a -> b) -> a -> b
$ \val' :: Ptr SocketAddress
val' -> do
SocketAddress
val'' <- ((ManagedPtr SocketAddress -> SocketAddress)
-> Ptr SocketAddress -> IO SocketAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SocketAddress -> SocketAddress
Gio.SocketAddress.SocketAddress) Ptr SocketAddress
val'
SocketAddress -> IO SocketAddress
forall (m :: * -> *) a. Monad m => a -> m a
return SocketAddress
val''
Maybe SocketAddress -> IO (Maybe SocketAddress)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SocketAddress
result
setInputMessageAddress :: MonadIO m => InputMessage -> Ptr Gio.SocketAddress.SocketAddress -> m ()
setInputMessageAddress :: InputMessage -> Ptr SocketAddress -> m ()
setInputMessageAddress s :: InputMessage
s val :: Ptr SocketAddress
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO ()) -> IO ())
-> (Ptr InputMessage -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr (Ptr SocketAddress) -> Ptr SocketAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr (Ptr SocketAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (Ptr SocketAddress
val :: Ptr Gio.SocketAddress.SocketAddress)
clearInputMessageAddress :: MonadIO m => InputMessage -> m ()
clearInputMessageAddress :: InputMessage -> m ()
clearInputMessageAddress s :: InputMessage
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO ()) -> IO ())
-> (Ptr InputMessage -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr (Ptr SocketAddress) -> Ptr SocketAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr (Ptr SocketAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (Ptr SocketAddress
forall a. Ptr a
FP.nullPtr :: Ptr Gio.SocketAddress.SocketAddress)
#if defined(ENABLE_OVERLOADING)
data InputMessageAddressFieldInfo
instance AttrInfo InputMessageAddressFieldInfo where
type AttrBaseTypeConstraint InputMessageAddressFieldInfo = (~) InputMessage
type AttrAllowedOps InputMessageAddressFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint InputMessageAddressFieldInfo = (~) (Ptr Gio.SocketAddress.SocketAddress)
type AttrTransferTypeConstraint InputMessageAddressFieldInfo = (~)(Ptr Gio.SocketAddress.SocketAddress)
type AttrTransferType InputMessageAddressFieldInfo = (Ptr Gio.SocketAddress.SocketAddress)
type AttrGetType InputMessageAddressFieldInfo = Maybe Gio.SocketAddress.SocketAddress
type AttrLabel InputMessageAddressFieldInfo = "address"
type AttrOrigin InputMessageAddressFieldInfo = InputMessage
attrGet = getInputMessageAddress
attrSet = setInputMessageAddress
attrConstruct = undefined
attrClear = clearInputMessageAddress
attrTransfer _ v = do
return v
inputMessage_address :: AttrLabelProxy "address"
inputMessage_address = AttrLabelProxy
#endif
getInputMessageNumVectors :: MonadIO m => InputMessage -> m Word32
getInputMessageNumVectors :: InputMessage -> m Word32
getInputMessageNumVectors s :: InputMessage
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO Word32) -> IO Word32)
-> (Ptr InputMessage -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setInputMessageNumVectors :: MonadIO m => InputMessage -> Word32 -> m ()
setInputMessageNumVectors :: InputMessage -> Word32 -> m ()
setInputMessageNumVectors s :: InputMessage
s val :: Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO ()) -> IO ())
-> (Ptr InputMessage -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data InputMessageNumVectorsFieldInfo
instance AttrInfo InputMessageNumVectorsFieldInfo where
type AttrBaseTypeConstraint InputMessageNumVectorsFieldInfo = (~) InputMessage
type AttrAllowedOps InputMessageNumVectorsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint InputMessageNumVectorsFieldInfo = (~) Word32
type AttrTransferTypeConstraint InputMessageNumVectorsFieldInfo = (~)Word32
type AttrTransferType InputMessageNumVectorsFieldInfo = Word32
type AttrGetType InputMessageNumVectorsFieldInfo = Word32
type AttrLabel InputMessageNumVectorsFieldInfo = "num_vectors"
type AttrOrigin InputMessageNumVectorsFieldInfo = InputMessage
attrGet = getInputMessageNumVectors
attrSet = setInputMessageNumVectors
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
inputMessage_numVectors :: AttrLabelProxy "numVectors"
inputMessage_numVectors = AttrLabelProxy
#endif
getInputMessageBytesReceived :: MonadIO m => InputMessage -> m Word64
getInputMessageBytesReceived :: InputMessage -> m Word64
getInputMessageBytesReceived s :: InputMessage
s = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO Word64) -> IO Word64
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO Word64) -> IO Word64)
-> (Ptr InputMessage -> IO Word64) -> IO Word64
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Word64
val <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) :: IO Word64
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
val
setInputMessageBytesReceived :: MonadIO m => InputMessage -> Word64 -> m ()
setInputMessageBytesReceived :: InputMessage -> Word64 -> m ()
setInputMessageBytesReceived s :: InputMessage
s val :: Word64
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO ()) -> IO ())
-> (Ptr InputMessage -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (Word64
val :: Word64)
#if defined(ENABLE_OVERLOADING)
data InputMessageBytesReceivedFieldInfo
instance AttrInfo InputMessageBytesReceivedFieldInfo where
type AttrBaseTypeConstraint InputMessageBytesReceivedFieldInfo = (~) InputMessage
type AttrAllowedOps InputMessageBytesReceivedFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint InputMessageBytesReceivedFieldInfo = (~) Word64
type AttrTransferTypeConstraint InputMessageBytesReceivedFieldInfo = (~)Word64
type AttrTransferType InputMessageBytesReceivedFieldInfo = Word64
type AttrGetType InputMessageBytesReceivedFieldInfo = Word64
type AttrLabel InputMessageBytesReceivedFieldInfo = "bytes_received"
type AttrOrigin InputMessageBytesReceivedFieldInfo = InputMessage
attrGet = getInputMessageBytesReceived
attrSet = setInputMessageBytesReceived
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
inputMessage_bytesReceived :: AttrLabelProxy "bytesReceived"
inputMessage_bytesReceived = AttrLabelProxy
#endif
getInputMessageFlags :: MonadIO m => InputMessage -> m Int32
getInputMessageFlags :: InputMessage -> m Int32
getInputMessageFlags s :: InputMessage
s = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO Int32) -> IO Int32)
-> (Ptr InputMessage -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setInputMessageFlags :: MonadIO m => InputMessage -> Int32 -> m ()
setInputMessageFlags :: InputMessage -> Int32 -> m ()
setInputMessageFlags s :: InputMessage
s val :: Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO ()) -> IO ())
-> (Ptr InputMessage -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data InputMessageFlagsFieldInfo
instance AttrInfo InputMessageFlagsFieldInfo where
type AttrBaseTypeConstraint InputMessageFlagsFieldInfo = (~) InputMessage
type AttrAllowedOps InputMessageFlagsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint InputMessageFlagsFieldInfo = (~) Int32
type AttrTransferTypeConstraint InputMessageFlagsFieldInfo = (~)Int32
type AttrTransferType InputMessageFlagsFieldInfo = Int32
type AttrGetType InputMessageFlagsFieldInfo = Int32
type AttrLabel InputMessageFlagsFieldInfo = "flags"
type AttrOrigin InputMessageFlagsFieldInfo = InputMessage
attrGet = getInputMessageFlags
attrSet = setInputMessageFlags
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
inputMessage_flags :: AttrLabelProxy "flags"
inputMessage_flags = AttrLabelProxy
#endif
getInputMessageNumControlMessages :: MonadIO m => InputMessage -> m Word32
getInputMessageNumControlMessages :: InputMessage -> m Word32
getInputMessageNumControlMessages s :: InputMessage
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO Word32) -> IO Word32)
-> (Ptr InputMessage -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setInputMessageNumControlMessages :: MonadIO m => InputMessage -> Word32 -> m ()
setInputMessageNumControlMessages :: InputMessage -> Word32 -> m ()
setInputMessageNumControlMessages s :: InputMessage
s val :: Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ InputMessage -> (Ptr InputMessage -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr InputMessage
s ((Ptr InputMessage -> IO ()) -> IO ())
-> (Ptr InputMessage -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr InputMessage
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr InputMessage
ptr Ptr InputMessage -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data InputMessageNumControlMessagesFieldInfo
instance AttrInfo InputMessageNumControlMessagesFieldInfo where
type AttrBaseTypeConstraint InputMessageNumControlMessagesFieldInfo = (~) InputMessage
type AttrAllowedOps InputMessageNumControlMessagesFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint InputMessageNumControlMessagesFieldInfo = (~) Word32
type AttrTransferTypeConstraint InputMessageNumControlMessagesFieldInfo = (~)Word32
type AttrTransferType InputMessageNumControlMessagesFieldInfo = Word32
type AttrGetType InputMessageNumControlMessagesFieldInfo = Word32
type AttrLabel InputMessageNumControlMessagesFieldInfo = "num_control_messages"
type AttrOrigin InputMessageNumControlMessagesFieldInfo = InputMessage
attrGet = getInputMessageNumControlMessages
attrSet = setInputMessageNumControlMessages
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
inputMessage_numControlMessages :: AttrLabelProxy "numControlMessages"
inputMessage_numControlMessages = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList InputMessage
type instance O.AttributeList InputMessage = InputMessageAttributeList
type InputMessageAttributeList = ('[ '("address", InputMessageAddressFieldInfo), '("numVectors", InputMessageNumVectorsFieldInfo), '("bytesReceived", InputMessageBytesReceivedFieldInfo), '("flags", InputMessageFlagsFieldInfo), '("numControlMessages", InputMessageNumControlMessagesFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveInputMessageMethod (t :: Symbol) (o :: *) :: * where
ResolveInputMessageMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveInputMessageMethod t InputMessage, O.MethodInfo info InputMessage p) => OL.IsLabel t (InputMessage -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif