Interface TreeIterCompareFunc

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 @Deprecated @Generated("org.javagi.JavaGI") public interface TreeIterCompareFunc extends FunctionPointer
Deprecated.

Functional interface declaration of the TreeIterCompareFunc callback.

See Also:
  • Method Details

    • run

      @Deprecated int run(TreeModel model, TreeIter a, TreeIter b)
      Deprecated.
      There is no replacement

      A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive integer if a sorts before b, a sorts with b, or a sorts after b respectively.

      If two iters compare as equal, their order in the sorted model is undefined. In order to ensure that the GtkTreeSortable behaves as expected, the GtkTreeIterCompareFunc must define a partial order on the model, i.e. it must be reflexive, antisymmetric and transitive.

      For example, if model is a product catalogue, then a compare function for the “price” column could be one which returns price_of(@a) - price_of(@b).

      Parameters:
      model - The GtkTreeModel the comparison is within
      a - A GtkTreeIter in model
      b - Another GtkTreeIter in model
      Returns:
      a negative integer, zero or a positive integer depending on whether a sorts before, with or after b
    • upcall

      default int upcall(MemorySegment model, MemorySegment a, MemorySegment b, MemorySegment userData)
      Deprecated.
      The upcall method is called from native code. The parameters are marshaled and run(TreeModel, TreeIter, TreeIter) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Deprecated.
      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