Interface PathForeachFunc

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 PathForeachFunc extends FunctionPointer

Functional interface declaration of the PathForeachFunc callback.

See Also:
  • Method Details

    • run

      boolean run(PathOperation op, @Nullable Point @Nullable [] pts, float weight)

      Type of the callback to iterate through the operations of a path.

      For each operation, the callback is given the op itself, the points that the operation is applied to in pts, and a weight for conic curves. The nPts argument is somewhat redundant, since the number of points can be inferred from the operation.

      Each contour of the path starts with a GSKPATHMOVE operation. Closed contours end with a GSKPATHCLOSE operation.

      Parameters:
      op - The operation
      pts - The points of the operation
      weight - The weight for conic curves, or unused if not a conic curve
      Returns:
      true to continue iterating the path, false to immediately abort and not call the function again.
    • upcall

      default int upcall(int op, MemorySegment pts, long nPts, float weight, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(PathOperation, Point[], float) is executed.
    • toCallback

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