Package org.gnome.gtk
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
@Generated("io.github.jwharm.JavaGI")
public interface TreeIterCompareFunc
extends FunctionPointer
Functional interface declaration of the
TreeIterCompareFunc
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive integer ifa
sorts beforeb
,a
sorts withb
, ora
sorts afterb
respectively.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment model, MemorySegment a, MemorySegment b, MemorySegment userData) Theupcall
method is called from native code.
-
Method Details
-
run
A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive integer ifa
sorts beforeb
,a
sorts withb
, ora
sorts afterb
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 returnsprice_of(@a) - price_of(@b)
. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.gtk.TreeModel, org.gnome.gtk.TreeIter, org.gnome.gtk.TreeIter)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, 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
-