Interface BindingTransformFunc

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

Functional interface declaration of the BindingTransformFunc callback.

See Also:
  • Method Details

    • run

      boolean run(Binding binding, Value fromValue, Value toValue)

      A function to be called to transform fromValue to toValue.

      If this is the transformTo function of a binding, then fromValue is the sourceProperty on the source object, and toValue is the targetProperty on the target object. If this is the transformFrom function of a BindingFlags.BIDIRECTIONAL binding, then those roles are reversed.

      Parameters:
      binding - a GBinding
      fromValue - the GValue containing the value to transform
      toValue - the GValue in which to store the transformed value
      Returns:
      true if the transformation was successful, and false otherwise
      Since:
      2.26
    • upcall

      default int upcall(MemorySegment binding, MemorySegment fromValue, MemorySegment toValue, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(Binding, Value, Value) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, 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