Copyright | (C) 2015 Tweag I/O Limited. |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Bindings for R/R_ext/eventloop.h
, for building event loops.
Synopsis
- 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 | |
|
Instances
Storable InputHandler Source # | |
Defined in Foreign.R.EventLoop sizeOf :: InputHandler -> Int # alignment :: InputHandler -> Int # peekElemOff :: Ptr InputHandler -> Int -> IO InputHandler # pokeElemOff :: Ptr InputHandler -> Int -> InputHandler -> IO () # peekByteOff :: Ptr b -> Int -> IO InputHandler # pokeByteOff :: Ptr b -> Int -> InputHandler -> IO () # peek :: Ptr InputHandler -> IO InputHandler # poke :: Ptr InputHandler -> InputHandler -> IO () # | |
Show InputHandler Source # | |
Defined in Foreign.R.EventLoop showsPrec :: Int -> InputHandler -> ShowS # show :: InputHandler -> String # showList :: [InputHandler] -> ShowS # | |
Eq InputHandler Source # | |
Defined in Foreign.R.EventLoop (==) :: InputHandler -> InputHandler -> Bool # (/=) :: InputHandler -> InputHandler -> Bool # |
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 #