inline-r-1.0.1: Seamlessly call R from Haskell and vice versa. No FFI required.
Copyright(C) 2015 Tweag I/O Limited.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Foreign.R.EventLoop

Description

Bindings for R/R_ext/eventloop.h, for building event loops.

Synopsis

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.

Constructors

InputHandler 

Fields

inputHandlers :: Ptr (Ptr InputHandler) Source #

Input handlers used in event loops.

polledEvents :: Ptr (FunPtr (IO ())) Source #

R_PolledEvents global variable.

pollingPeriod :: Ptr CInt Source #

R_wait_usec global variable.

graphicsPolledEvents :: Ptr (FunPtr (IO ())) Source #

R_PolledEvents global variable.

graphicsPollingPeriod :: Ptr CInt Source #

R_wait_usec global variable.

checkActivity :: CInt -> CInt -> IO (Ptr FdSet) 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 #

Remove an input handler from an input handler chain. Returns True if the handler was successfully removed, False otherwise.