Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The GSourceFuncs
struct contains a table of
functions used to handle event sources in a generic manner.
For idle sources, the prepare and check functions always return True
to indicate that the source is always ready to be processed. The prepare
function also returns a timeout value of 0 to ensure that the poll()
call
doesn't block (since that would be time wasted which could have been spent
running the idle function).
For timeout sources, the prepare and check functions both return True
if the timeout interval has expired. The prepare function also returns
a timeout value to ensure that the poll()
call doesn't block too long
and miss the next timeout.
For file descriptor sources, the prepare function typically returns False
,
since it must wait until poll()
has been called before it knows whether
any events need to be processed. It sets the returned timeout to -1 to
indicate that it doesn't mind how long the poll()
call blocks. In the
check function, it tests the results of the poll()
call to see if the
required condition has been met, and returns True
if so.
Synopsis
- newtype SourceFuncs = SourceFuncs (ManagedPtr SourceFuncs)
- newZeroSourceFuncs :: MonadIO m => m SourceFuncs
- clearSourceFuncsCheck :: MonadIO m => SourceFuncs -> m ()
- getSourceFuncsCheck :: MonadIO m => SourceFuncs -> m (Maybe SourceFuncsCheckFieldCallback)
- setSourceFuncsCheck :: MonadIO m => SourceFuncs -> FunPtr C_SourceFuncsCheckFieldCallback -> m ()
- clearSourceFuncsFinalize :: MonadIO m => SourceFuncs -> m ()
- getSourceFuncsFinalize :: MonadIO m => SourceFuncs -> m (Maybe SourceFuncsFinalizeFieldCallback)
- setSourceFuncsFinalize :: MonadIO m => SourceFuncs -> FunPtr C_SourceFuncsFinalizeFieldCallback -> m ()
- clearSourceFuncsPrepare :: MonadIO m => SourceFuncs -> m ()
- getSourceFuncsPrepare :: MonadIO m => SourceFuncs -> m (Maybe SourceFuncsPrepareFieldCallback)
- setSourceFuncsPrepare :: MonadIO m => SourceFuncs -> FunPtr C_SourceFuncsPrepareFieldCallback -> m ()
Exported types
newtype SourceFuncs Source #
Memory-managed wrapper type.
Instances
Eq SourceFuncs Source # | |
Defined in GI.GLib.Structs.SourceFuncs (==) :: SourceFuncs -> SourceFuncs -> Bool # (/=) :: SourceFuncs -> SourceFuncs -> Bool # | |
BoxedPtr SourceFuncs Source # | |
Defined in GI.GLib.Structs.SourceFuncs boxedPtrCopy :: SourceFuncs -> IO SourceFuncs # boxedPtrFree :: SourceFuncs -> IO () # | |
CallocPtr SourceFuncs Source # | |
Defined in GI.GLib.Structs.SourceFuncs boxedPtrCalloc :: IO (Ptr SourceFuncs) # | |
ManagedPtrNewtype SourceFuncs Source # | |
Defined in GI.GLib.Structs.SourceFuncs | |
tag ~ 'AttrSet => Constructible SourceFuncs tag Source # | |
Defined in GI.GLib.Structs.SourceFuncs new :: MonadIO m => (ManagedPtr SourceFuncs -> SourceFuncs) -> [AttrOp SourceFuncs tag] -> m SourceFuncs # |
newZeroSourceFuncs :: MonadIO m => m SourceFuncs Source #
Construct a SourceFuncs
struct initialized to zero.
Methods
Properties
check
No description available in the introspection data.
clearSourceFuncsCheck :: MonadIO m => SourceFuncs -> m () Source #
Set the value of the “check
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#check
getSourceFuncsCheck :: MonadIO m => SourceFuncs -> m (Maybe SourceFuncsCheckFieldCallback) Source #
Get the value of the “check
” field.
When overloading is enabled, this is equivalent to
get
sourceFuncs #check
setSourceFuncsCheck :: MonadIO m => SourceFuncs -> FunPtr C_SourceFuncsCheckFieldCallback -> m () Source #
Set the value of the “check
” field.
When overloading is enabled, this is equivalent to
set
sourceFuncs [ #check:=
value ]
finalize
No description available in the introspection data.
clearSourceFuncsFinalize :: MonadIO m => SourceFuncs -> m () Source #
Set the value of the “finalize
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#finalize
getSourceFuncsFinalize :: MonadIO m => SourceFuncs -> m (Maybe SourceFuncsFinalizeFieldCallback) Source #
Get the value of the “finalize
” field.
When overloading is enabled, this is equivalent to
get
sourceFuncs #finalize
setSourceFuncsFinalize :: MonadIO m => SourceFuncs -> FunPtr C_SourceFuncsFinalizeFieldCallback -> m () Source #
Set the value of the “finalize
” field.
When overloading is enabled, this is equivalent to
set
sourceFuncs [ #finalize:=
value ]
prepare
No description available in the introspection data.
clearSourceFuncsPrepare :: MonadIO m => SourceFuncs -> m () Source #
Set the value of the “prepare
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#prepare
getSourceFuncsPrepare :: MonadIO m => SourceFuncs -> m (Maybe SourceFuncsPrepareFieldCallback) Source #
Get the value of the “prepare
” field.
When overloading is enabled, this is equivalent to
get
sourceFuncs #prepare
setSourceFuncsPrepare :: MonadIO m => SourceFuncs -> FunPtr C_SourceFuncsPrepareFieldCallback -> m () Source #
Set the value of the “prepare
” field.
When overloading is enabled, this is equivalent to
set
sourceFuncs [ #prepare:=
value ]