Interface SourceFuncsDispatchFunc

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("org.javagi.JavaGI") public interface SourceFuncsDispatchFunc extends FunctionPointer

Functional interface declaration of the SourceFuncsDispatchFunc callback.

See Also:
  • Method Details

    • run

      boolean run(Source source)

      Dispatches the source callback.

      Called to dispatch the event source, after it has returned TRUE in either its prepare or its check function, or if a ready time has been reached. The dispatch function receives a callback function and user data. The callback function may be NULL if the source was never connected to a callback using Source.setCallback(SourceFunc). The dispatch function should call the callback function with userData and whatever additional parameters are needed for this type of event source. The return value of the dispatch function should be GLib.SOURCE_REMOVE if the source should be removed or GLib.SOURCE_CONTINUE to keep it.

      Parameters:
      source - The GSource
      Returns:
      GLib.SOURCE_REMOVE if the source should be removed, GLib.SOURCE_CONTINUE otherwise.
      Since:
      2.82
    • upcall

      default int upcall(MemorySegment source, MemorySegment callback, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(Source) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer