Copyright | (C) 2015 Tweag I/O Limited. |
---|---|
Safe Haskell | Safe |
Language | Haskell2010 |
Bindings for R/R_ext/eventloop.h
, for building event loops.
- data InputHandler = InputHandler {
- inputHandlerCallback :: FunPtr (Ptr () -> IO ())
- inputHandlerActivity :: CInt
- inputHandlerActive :: CInt
- inputHandlerFD :: Fd
- inputHandlerUserData :: Ptr ()
- inputHandlerNext :: Ptr InputHandler
- inputHandlers :: Ptr (Ptr InputHandler)
- polledEvents :: Ptr (FunPtr (IO ()))
- pollingPeriod :: Ptr CInt
- graphicsPolledEvents :: Ptr (FunPtr (IO ()))
- graphicsPollingPeriod :: Ptr CInt
- checkActivity :: CInt -> CInt -> IO (Ptr FdSet)
- runHandlers :: Ptr InputHandler -> Ptr FdSet -> IO ()
- addInputHandler :: Ptr InputHandler -> Fd -> FunPtr (Ptr () -> IO ()) -> Int -> IO (Ptr InputHandler)
- removeInputHandler :: Ptr InputHandler -> Ptr InputHandler -> IO Bool
Documentation
data InputHandler Source #
R input handler chain. Each input handler points to the next. This view of
input handlers is shallow, in the sense that the Storable
instance only
unmarshalls the first element in the chain at any one time. A shallow view
allows peek
and poke
to be inlinable.
InputHandler | |
|
inputHandlers :: Ptr (Ptr InputHandler) Source #
Input handlers used in event loops.
pollingPeriod :: Ptr CInt Source #
R_wait_usec
global variable.
graphicsPollingPeriod :: Ptr CInt Source #
R_wait_usec
global variable.
runHandlers :: Ptr InputHandler -> Ptr FdSet -> IO () Source #
addInputHandler :: Ptr InputHandler -> Fd -> FunPtr (Ptr () -> IO ()) -> Int -> IO (Ptr InputHandler) Source #
Create and register a new InputHandler
. The given file descriptor should
be open in non-blocking read mode. Make sure to dispose of the callback using
freeHaskellFunPtr
after calling removeInputHandler
where appropriate.
removeInputHandler :: Ptr InputHandler -> Ptr InputHandler -> IO Bool Source #