Package org.gnome.glib
Interface SourceFuncsPrepareFunc
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Generated("io.github.jwharm.JavaGI")
public interface SourceFuncsPrepareFunc
extends FunctionPointer
Functional interface declaration of the
SourceFuncsPrepareFunc
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks the source for readiness.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment source, MemorySegment timeout) Theupcall
method is called from native code.
-
Method Details
-
run
Checks the source for readiness.Called before all the file descriptors are polled. If the source can determine that it is ready here (without waiting for the results of the poll call) it should return
true
. It can also return atimeout
value which should be the maximum timeout (in milliseconds) which should be passed to the poll call. The actual timeout used will be-1
if all sources returned-1
, or it will be the minimum of all thetimeout
values returned which were greater than or equal to0
. If the prepare function returns a timeout and the source also has a ready time set, then the lower of the two will be used.Since 2.36 this may be
NULL
, in which case the effect is as if the function always returnsFALSE
with a timeout of-1
. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.glib.Source, io.github.jwharm.javagi.base.Out<java.lang.Integer>)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-